import { Doc } from "yjs"; //#region src/codec/pptx-codec.d.ts declare const ORIGIN_FILE_LOAD = "file-load"; /** * Bidirectional format codec: file bytes <-> Y.Doc shared types. * * Y.Doc schema: * pptx:meta Y.Map - width, height, widthEmu, heightEmu, sourceBytes * pptx:slides Y.Array - one map per slide * Each slide Y.Map: scalar fields + `_`-prefixed JSON blobs + `elements` Y.Array * Each element Y.Map: scalar fields + `_`-prefixed JSON blobs + `textBody` Y.Text * textBody Y.Text: one delta op per TextSegment (see text-body-codec.ts) * * NOTE: the viewer bindings' sync schema (pptx-viewer-shared * collaboration-sync.ts) uses SHORT complex-field key prefixes (`_ts`, `_tr`) * while this codec uses long ones (`_textStyle`, `_transition`). The two doc * layouts are similar but NOT interchangeable on the same Y.Doc. */ interface FormatCodec { readonly formatId: string; readonly extensions: string[]; hydrate: (ydoc: Doc, bytes: Uint8Array, origin?: string) => Promise; dehydrate: (ydoc: Doc, dirtyPaths?: string[]) => Promise; observe: (ydoc: Doc, onChange: () => void) => () => void; } /** * Field coverage is derived from `pptx-viewer-core`'s * `ELEMENT_FIELD_KIND`/`SLIDE_FIELD_KIND` (the same canonical inventory the * viewer's `collaboration-sync.ts` allowlists derive from), so this codec * automatically tracks every field `PptxElement`/`PptxSlide` declares * instead of drifting out of sync with a hand-maintained list. Wire-format * prefixes stay long-form (`_textStyle`) here versus the viewer schema's * short-form (`_ts`) - the two Y.Doc layouts are intentionally NOT * interchangeable, only the field *coverage* is required to match. * * `asset`-kind fields (large binary payloads like `mediaData`) are simply * embedded as scalars here rather than routed through a separate asset map: * this codec does one-shot bidirectional file<->Y.Doc conversion, not a * live P2P transport, so there's no repeated-write cost to avoid. */ declare const SCALAR_ELEMENT_KEYS: Set; declare const COMPLEX_FIELD_MAP: Record; declare const SCALAR_SLIDE_KEYS: Set; declare const COMPLEX_SLIDE_FIELD_MAP: Record; declare class PptxCodec implements FormatCodec { readonly formatId = "pptx"; readonly extensions: string[]; hydrate(ydoc: Doc, bytes: Uint8Array, origin?: string): Promise; dehydrate(ydoc: Doc, _dirtyPaths?: string[]): Promise; observe(ydoc: Doc, onChange: () => void): () => void; private _slideToYMap; private _yMapToSlide; private _elementToYMap; private _yMapToElement; } //#endregion export { COMPLEX_FIELD_MAP, COMPLEX_SLIDE_FIELD_MAP, type FormatCodec, ORIGIN_FILE_LOAD, PptxCodec, SCALAR_ELEMENT_KEYS, SCALAR_SLIDE_KEYS }; //# sourceMappingURL=index.d.ts.map