import { PptxAppProperties, PptxCoreProperties, PptxCustomProperty, PptxCustomShow, PptxHandoutMaster, PptxHeaderFooter, PptxNotesMaster, PptxPresentationProperties, PptxSaveFormat, PptxSection, PptxSlide, PptxSlideMaster, PptxTagCollection } from 'pptx-viewer-core'; import { EditorSnapshot } from './editor-document-state'; import { EditorState } from './editor-state.svelte'; /** * Deck-level lifecycle for {@link EditorState}: adopting a freshly loaded * document, resetting, taking a remote (collaboration) snapshot, restoring an * undo snapshot, editing document metadata, and serialising back to bytes. * * These are free functions over the state rather than methods because * `EditorState` is already a facade over thirteen focused controllers, and * document lifecycle is simply the fourteenth concern; keeping it here is what * holds that file within the repo's file-size budget. */ /** * Everything a load hands the editor, in the order `PptxHandler` produces it. * Declared once here as a labelled tuple so `EditorState.setSlides` can forward * it verbatim without restating eleven parameters (and their defaults). */ export type LoadDocumentArgs = [ slides: PptxSlide[], slideMasters?: PptxSlideMaster[], notesMaster?: PptxNotesMaster, handoutMaster?: PptxHandoutMaster, sections?: PptxSection[], coreProperties?: PptxCoreProperties, appProperties?: PptxAppProperties, customProperties?: PptxCustomProperty[], headerFooter?: PptxHeaderFooter, presentationProperties?: PptxPresentationProperties, customShows?: PptxCustomShow[] ]; /** * Install a loaded deck as the editor's working document. Everything is * deep-cloned so later edits never write through to the loader's parse result, * and the editing session (selection, history, dirty flag, ink tool) is reset. */ export declare function loadEditorDocument(state: EditorState, ...args: LoadDocumentArgs): void; /** Clear the editing session (selection, history, dirty flag) without touching content. */ export declare function resetEditorSession(state: EditorState): void; /** * Replace the working slides with a remote (collaboration) snapshot without * recording an undo step or touching the dirty flag: the granular reconcile * already merged the peer's change, and treating an incoming remote edit as * a local mutation would both pollute the undo stack and re-broadcast it. * * Selection is preserved when the selected element still exists so a remote * edit does not yank the local user's selection out from under them. Local * undo history is intentionally kept (see the collaboration module JSDoc): * shared defines no collaborative-undo semantics, so, matching React/Vue, * local undo may fight a concurrent remote edit. */ export declare function applyRemoteEditorSlides(state: EditorState, slides: PptxSlide[]): void; /** * Restore an undo/redo snapshot. The snapshot is re-cloned on the way in so the * stacked entry stays pristine and can be restored again (redo, then undo). */ export declare function restoreEditorSnapshot(state: EditorState, snapshot: EditorSnapshot | undefined): void; /** Replace the document properties (File > Info) as one undoable edit. */ export declare function updateEditorDocumentProperties(state: EditorState, core: PptxCoreProperties, app: PptxAppProperties, custom: PptxCustomProperty[]): void; /** Replace the tag collections as one undoable edit (inspector Tags section). */ export declare function updateEditorTagCollections(state: EditorState, next: readonly PptxTagCollection[]): void; /** * Serialise the edited document to `.pptx` bytes. Saves `renderedSlides` (the * slides with their inherited template elements folded back in), not the * partitioned working array, so master/layout edits persist. */ export declare function saveEditorState(state: EditorState, format?: PptxSaveFormat): Promise; //# sourceMappingURL=editor-document-lifecycle.d.ts.map