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.

This API is provided as a beta preview and may change without notice.

To use, import via @fluidframework/presence/beta.

For more information about our API support guarantees, see here.

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

Property Alerts Modifiers Type Description
attendees Beta readonly { readonly events: Listenable<AttendeesEvents>; getAttendees(): ReadonlySet<Attendee>; getAttendee(clientId: ClientConnectionId | AttendeeId): Attendee; getMyself(): Attendee; } Container-wide Attendee information and event provider.
events Beta readonly Listenable<PresenceEvents> Events for Presence.
states Beta readonly { getWorkspace<StatesSchema extends StatesWorkspaceSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema>; } Provides access to StatesWorkspaces that allow clients to manage custom states.

Property Details

attendees

Container-wide Attendee information and event provider.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

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
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.

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

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
readonly events: Listenable<PresenceEvents>;

Type: Listenable<PresenceEvents>

states

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

This API is provided as a beta preview and may change without notice.

For more information about our API support guarantees, see here.

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
readonly states: {
getWorkspace<StatesSchema extends StatesWorkspaceSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema>;
};

Type: { getWorkspace<StatesSchema extends StatesWorkspaceSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema>; }