Skip to content

ReferenceAPI

Recording

Every change as a step: undo, redo and replay.

Recording.md

Every change as a step: undo, redo and replay. The same text agents read through help().

apply(ops: Op[]): Array<string | Locator | undefined>

Applies ops sent as JSON, as one undo step: { target: "sl_7Q2M4K9A.shapes", op: "add", args: [{ … }] }. An argument { $result: n } stands for what op n of this batch returned. Returns each op’s result as an anchor (or locator) when it is an object.

Options: Op.

{ target: "sl_7Q2M4K9A.shapes", op: "add", args: [{ … }] }
{ $result: n }
canRedo: boolean

Steps that were undone and can be redone.

canUndo: boolean

Steps that can be undone (creating the deck is not one of them).

deck: Deck

The recorded deck. Use it like any deck; every change is logged.

group(fn: () => T): T

Runs fn as one undo step, e.g. a whole composed slide.

redo(): boolean

Redoes the step undone last.

toJSON(): OpLogJSON

The log as JSON: store it, send it, or rebuild the deck with Recording.from().

undo(): boolean

Undoes the last step. Objects you hold keep working; ones the step created are gone.