import type { CollaborationRole } from './identity.js'; /** * Grace period (ms) before the first local write when the provider has not signalled initial sync. * WebSocket providers emit `synced` reliably; WebRTC only syncs once a peer is present, so a lone * fresh-room peer seeds the document after this delay. Gating the first write prevents a late * joiner's bootstrap document from merging into a room whose real content has not arrived. */ export declare const INITIAL_SYNC_GRACE_MS = 3000; export interface SyncGate { isOpen: () => boolean; /** (Re)start the grace timer that opens the gate without a sync event. */ arm: () => void; /** Open now (the provider confirmed its initial sync). Idempotent. */ open: () => void; /** Close and cancel the grace timer (teardown). */ reset: () => void; } /** First-write gate. `onOpen` fires once per session (until `reset`). */ export declare function createSyncGate(onOpen: () => void, graceMs?: number): SyncGate; /** * Why a content load ran: `bootstrap` (the document the host mounted the viewer with, or a session * restore; nobody chose it during the session) or `user` (File > Open, a drop, a host API call). */ export type LoadOrigin = 'bootstrap' | 'user'; /** * Whether the room's content should replace the document that just loaded. Only a bootstrap load * into a non-empty room loses: opening a file is an act of authorship and is published instead. * An unknown origin defaults to `user`, which keeps the document rather than dropping it. */ export declare function shouldRoomReplaceLoad(origin: LoadOrigin | undefined, roomIsNonEmpty: boolean): boolean; /** * Broadcast sessions have one presenter (`owner`). Auto-follow is one-way: only a local `viewer` is * pulled along to the owner's location; collaborators and the owner navigate freely. */ export declare function shouldAutoFollowBroadcaster(input: { localRole: CollaborationRole | undefined; broadcasterRole: CollaborationRole | undefined; }): boolean; //# sourceMappingURL=policy.d.ts.map