import type { Ref } from 'vue'; import type { Awareness } from 'y-protocols/awareness'; /** The `user` awareness field. The Yjs server stamps it on every peer state. */ export interface YjsAwarenessUser { id: string; name: string; /** Hex color, shared by the remote cursor and the avatar in the toolbar. */ color: string; } export interface YjsCollaborator extends YjsAwarenessUser { isSelf: boolean; } /** * Prefix of the stateless message the Yjs server sends a connection with its * own identity. Mirrors `IDENTITY_MESSAGE_PREFIX` in * `services/yjs/src/lib/identity.ts`, keep the two in sync. */ export declare const IDENTITY_MESSAGE_PREFIX = "_oc_identity:"; /** Parses a server identity message. Null for any other stateless payload. */ export declare function decodeIdentityMessage(payload: string): YjsAwarenessUser | null; /** * The people in the room, derived from the awareness states. The own user * comes first, peers follow sorted by name. Bound to the awareness passed at * setup time, like the cursor extension, and detached when the scope ends. */ export declare function useYjsCollaborators(awareness?: Awareness | null): Ref;