export type LiveUpdateRole = 'editor' | 'viewer';
export type LiveConnectionStatus = 'disconnected' | 'connecting' | 'connected';
interface UseLiveUpdatesOptions {
    /** Entity type name (e.g. "objective") */
    entityName: string;
    /** Entity numeric ID. Omit or pass undefined to disable. */
    entityId: number | undefined;
    /** Whether this client is the editor or a viewer. */
    role: LiveUpdateRole;
    /** Called on the viewer side when the editor sends an update. */
    onUpdate?: (data: Record<string, unknown>) => void;
    /** Set to false to disable the connection entirely. */
    enabled?: boolean;
}
/**
 * Hook for WebSocket-based live entity updates.
 *
 * **Editor usage:** call `broadcastUpdate(formValues)` whenever form values change.
 * The hook debounces broadcasts by 300ms to avoid flooding the wire.
 *
 * **Viewer usage:** provide an `onUpdate` callback to receive live snapshots
 * from the editor.
 *
 * Connection is automatically established when `enabled`, `entityName` and
 * `entityId` are all valid, and torn down on unmount or when inputs change.
 *
 * **Auto-reconnect:** on unexpected disconnects the hook automatically
 * reconnects with exponential backoff (1s → 2s → 4s … 30s cap).
 */
export declare function useLiveUpdates({ entityName, entityId, role, onUpdate, enabled, }: UseLiveUpdatesOptions): {
    status: LiveConnectionStatus;
    broadcastUpdate: (data: Record<string, unknown>) => void;
};
export {};
