import { PptxSlide } from 'pptx-viewer-core'; import { CollabLoadOrigin, CollaborationConfig, YDocLike, YjsFactories } from 'pptx-viewer-shared'; export interface ObserveRemoteDeps { isApplyingRemote: () => boolean; setApplyingRemote: (value: boolean) => void; setLastSynced: (value: string) => void; applyRemoteSlides: (slides: PptxSlide[]) => void; scheduleWriteBack: (config: CollaborationConfig) => void; } /** The subset of {@link ObserveRemoteDeps} needed by {@link adoptDocSlidesAfterLoad}. */ export type AdoptDocSlidesDeps = Pick; /** * Re-adopt the shared doc's slides after a local content load. The load * pipeline applies its parsed deck to viewer state unconditionally, so when a * late joiner's bootstrap deck finishes parsing AFTER the room's slides were * already synced in, the synced state is silently clobbered and, with the doc * itself unchanged, the observer never re-fires. Called by the load pipeline * right after it commits a parsed deck: when the room already has slides they * win; an empty room means this client is the seeder and its loaded deck * stands (written into the doc by the normal gated publish path). */ export declare function adoptDocSlidesAfterLoad(ydoc: YDocLike, deps: AdoptDocSlidesDeps, origin?: CollabLoadOrigin): void; /** Register the remote-slide observer; returns the unobserve function. */ export declare function observeRemoteSlides(ydoc: YDocLike, config: CollaborationConfig, deps: ObserveRemoteDeps): () => void; /** Everything `publishLocalSlides` needs from the controller's private state. */ export interface PublishLocalSlidesInput { slides: PptxSlide[]; ydoc: YDocLike | null; factories: YjsFactories | null; /** True while a remote apply is in flight; publishing then would echo it. */ applyingRemote: boolean; role: CollaborationConfig['role']; /** JSON of the last published slides, for the echo dedupe. */ lastSynced: string; } /** * Granular local -> doc publish, the write-side sibling of * {@link observeRemoteSlides}. Returns the new `lastSynced` value when it * wrote, or null when the write was skipped (no doc, read-only viewer, a * remote apply in flight, or the slides are unchanged). */ export declare function publishLocalSlides(input: PublishLocalSlidesInput): string | null; //# sourceMappingURL=collaboration-remote-sync.d.ts.map