Skip to main content

IPresence Interface

Presence represents known clients within a session and their custom states and notifications.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

/** @sealed */
export interface IPresence

Properties

Property Alerts Modifiers Type Description
events Alpha readonly ISubscribable<PresenceEvents> Events for Notifications manager.

Methods

Method Alerts Return Type Description
getAttendee(clientId) Alpha ISessionClient Lookup a specific attendee in the session.
getAttendees() Alpha ReadonlySet<ISessionClient> Get all attendees in the session.
getMyself() Alpha ISessionClient Get this client's session client.
getNotifications(notificationsId, requestedContent) Alpha PresenceNotifications<NotificationsSchema> Acquires a Notifications workspace from store or adds new one.
getStates(workspaceAddress, requestedContent) Alpha PresenceStates<StatesSchema> Acquires a PresenceStates workspace from store or adds new one.

Property Details

events

Events for Notifications manager.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

readonly events: ISubscribable<PresenceEvents>;

Type: ISubscribable<PresenceEvents>

Method Details

getAttendee

Lookup a specific attendee in the session.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

getAttendee(clientId: ClientConnectionId | ClientSessionId): ISessionClient;

Parameters

Parameter Type Description
clientId ClientConnectionId | ClientSessionId Client connection or session ID

Returns

Return type: ISessionClient

getAttendees

Get all attendees in the session.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

getAttendees(): ReadonlySet<ISessionClient>;

Remarks

Attendee states are dynamic and will change as clients join and leave the session.

Returns

Return type: ReadonlySet<ISessionClient>

getMyself

Get this client's session client.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

getMyself(): ISessionClient;

Returns

This client's session client.

Return type: ISessionClient

getNotifications

Acquires a Notifications workspace from store or adds new one.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

getNotifications<NotificationsSchema extends PresenceNotificationsSchema>(notificationsId: PresenceWorkspaceAddress, requestedContent: NotificationsSchema): PresenceNotifications<NotificationsSchema>;
Type Parameters
Parameter Constraint Description
NotificationsSchema PresenceNotificationsSchema

Parameters

Parameter Type Description
notificationsId PresenceWorkspaceAddress
requestedContent NotificationsSchema Requested notifications for the workspace

Returns

A Notifications workspace

Return type: PresenceNotifications<NotificationsSchema>

getStates

Acquires a PresenceStates workspace from store or adds new one.

This API is provided as an alpha preview and may change without notice.

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

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

Signature

getStates<StatesSchema extends PresenceStatesSchema>(workspaceAddress: PresenceWorkspaceAddress, requestedContent: StatesSchema): PresenceStates<StatesSchema>;
Type Parameters
Parameter Constraint Description
StatesSchema PresenceStatesSchema

Parameters

Parameter Type Description
workspaceAddress PresenceWorkspaceAddress Address of the requested PresenceStates Workspace
requestedContent StatesSchema Requested states for the workspace

Returns

A PresenceStates workspace

Return type: PresenceStates<StatesSchema>