Optional ReadonlydeviceOptional ReadonlyuserStaticprefixedReturn an array listing the events for which the emitter has registered listeners.
Return a view of current local state.
Return a view of current peer states.
Return the number of listeners listening to a given event.
Remove all listeners, or those of the specified event.
Optionalevent: keyof PresenceEventsStart listening to ephemeral messages on the handle, broadcast initial state to peers, and start sending heartbeats.
Stop this Presence: broadcast a "goodbye" message (when received, other peers will immediately forget the sender), stop sending heartbeats, and stop listening to ephemeral-messages broadcast from peers.
This can be used with browser events like "pagehide" or "visibilitychange" to stop sending and receiving updates when not active.
Presence encapsulates ephemeral state communication for a specific doc handle. It tracks caller-provided local state and broadcasts that state to all peers. It sends periodic heartbeats when there are no state updates.
It also tracks ephemeral state broadcast by peers and emits events when peers send ephemeral state updates (see PresenceEvents).
Presence starts out in an inactive state. Call start and stop to activate and deactivate it.