NotificationEmitter Interface
Interface for a notification emitter that can send typed notification to other clients.
To use, import via @fluidframework/presence/alpha
.
For more information about our API support guarantees, see here.
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 NotificationEmitter<E extends InternalUtilityTypes.NotificationListeners<E>>
Type Parameters
Parameter | Constraint | Description |
---|---|---|
E | InternalUtilityTypes.NotificationListeners<E> |
Methods
Method | Alerts | Return Type | Description |
---|---|---|---|
broadcast(notificationName, args) | Alpha |
void | Emits a notification with the specified name and arguments, notifying all clients. |
unicast(notificationName, targetAttendee, args) | Alpha |
void | Emits a notification with the specified name and arguments, notifying a single attendee. |
Method Details
broadcast
Emits a notification with the specified name and arguments, notifying all clients.
For more information about our API support guarantees, see here.
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
broadcast<K extends string & keyof InternalUtilityTypes.NotificationListeners<E>>(notificationName: K, ...args: Parameters<E[K]>): void;
Type Parameters
Parameter | Constraint | Description |
---|---|---|
K | string & keyof InternalUtilityTypes.NotificationListeners<E> |
Parameters
Parameter | Type | Description |
---|---|---|
notificationName | K | the name of the notification to fire |
args | Parameters<E[K]> | the arguments sent with the notification |
unicast
Emits a notification with the specified name and arguments, notifying a single attendee.
For more information about our API support guarantees, see here.
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
unicast<K extends string & keyof InternalUtilityTypes.NotificationListeners<E>>(notificationName: K, targetAttendee: Attendee, ...args: Parameters<E[K]>): void;
Type Parameters
Parameter | Constraint | Description |
---|---|---|
K | string & keyof InternalUtilityTypes.NotificationListeners<E> |
Parameters
Parameter | Type | Description |
---|---|---|
notificationName | K | the name of the notification to fire |
targetAttendee | Attendee | the single attendee to notify |
args | Parameters<E[K]> | the arguments sent with the notification |