Skip to content

API reference / Common / Engine types / PresentationSelection

Type Alias: PresentationSelection ​

ts
type PresentationSelection = 
  | "none"
  | {
  shapes: {
     slide: SlideId;
     selection: ShapeSelection;
  };
}
  | {
  documentText: {
     anchor: PresentationTextEndpoint;
     focus: PresentationTextEndpoint;
  };
};

The selection of a presentation document's editor — presence state beside the CRDT, never in it (see [Selection]).

Confined to one slide: a selection is a slide id paired with the shape sub-domain's own [ShapeSelection] over that slide's tree. Editing is slide-at-a-time, so a shape edit always knows its slide from the selection — no per-shape slide lookup, and a gesture commits as one slide-scoped command. Picking on a different slide starts a fresh selection there (see combined_with).

Entities are named by id, not index: ids are minted once and shared by every replica, so a selection survives a concurrent reorder untouched, and a concurrently deleted shape simply stops resolving (consumers skip it) instead of silently pointing at a neighbor. Mirrors PortableSelection.