import { WORK_OFFICE_COLLABORATION_PROTOCOL, WORK_OFFICE_COLLABORATION_VERSION, type WorkOfficeCollaborationActorKind, type WorkOfficeCollaborationMode, type WorkOfficeCollaborationSession } from './office-collaboration'; export declare const WORK_OFFICE_COLLABORATION_PRESENCE_FIELD: "a3sOffice"; export type WorkOfficeCollaborationPresenceActivity = 'active' | 'idle' | 'away'; export interface WorkOfficeDocumentPresenceLocation { readonly kind: 'document'; /** Zero-based ProseMirror model position. */ readonly anchor: number; readonly head: number; } export interface WorkOfficeMarkdownPresenceLocation { readonly kind: 'markdown'; /** Positions are UTF-16 offsets in source mode and ProseMirror positions in visual mode. */ readonly anchor: number; readonly head: number; /** Missing values from older protocol peers are interpreted as `source`. */ readonly surface?: 'source' | 'visual'; } export type WorkOfficeTextPresenceLocation = WorkOfficeDocumentPresenceLocation | WorkOfficeMarkdownPresenceLocation; export interface WorkOfficeSpreadsheetPresenceCell { readonly row: number; readonly column: number; } export interface WorkOfficeSpreadsheetPresenceRange { readonly startRow: number; readonly startColumn: number; readonly endRow: number; readonly endColumn: number; } export interface WorkOfficeSpreadsheetPresenceLocation { readonly kind: 'spreadsheet'; readonly sheetId: string; readonly ranges: readonly WorkOfficeSpreadsheetPresenceRange[]; readonly activeCell?: WorkOfficeSpreadsheetPresenceCell; } export interface WorkOfficePresentationPresenceLocation { readonly kind: 'presentation'; readonly slideId: string; readonly elementIds: readonly string[]; } export interface WorkOfficePdfPresenceLocation { readonly kind: 'pdf'; /** Zero-based page index. */ readonly pageIndex: number; readonly annotationId?: string; } export type WorkOfficeCollaborationPresenceLocation = WorkOfficeTextPresenceLocation | WorkOfficeSpreadsheetPresenceLocation | WorkOfficePresentationPresenceLocation | WorkOfficePdfPresenceLocation; export interface WorkOfficeCollaborationPresenceActor { readonly id: string; readonly name: string; readonly color?: string; readonly avatarUrl?: string; readonly kind: WorkOfficeCollaborationActorKind; } export interface WorkOfficeCollaborationPresenceState { readonly protocol: typeof WORK_OFFICE_COLLABORATION_PROTOCOL; readonly version: typeof WORK_OFFICE_COLLABORATION_VERSION; readonly artifactId: string; readonly artifactKind: WorkOfficeCollaborationSession['kind']; readonly namespace: string; readonly presenceId: string; readonly actor: WorkOfficeCollaborationPresenceActor; readonly mode: WorkOfficeCollaborationMode; readonly activity: WorkOfficeCollaborationPresenceActivity; readonly location?: WorkOfficeCollaborationPresenceLocation; } export interface WorkOfficeCollaborationParticipant extends WorkOfficeCollaborationPresenceState { readonly clientId: number; readonly local: boolean; } export interface WorkOfficeCollaborationPresenceSnapshot { readonly localClientId: number; readonly participants: readonly WorkOfficeCollaborationParticipant[]; } export interface WorkOfficeCollaborationPresenceUpdate { readonly activity?: WorkOfficeCollaborationPresenceActivity; /** `null` clears the local location; omission keeps the current location. */ readonly location?: WorkOfficeCollaborationPresenceLocation | null; } export interface WorkOfficeCollaborationPresence { local(): WorkOfficeCollaborationPresenceState; snapshot(): WorkOfficeCollaborationPresenceSnapshot; update(update: WorkOfficeCollaborationPresenceUpdate): WorkOfficeCollaborationPresenceState; subscribe(listener: (snapshot: WorkOfficeCollaborationPresenceSnapshot) => void): () => void; destroy(): void; } export declare function createWorkOfficeCollaborationPresence(session: WorkOfficeCollaborationSession, initial?: WorkOfficeCollaborationPresenceUpdate): WorkOfficeCollaborationPresence;