json-joy
Version:
Collection of libraries for building collaborative editing apps.
30 lines (29 loc) • 1.3 kB
TypeScript
import { WebUndo } from './WebUndo';
import { type Printable } from 'tree-dump';
import type { Patch } from '../../../../json-crdt-patch';
import type { Peritext } from '../../../../json-crdt-extensions';
import type { UiLifeCycles } from '../../types';
import type { RedoCallback, UndoCallback, UndoCollector } from '../../../types';
import type { Log } from '../../../../json-crdt/log/Log';
import type { PeritextEventTarget } from '../../../events/PeritextEventTarget';
export interface UndoRedoControllerOpts {
log: Log;
txt: Peritext;
et: PeritextEventTarget;
}
export declare class AnnalsController implements UndoCollector, UiLifeCycles, Printable {
readonly opts: UndoRedoControllerOpts;
protected manager: WebUndo;
constructor(opts: UndoRedoControllerOpts);
protected captured: WeakSet<Patch>;
/** ------------------------------------------------- {@link UndoCollector} */
capture(): void;
undo(): void;
redo(): void;
/** -------------------------------------------------- {@link UiLifeCycles} */
start(): () => void;
readonly _undo: UndoCallback<Patch, Patch>;
readonly _redo: RedoCallback<Patch, Patch>;
/** ----------------------------------------------------- {@link Printable} */
toString(tab?: string): string;
}