Skip to content

Interface: Room\<TPresence\>

@roomful/core


@roomful/core / Room

Defined in: packages/core/src/types.ts:2558

Exposes the public room API.

TPresence extends PresenceData = PresenceData

The custom peer presence shape.

readonly id: string

Defined in: packages/core/src/types.ts:2562

Identifies the room.


readonly peerCount: number

Defined in: packages/core/src/types.ts:2582

Reports the current peer count.


readonly peerId: string

Defined in: packages/core/src/types.ts:2567

Identifies the local peer.


readonly peers: Peer<TPresence>[]

Defined in: packages/core/src/types.ts:2577

Exposes the latest known peer list.


readonly status: RoomStatus

Defined in: packages/core/src/types.ts:2572

Reports the current room status.

applyReplaySignal(signal): void

Defined in: packages/core/src/types.ts:2744

Applies a previously recorded wire signal to this room’s engines, as if it had just arrived — reconstructing presence, cursors, and shared state from a RecordingFrame’s signal. Feed a recording’s frames in order (e.g. from a ReplaySession) into a throwaway offline room to replay a session visually. Not for live use.

PeerWireMessage

The recorded wire signal to apply.

void

Nothing.


connect(): Promise<void>

Defined in: packages/core/src/types.ts:2589

Connects the room to its transport.

Promise<void>

A promise that resolves when connection startup completes.


disconnect(): Promise<void>

Defined in: packages/core/src/types.ts:2596

Disconnects the room from its transport.

Promise<void>

A promise that resolves when disconnect teardown completes.


getDiagnostics(): Promise<RoomDiagnostics>

Defined in: packages/core/src/types.ts:2603

Produces a diagnostics snapshot for the room.

Promise<RoomDiagnostics>

A promise that resolves to the current diagnostics snapshot.


getRemainingTime(): number | null

Defined in: packages/core/src/types.ts:2617

Returns the remaining TTL in ms for an ephemeral room, or null when not applicable.

number | null

Milliseconds until auto-disconnect, or null.


getUsageMetrics(): UsageMetrics

Defined in: packages/core/src/types.ts:2610

Returns cumulative usage metrics for the room session, for telemetry/analytics.

UsageMetrics

The current usage metrics.


getYDoc(): Doc

Defined in: packages/core/src/types.ts:2759

Exposes the underlying Yjs document for CRDT integrations.

Doc

The shared Yjs document.


getYProvider(): RoomfulYjsProvider

Defined in: packages/core/src/types.ts:2766

Exposes the underlying Yjs provider for CRDT integrations.

RoomfulYjsProvider

The Yjs provider.


off<TEvent>(event, cb): void

Defined in: packages/core/src/types.ts:2789

Removes a built-in room lifecycle listener.

TEvent extends RoomEventName

The built-in event name being removed.

TEvent

The event name to unsubscribe from.

RoomEventHandler<TPresence, TEvent>

The callback to remove.

void

Nothing.


on<TEvent>(event, cb): Unsubscribe

Defined in: packages/core/src/types.ts:2776

Subscribes to a built-in room lifecycle event.

TEvent extends RoomEventName

The built-in event name to subscribe to.

TEvent

The event name to observe.

RoomEventHandler<TPresence, TEvent>

The callback invoked with the matching payload.

Unsubscribe

A function that removes the listener.


useActivity(options?): ActivityEngine

Defined in: packages/core/src/types.ts:2690

Accesses the room activity feed engine.

ActivityOptions

Optional feed configuration (retention limit).

ActivityEngine

The activity engine.


useAgentApprovals(options?): AgentApprovalEngine

Defined in: packages/core/src/types.ts:2699

Accesses the agent-approval engine: the human-in-the-loop workflow where agents propose actions and humans approve or reject them.

AgentApprovalOptions

Optional configuration (permission hook).

AgentApprovalEngine

The agent-approval engine.


useAuditLog(): AuditLog

Defined in: packages/core/src/types.ts:2714

Accesses the tamper-evident audit log for this room. Entries are hash-chained; call verify() to detect tampering.

AuditLog

The audit log.


useAwareness(): AwarenessEngine

Defined in: packages/core/src/types.ts:2651

Accesses the awareness engine for this room.

AwarenessEngine

The awareness engine.


useComments(options?): CommentsEngine

Defined in: packages/core/src/types.ts:2682

Accesses the collaborative comments engine for this room.

CommentsOptions

Optional storage backend configuration.

CommentsEngine

The comments engine.


useCursors<TCursor>(options?): CursorEngine<TCursor>

Defined in: packages/core/src/types.ts:2633

Accesses the cursor engine for this room.

TCursor extends CursorData = CursorData

The custom cursor payload shape.

CursorOptions

Optional cursor tracking configuration.

CursorEngine<TCursor>

The cursor engine.


useEvents(options?): EventEngine<TPresence>

Defined in: packages/core/src/types.ts:2752

Accesses the custom event engine for this room.

EventOptions

Optional custom event behavior overrides.

EventEngine<TPresence>

The event engine.


useFieldPresence(): FieldPresenceEngine

Defined in: packages/core/src/types.ts:2706

Accesses the field-presence engine: which remote peers are active on which field.

FieldPresenceEngine

The field-presence engine.


useHistory(options?): HistoryEngine

Defined in: packages/core/src/types.ts:2723

Accesses the collaborative history (undo/redo plus shared timeline) engine for this room.

HistoryOptions

Optional history configuration.

HistoryEngine

The history engine.


useLocks(): LockEngine

Defined in: packages/core/src/types.ts:2674

Accesses the distributed advisory lock engine for this room.

LockEngine

The lock engine.


usePointer(options?): PointerEngine

Defined in: packages/core/src/types.ts:2667

Accesses the laser-pointer engine for this room.

PointerOptions

Optional pointer tracking configuration.

PointerEngine

The pointer engine.


usePresence(): PresenceEngine<TPresence>

Defined in: packages/core/src/types.ts:2624

Accesses the presence engine for this room.

PresenceEngine<TPresence>

The presence engine.


useRecording(options?): RecordingEngine

Defined in: packages/core/src/types.ts:2732

Accesses the session-recording engine for this room: capture the room’s wire signals, then export or replay them. Local to this peer.

RecordingOptions

Optional configuration, including a redact privacy hook.

RecordingEngine

The recording engine.


useState<T>(options): StateEngine<T>

Defined in: packages/core/src/types.ts:2644

Accesses the shared-state engine for this room.

T

The shared state value type.

StateOptions<T>

The shared-state configuration.

StateEngine<T>

The state engine.


useViewport(options?): ViewportEngine

Defined in: packages/core/src/types.ts:2659

Accesses the viewport synchronization engine for this room.

ViewportOptions

Optional viewport tracking configuration.

ViewportEngine

The viewport engine.