/** * useBranchPresence Hook * * Provides branch-level presence aggregation with polling. */ import type { BranchPresence, DocumentPresenceSummary } from '@pantheon-systems/css-client'; /** * Options for the useBranchPresence hook. */ export interface UseBranchPresenceOptions { /** Polling interval in ms (default: 10000) */ pollingInterval?: number; } /** * Return value for the useBranchPresence hook. */ export interface UseBranchPresenceReturn { /** Branch presence summary */ presence: BranchPresence | null; /** Documents with active collaborators */ activeDocuments: DocumentPresenceSummary[]; /** Total collaborators across branch */ totalActors: number; /** Loading state */ isLoading: boolean; /** Error state */ error: Error | null; /** Refresh presence data */ refresh: () => Promise; } /** * Hook for consuming branch-level presence data. * * @param options - Configuration options * @returns Branch presence state and operations * * @example * ```tsx * function BranchCollaborators() { * const { presence, activeDocuments, totalActors } = useBranchPresence(); * * return ( *
* {totalActors} collaborators on this branch * {activeDocuments.map(doc => ( * * ))} *
* ); * } * ``` */ export declare function useBranchPresence(options?: UseBranchPresenceOptions): UseBranchPresenceReturn;