Interface: AwarenessEngine
@roomful/core / AwarenessEngine
Interface: AwarenessEngine
Section titled “Interface: AwarenessEngine”Defined in: packages/core/src/types.ts:1139
Exposes awareness operations for a room.
Methods
Section titled “Methods”getAll()
Section titled “getAll()”getAll():
AwarenessState[]
Defined in: packages/core/src/types.ts:1185
Returns all remote awareness snapshots.
Returns
Section titled “Returns”The current awareness snapshots.
set(
value):void
Defined in: packages/core/src/types.ts:1146
Merges arbitrary awareness metadata into the local peer.
Parameters
Section titled “Parameters”Record<string, unknown>
The awareness fields to merge.
Returns
Section titled “Returns”void
Nothing.
setFocus()
Section titled “setFocus()”setFocus(
elementId):void
Defined in: packages/core/src/types.ts:1162
Updates the local focus target.
Parameters
Section titled “Parameters”elementId
Section titled “elementId”The focused element identifier, or null to clear it.
string | null
Returns
Section titled “Returns”void
Nothing.
setSelection()
Section titled “setSelection()”setSelection(
selection):void
Defined in: packages/core/src/types.ts:1170
Updates the local text selection.
Parameters
Section titled “Parameters”selection
Section titled “selection”The active selection, or null to clear it.
AwarenessSelection | null
Returns
Section titled “Returns”void
Nothing.
setTyping()
Section titled “setTyping()”setTyping(
isTyping):void
Defined in: packages/core/src/types.ts:1154
Updates the local typing state.
Parameters
Section titled “Parameters”isTyping
Section titled “isTyping”boolean
Whether the local peer is currently typing.
Returns
Section titled “Returns”void
Nothing.
subscribe()
Section titled “subscribe()”subscribe(
cb):Unsubscribe
Defined in: packages/core/src/types.ts:1178
Subscribes to remote awareness updates.
Parameters
Section titled “Parameters”(peers) => void
The callback invoked with remote awareness snapshots.
Returns
Section titled “Returns”A function that removes the listener.