Skip to main content

Presence Interface

Provides top-level access to Presence feature set including known Attendees within a session and their custom states kept under StatesWorkspaces.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export interface Presence

Properties

PropertyModifiersTypeDescription
attendeesreadonly{ readonly events: Listenable<AttendeesEvents>; getAttendees(): ReadonlySet<Attendee>; getAttendee(clientId: ClientConnectionId | AttendeeId): Attendee; getMyself(): Attendee; }Container-wide Attendee information and event provider.
eventsreadonlyListenable<PresenceEvents>Events for Presence.
statesreadonly{ getWorkspace<StatesSchema extends Partial<StatesWorkspaceSchema<SchemaKeys>>, SchemaKeys extends string & keyof StatesSchema = string & keyof StatesSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema, unknown, SchemaKeys>; }Provides access to StatesWorkspaces that allow clients to manage custom states.

Property Details

attendees

Container-wide Attendee information and event provider.

Signature

readonly attendees: {
readonly events: Listenable<AttendeesEvents>;
getAttendees(): ReadonlySet<Attendee>;
getAttendee(clientId: ClientConnectionId | AttendeeId): Attendee;
getMyself(): Attendee;
};

Type: { readonly events: Listenable<AttendeesEvents>; getAttendees(): ReadonlySet<Attendee>; getAttendee(clientId: ClientConnectionId | AttendeeId): Attendee; getMyself(): Attendee; }

Remarks

This provides access to all Attendees in the session, including the current client. As StatesWorkspace aren't required to be uniform across an application, some Attendees may be enumerated here while not being present in any particular StatesWorkspace.

events

Events for Presence.

Signature

readonly events: Listenable<PresenceEvents>;

Type: Listenable<PresenceEvents>

states

Provides access to StatesWorkspaces that allow clients to manage custom states.

Signature

readonly states: {
getWorkspace<StatesSchema extends Partial<StatesWorkspaceSchema<SchemaKeys>>, SchemaKeys extends string & keyof StatesSchema = string & keyof StatesSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema, unknown, SchemaKeys>;
};

Type: { getWorkspace<StatesSchema extends Partial<StatesWorkspaceSchema<SchemaKeys>>, SchemaKeys extends string & keyof StatesSchema = string & keyof StatesSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema, unknown, SchemaKeys>; }