Skip to main content
Version: v2

NotificationEmitter Interface

Interface for a notification emitter that can send typed notification to other clients.

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.

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 NotificationEmitter<E extends InternalUtilityTypes.NotificationListeners<E>>

Type Parameters​

ParameterConstraintDescription
EInternalUtilityTypes.NotificationListeners<E>

Methods​

MethodAlertsReturn TypeDescription
broadcast(notificationName, args)AlphavoidEmits a notification with the specified name and arguments, notifying all clients.
unicast(notificationName, targetAttendee, args)AlphavoidEmits 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.

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

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

Signature​

broadcast<K extends keyof InternalUtilityTypes.NotificationListeners<E>>(notificationName: K, ...args: Parameters<E[K]>): void;
Type Parameters​
ParameterConstraintDescription
Kkeyof InternalUtilityTypes.NotificationListeners<E>

Parameters​

ParameterTypeDescription
notificationNameKthe name of the notification to fire
argsParameters<E[K]>the arguments sent with the notification

unicast​

Emits a notification with the specified name and arguments, notifying a single attendee.

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

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

Signature​

unicast<K extends keyof InternalUtilityTypes.NotificationListeners<E>>(notificationName: K, targetAttendee: Attendee, ...args: Parameters<E[K]>): void;
Type Parameters​
ParameterConstraintDescription
Kkeyof InternalUtilityTypes.NotificationListeners<E>

Parameters​

ParameterTypeDescription
notificationNameKthe name of the notification to fire
targetAttendeeAttendeethe single attendee to notify
argsParameters<E[K]>the arguments sent with the notification