import { AutosaveDisabledReason } from 'pptx-viewer-shared'; import { CollaborationController, CollaborationDialogsState } from '../collab'; import { EditorState } from '../editor/editor-state.svelte'; import { AutosaveRecoveryController } from './autosave-recovery.svelte'; import { AutosaveController } from './autosave.svelte'; import { CreateViewerStateOptions } from './create-viewer-state-types'; import { PresentationLoader } from './presentation-loader.svelte'; import { ViewerState } from './viewer-state.svelte'; export interface CollabClusterDeps { loader: PresentationLoader; viewer: ViewerState; editor: EditorState; options: CreateViewerStateOptions; /** * The live editable flag (not the raw host prop): autosave must disarm the * moment an AI edit or Protected View flips editing, not only when the host * re-renders with a new `editable`. */ getEditable(): boolean; /** * File > Options > Save > "Save AutoRecover information every N minutes", * in seconds. Used whenever the host passed no explicit `autosaveIntervalMs`. * A closure, not a value: the options cluster is built after this one. */ getOptionsIntervalSeconds?: () => number | undefined; } export interface CollabCluster { collab: CollaborationController; dialogs: CollaborationDialogsState; autosaveCtl: AutosaveController; autosaveRecovery: AutosaveRecoveryController; /** * The EFFECTIVE toggle state for the title bar: the user's preference, * forced to false while the host vetoes autosave so the switch renders off * rather than claiming to be on while nothing is written. */ readonly autosaveEnabled: boolean; /** * The user's RAW preference, unaffected by the host veto. The File > Options * store mirrors this one: a host that happens to ship `autosave={false}` * must not overwrite the AutoSave choice the user made for every other host. */ readonly autosavePreference: boolean; /** False only when the host passed `autosave={false}`. */ readonly autosaveToggleAvailable: boolean; readonly autosaveDisabledReason: AutosaveDisabledReason | undefined; setAutosaveEnabled(enabled: boolean): void; /** * Set the flag WITHOUT firing `onautosavetoggle`. The File > Options wiring * needs this: it owns its own (mount-hydration-suppressed) notification, so * routing through {@link setAutosaveEnabled} would double-fire the host * callback on every dialog edit. */ setAutosaveFlag(enabled: boolean): void; readonly autosaveActive: boolean; versionHistoryOpen: boolean; readonly signatureWarningOpen: boolean; closeSignatureWarning(): void; } /** * Collaboration session/dialogs + autosave + the digital-signature warning * gate, split out of `createViewerState` purely to keep that file under the * repo's file-size budget. None of this cluster depends on the editing * chrome (`parityUi` / `controller` / `findReplace`), so it can be built * right after `editor` and handed to that cluster afterwards (`controller` * needs `collab.setCursor`). * * Named `use*` (like this file's `useCollaborationPresenceEffects` call) * rather than `build*`: it registers `$effect`s of its own, not just * constructs objects. */ export declare function useCollabCluster(deps: CollabClusterDeps): CollabCluster; //# sourceMappingURL=create-viewer-state-collab.svelte.d.ts.map