Interface: FieldPresenceEngine
@roomful/angular / FieldPresenceEngine
Interface: FieldPresenceEngine
Section titled “Interface: FieldPresenceEngine”Defined in: core/dist/types.d.ts:1251
A field-oriented view of the awareness channel: which remote peers are active on which field
right now. setActiveField declares the local peer’s field (e.g. on focus); the reads answer
“who else is here”. Rides the awareness transport, so no relay change is needed. Purpose-built for
collaborative forms, tables, and admin records. See docs/reference/engines-field-presence.md.
Methods
Section titled “Methods”getActiveFields()
Section titled “getActiveFields()”getActiveFields():
FieldPresenceState[]
Defined in: core/dist/types.d.ts:1271
Returns every field with at least one remote peer, ordered by field id.
Returns
Section titled “Returns”The active fields.
getFieldPeers()
Section titled “getFieldPeers()”getFieldPeers(
fieldId):Peer<PresenceData>[]
Defined in: core/dist/types.d.ts:1265
Returns the remote peers currently active on a field.
Parameters
Section titled “Parameters”fieldId
Section titled “fieldId”string
The field to query.
Returns
Section titled “Returns”Peer<PresenceData>[]
The remote peers on the field (empty when none).
setActiveField()
Section titled “setActiveField()”setActiveField(
fieldId):void
Defined in: core/dist/types.d.ts:1258
Declares the field the local peer is active on, or null to clear it (e.g. on blur).
Parameters
Section titled “Parameters”fieldId
Section titled “fieldId”The active field id, or null.
string | null
Returns
Section titled “Returns”void
Nothing.
subscribe()
Section titled “subscribe()”subscribe(
callback):Unsubscribe
Defined in: core/dist/types.d.ts:1278
Subscribes to field-presence changes. Fires immediately with the current fields.
Parameters
Section titled “Parameters”callback
Section titled “callback”(fields) => void
Invoked with the active fields on every change.
Returns
Section titled “Returns”Unsubscribe
A function that removes the listener.