Interface: PresenceEngine\<TPresence\>
@roomful/core / PresenceEngine
Interface: PresenceEngine<TPresence>
Section titled “Interface: PresenceEngine<TPresence>”Defined in: packages/core/src/types.ts:983
Exposes presence operations for a room.
Type Parameters
Section titled “Type Parameters”TPresence
Section titled “TPresence”TPresence extends PresenceData = PresenceData
The custom peer presence shape.
Methods
Section titled “Methods”get(
peerId):Peer<TPresence> |null
Defined in: packages/core/src/types.ts:1014
Looks up a peer by identifier.
Parameters
Section titled “Parameters”peerId
Section titled “peerId”string
The peer identifier to resolve.
Returns
Section titled “Returns”Peer<TPresence> | null
The matching peer when present, otherwise null.
getAll()
Section titled “getAll()”getAll():
Peer<TPresence>[]
Defined in: packages/core/src/types.ts:1021
Returns every known peer, including the local peer.
Returns
Section titled “Returns”Peer<TPresence>[]
A snapshot of all known peers.
getSelf()
Section titled “getSelf()”getSelf():
Peer<TPresence>
Defined in: packages/core/src/types.ts:1028
Returns the local peer snapshot.
Returns
Section titled “Returns”Peer<TPresence>
The local peer.
replace()
Section titled “replace()”replace(
this,data):void
Defined in: packages/core/src/types.ts:998
Replaces the local presence payload.
Parameters
Section titled “Parameters”void
Partial<TPresence>
The partial presence payload to publish for the local peer.
Returns
Section titled “Returns”void
Nothing.
subscribe()
Section titled “subscribe()”subscribe(
cb):Unsubscribe
Defined in: packages/core/src/types.ts:1006
Subscribes to peer presence changes.
Parameters
Section titled “Parameters”(peers) => void
The callback invoked with the full peer list.
Returns
Section titled “Returns”A function that removes the listener.
update()
Section titled “update()”update(
this,data):void
Defined in: packages/core/src/types.ts:990
Partially updates the local presence payload.
Parameters
Section titled “Parameters”void
Partial<TPresence>
The partial presence payload to merge into the local peer.
Returns
Section titled “Returns”void
Nothing.