@blendsdk/year-planner-core
    Preparing search index...

    Type Alias PlannerCommand

    PlannerCommand:
        | { item: PlannerItem; type: "create" }
        | {
            expectedVersion: number;
            itemId: string;
            patch: Partial<Omit<PlannerItem, "id" | "version">>;
            type: "update";
        }
        | {
            expectedVersion: number;
            itemId: string;
            proposedPeriod: PlannerPeriod;
            type: "move";
        }
        | {
            expectedVersion: number;
            itemId: string;
            proposedPeriod: PlannerPeriod;
            type: "resize";
        }
        | { expectedVersion: number; itemId: string; type: "delete" }
        | {
            defaults: PaintDefaults;
            expectedVersions: Record<string, number>;
            layerId: string;
            operation: "union" | "subtract";
            period: PlannerPeriod;
            type: "paint";
        }

    The canonical command union used by the view and command pipeline.

    Type Declaration

    • { item: PlannerItem; type: "create" }
      • item: PlannerItem

        Complete item to create.

      • type: "create"

        Creates one item on the active layer.

    • {
          expectedVersion: number;
          itemId: string;
          patch: Partial<Omit<PlannerItem, "id" | "version">>;
          type: "update";
      }
      • expectedVersion: number

        Version the host expects; a mismatch rejects the command.

      • itemId: string

        ID of the item to update.

      • patch: Partial<Omit<PlannerItem, "id" | "version">>

        Fields to replace; the id and version are not patchable.

      • type: "update"

        Updates fields of one existing item.

    • {
          expectedVersion: number;
          itemId: string;
          proposedPeriod: PlannerPeriod;
          type: "move";
      }
      • expectedVersion: number

        Version the host expects; a mismatch rejects the command.

      • itemId: string

        ID of the item to move.

      • proposedPeriod: PlannerPeriod

        Destination period.

      • type: "move"

        Moves one item to a new period.

    • {
          expectedVersion: number;
          itemId: string;
          proposedPeriod: PlannerPeriod;
          type: "resize";
      }
      • expectedVersion: number

        Version the host expects; a mismatch rejects the command.

      • itemId: string

        ID of the item to resize.

      • proposedPeriod: PlannerPeriod

        Destination period.

      • type: "resize"

        Resizes one item to a new period.

    • { expectedVersion: number; itemId: string; type: "delete" }
      • expectedVersion: number

        Version the host expects; a mismatch rejects the command.

      • itemId: string

        ID of the item to delete.

      • type: "delete"

        Deletes one item.

    • {
          defaults: PaintDefaults;
          expectedVersions: Record<string, number>;
          layerId: string;
          operation: "union" | "subtract";
          period: PlannerPeriod;
          type: "paint";
      }
      • defaults: PaintDefaults

        Defaults for a newly created paint item.

      • expectedVersions: Record<string, number>

        Versions of the items the range touches.

      • layerId: string

        Layer that receives the paint command.

      • operation: "union" | "subtract"

        Adds the range to an item or removes it.

      • period: PlannerPeriod

        Date range to paint or erase.

      • type: "paint"

        Paints or erases a date range on one layer.