Skip to content

API reference / Common / PresentationCommand

Type Alias: PresentationCommand ​

ts
type PresentationCommand = 
  | {
  insertSlide: {
     index: number;
     layout?: SlideLayoutId;
  };
}
  | {
  deleteSlide: {
     index: number;
  };
}
  | {
  reorderSlide: {
     from: number;
     to: number;
  };
}
  | {
  editShape: {
     slide: SlideId;
     command: ShapeCommand;
  };
};

An edit intent for a presentation document. The editor turns a command into a CRDT modification; it never touches the model directly.

Two kinds, mirroring portable's split between page-structure and object commands. Slide structure (InsertSlide / DeleteSlide / ReorderSlide) addresses by index — they are about position — the analogues of portable's InsertPage / DeletePage / ReorderPage (InsertSlide layout-aware, where a page has no template). Slide content (EditShape) is a shape-sub-domain [ShapeCommand] scoped to the slide that owns it, the twin of portable's object commands. Serialize/Deserialize make it a stable wire form (externally tagged by variant name) for host edits.