@fluidframework/presence 2.83.0 → 2.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/alpha.d.ts +8 -2
  2. package/dist/beta.d.ts +5 -1
  3. package/dist/exposedInternalTypes.d.ts +7 -2
  4. package/dist/exposedInternalTypes.d.ts.map +1 -1
  5. package/dist/exposedInternalTypes.js.map +1 -1
  6. package/dist/exposedUtilityTypes.d.ts +3 -3
  7. package/dist/exposedUtilityTypes.d.ts.map +1 -1
  8. package/dist/exposedUtilityTypes.js.map +1 -1
  9. package/dist/index.d.ts +5 -5
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/internalUtils.d.ts +2 -2
  13. package/dist/internalUtils.d.ts.map +1 -1
  14. package/dist/internalUtils.js.map +1 -1
  15. package/dist/latestMapTypes.d.ts +36 -2
  16. package/dist/latestMapTypes.d.ts.map +1 -1
  17. package/dist/latestMapTypes.js +0 -1
  18. package/dist/latestMapTypes.js.map +1 -1
  19. package/dist/latestTypes.d.ts +36 -2
  20. package/dist/latestTypes.d.ts.map +1 -1
  21. package/dist/latestTypes.js.map +1 -1
  22. package/dist/legacy.alpha.d.ts +8 -2
  23. package/dist/notificationsManager.d.ts +3 -4
  24. package/dist/notificationsManager.d.ts.map +1 -1
  25. package/dist/notificationsManager.js.map +1 -1
  26. package/dist/notificationsManagerTypes.d.ts +33 -0
  27. package/dist/notificationsManagerTypes.d.ts.map +1 -1
  28. package/dist/notificationsManagerTypes.js.map +1 -1
  29. package/dist/packageVersion.d.ts +1 -1
  30. package/dist/packageVersion.js +1 -1
  31. package/dist/packageVersion.js.map +1 -1
  32. package/dist/presence.d.ts +2 -2
  33. package/dist/presence.d.ts.map +1 -1
  34. package/dist/presence.js.map +1 -1
  35. package/dist/presenceDatastoreManager.d.ts +2 -2
  36. package/dist/presenceDatastoreManager.d.ts.map +1 -1
  37. package/dist/presenceDatastoreManager.js.map +1 -1
  38. package/dist/presenceManager.d.ts.map +1 -1
  39. package/dist/presenceManager.js.map +1 -1
  40. package/dist/stateFactory.d.ts +2 -2
  41. package/dist/stateFactory.d.ts.map +1 -1
  42. package/dist/stateFactory.js.map +1 -1
  43. package/dist/types.d.ts +15 -17
  44. package/dist/types.d.ts.map +1 -1
  45. package/dist/types.js.map +1 -1
  46. package/dist/validatableTypes.d.ts +3 -3
  47. package/dist/validatableTypes.d.ts.map +1 -1
  48. package/dist/validatableTypes.js.map +1 -1
  49. package/lib/alpha.d.ts +8 -2
  50. package/lib/beta.d.ts +5 -1
  51. package/lib/exposedInternalTypes.d.ts +7 -2
  52. package/lib/exposedInternalTypes.d.ts.map +1 -1
  53. package/lib/exposedInternalTypes.js.map +1 -1
  54. package/lib/exposedUtilityTypes.d.ts +3 -3
  55. package/lib/exposedUtilityTypes.d.ts.map +1 -1
  56. package/lib/exposedUtilityTypes.js.map +1 -1
  57. package/lib/index.d.ts +5 -5
  58. package/lib/index.d.ts.map +1 -1
  59. package/lib/index.js.map +1 -1
  60. package/lib/internalUtils.d.ts +2 -2
  61. package/lib/internalUtils.d.ts.map +1 -1
  62. package/lib/internalUtils.js.map +1 -1
  63. package/lib/latestMapTypes.d.ts +36 -2
  64. package/lib/latestMapTypes.d.ts.map +1 -1
  65. package/lib/latestMapTypes.js +0 -1
  66. package/lib/latestMapTypes.js.map +1 -1
  67. package/lib/latestTypes.d.ts +36 -2
  68. package/lib/latestTypes.d.ts.map +1 -1
  69. package/lib/latestTypes.js.map +1 -1
  70. package/lib/legacy.alpha.d.ts +8 -2
  71. package/lib/notificationsManager.d.ts +3 -4
  72. package/lib/notificationsManager.d.ts.map +1 -1
  73. package/lib/notificationsManager.js.map +1 -1
  74. package/lib/notificationsManagerTypes.d.ts +33 -0
  75. package/lib/notificationsManagerTypes.d.ts.map +1 -1
  76. package/lib/notificationsManagerTypes.js.map +1 -1
  77. package/lib/packageVersion.d.ts +1 -1
  78. package/lib/packageVersion.js +1 -1
  79. package/lib/packageVersion.js.map +1 -1
  80. package/lib/presence.d.ts +2 -2
  81. package/lib/presence.d.ts.map +1 -1
  82. package/lib/presence.js.map +1 -1
  83. package/lib/presenceDatastoreManager.d.ts +2 -2
  84. package/lib/presenceDatastoreManager.d.ts.map +1 -1
  85. package/lib/presenceDatastoreManager.js.map +1 -1
  86. package/lib/presenceManager.d.ts.map +1 -1
  87. package/lib/presenceManager.js.map +1 -1
  88. package/lib/stateFactory.d.ts +2 -2
  89. package/lib/stateFactory.d.ts.map +1 -1
  90. package/lib/stateFactory.js.map +1 -1
  91. package/lib/types.d.ts +15 -17
  92. package/lib/types.d.ts.map +1 -1
  93. package/lib/types.js.map +1 -1
  94. package/lib/validatableTypes.d.ts +3 -3
  95. package/lib/validatableTypes.d.ts.map +1 -1
  96. package/lib/validatableTypes.js.map +1 -1
  97. package/package.json +17 -17
@@ -1 +1 @@
1
- {"version":3,"file":"latestTypes.js","sourceRoot":"","sources":["../src/latestTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type {\n\tDeepReadonly,\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\nimport type { BroadcastControls, BroadcastControlSettings } from \"./broadcastControlsTypes.js\";\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type {\n\tLatestClientData,\n\tLatestData,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateSchemaValidator,\n\tValueAccessor,\n} from \"./latestValueTypes.js\";\nimport type { Attendee, Presence } from \"./presence.js\";\n\n/**\n * Events from {@link LatestRaw}.\n *\n * @sealed\n * @beta\n */\nexport interface LatestEvents<\n\tT,\n\tTRemoteValueAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>,\n> {\n\t/**\n\t * Raised when remote client's value is updated, which may be the same value.\n\t *\n\t * @eventProperty\n\t */\n\tremoteUpdated: (update: LatestClientData<T, TRemoteValueAccessor>) => void;\n\n\t/**\n\t * Raised when local client's value is updated, which may be the same value.\n\t *\n\t * @eventProperty\n\t */\n\tlocalUpdated: (update: { value: DeepReadonly<JsonSerializable<T>> }) => void;\n}\n\n/**\n * Events from {@link LatestRaw}.\n *\n * @sealed\n * @beta\n */\nexport type LatestRawEvents<T> = LatestEvents<T, RawValueAccessor<T>>;\n\n/**\n * State that provides the latest known value from this client to others and read access to their values.\n * All participant clients must provide a value.\n *\n * @remarks Create using {@link StateFactory}.{@link LatestFactory|latest} registered to {@link StatesWorkspace}.\n *\n * @sealed\n * @beta\n */\nexport type LatestRaw<T> = Latest<T, RawValueAccessor<T>>;\n\n/**\n * State that provides the latest known value from this client to others and read access to their values.\n * All participant clients must provide a value.\n *\n * @remarks Create using {@link StateFactory}.{@link LatestFactory|latest} registered to {@link StatesWorkspace}.\n *\n * @sealed\n * @beta\n */\nexport interface Latest<\n\tT,\n\tTRemoteAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>,\n> {\n\t/**\n\t * Containing {@link Presence}\n\t */\n\treadonly presence: Presence;\n\n\t/**\n\t * Events for LatestRaw.\n\t */\n\treadonly events: Listenable<LatestEvents<T, TRemoteAccessor>>;\n\n\t/**\n\t * Controls for management of sending updates.\n\t */\n\treadonly controls: BroadcastControls;\n\n\t/**\n\t * Current state for this client.\n\t * State for this client that will be transmitted to all other connected clients.\n\t * @remarks Manager assumes ownership of the value and its references. Make a deep clone before\n\t * setting, if needed. No comparison is done to detect changes; all sets are transmitted.\n\t */\n\tget local(): DeepReadonly<JsonDeserialized<T>>;\n\tset local(value: JsonSerializable<T>);\n\n\t/**\n\t * Array of {@link Attendee}s that have provided states.\n\t */\n\tgetStateAttendees(): Attendee[];\n\n\t/**\n\t * Iterable access to remote clients' values.\n\t */\n\tgetRemotes(): IterableIterator<LatestClientData<T, TRemoteAccessor>>;\n\n\t/**\n\t * Access to a specific attendee's value.\n\t */\n\tgetRemote(attendee: Attendee): LatestData<T, TRemoteAccessor>;\n}\n\n/**\n * Arguments that are passed to the {@link StateFactory}.{@link LatestFactory|latest} function to create a {@link LatestRaw} State object.\n *\n * @input\n * @beta\n */\nexport interface LatestArgumentsRaw<T extends object | null> {\n\t/**\n\t * The initial value of the local state.\n\t *\n\t * @remarks\n\t * `latest` assumes ownership of the value and its references.\n\t * Make a deep clone before passing, if needed.\n\t */\n\tlocal: JsonSerializable<T>;\n\n\t/**\n\t * See {@link BroadcastControlSettings}.\n\t */\n\tsettings?: BroadcastControlSettings | undefined;\n}\n\n/**\n * Arguments that are passed to the {@link StateFactory}.{@link LatestFactory|latest} function to create a {@link Latest} State object.\n *\n * @input\n * @beta\n */\nexport interface LatestArguments<T extends object | null> extends LatestArgumentsRaw<T> {\n\t/**\n\t * See {@link StateSchemaValidator}.\n\t */\n\tvalidator: StateSchemaValidator<T>;\n}\n\n/**\n * Factory for creating a {@link Latest} or {@link LatestRaw} State object.\n *\n * @beta\n * @sealed\n */\nexport interface LatestFactory {\n\t/**\n\t * Factory for creating a {@link Latest} State object.\n\t *\n\t * @remarks\n\t * This overload is used when called with {@link LatestArguments}.\n\t * That is, if a validator function is provided.\n\t */\n\t<T extends object | null, Key extends string = string>(\n\t\targs: LatestArguments<T>,\n\t): InternalTypes.ManagerFactory<Key, InternalTypes.ValueRequiredState<T>, Latest<T>>;\n\n\t/**\n\t * Factory for creating a {@link LatestRaw} State object.\n\t *\n\t * @remarks\n\t * This overload is used when called with {@link LatestArgumentsRaw}.\n\t * That is, if a validator function is _not_ provided.\n\t */\n\t<T extends object | null, Key extends string = string>(\n\t\targs: LatestArgumentsRaw<T>,\n\t): InternalTypes.ManagerFactory<Key, InternalTypes.ValueRequiredState<T>, LatestRaw<T>>;\n}\n"]}
1
+ {"version":3,"file":"latestTypes.js","sourceRoot":"","sources":["../src/latestTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type {\n\tDeepReadonly,\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\nimport type { BroadcastControls, BroadcastControlSettings } from \"./broadcastControlsTypes.js\";\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type {\n\tLatestClientData,\n\tLatestData,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateSchemaValidator,\n\tValueAccessor,\n} from \"./latestValueTypes.js\";\nimport type { Attendee, Presence } from \"./presence.js\";\n\n/**\n * Events from {@link LatestRaw}.\n *\n * @sealed\n * @beta\n */\nexport interface LatestEvents<\n\tT,\n\tTRemoteValueAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>,\n> {\n\t/**\n\t * Raised when remote client's value is updated, which may be the same value.\n\t *\n\t * @eventProperty\n\t */\n\tremoteUpdated: (update: LatestClientData<T, TRemoteValueAccessor>) => void;\n\n\t/**\n\t * Raised when local client's value is updated, which may be the same value.\n\t *\n\t * @eventProperty\n\t */\n\tlocalUpdated: (update: { value: DeepReadonly<JsonSerializable<T>> }) => void;\n}\n\n/**\n * Events from {@link LatestRaw}.\n *\n * @sealed\n * @beta\n */\nexport type LatestRawEvents<T> = LatestEvents<T, RawValueAccessor<T>>;\n\n/**\n * State that provides the latest known value from this client to others and read access to their values.\n * All participant clients must provide a value.\n *\n * @remarks Create using {@link StateFactory}.{@link LatestFactory|latest} registered to {@link StatesWorkspace}.\n *\n * @sealed\n * @beta\n */\nexport type LatestRaw<T> = Latest<T, RawValueAccessor<T>>;\n\n/**\n * State that provides the latest known value from this client to others and read access to their values.\n * All participant clients must provide a value.\n *\n * @remarks Create using {@link StateFactory}.{@link LatestFactory|latest} registered to {@link StatesWorkspace}.\n *\n * @sealed\n * @beta\n */\nexport interface Latest<\n\tT,\n\tTRemoteAccessor extends ValueAccessor<T> = ProxiedValueAccessor<T>,\n> {\n\t/**\n\t * Containing {@link Presence}\n\t */\n\treadonly presence: Presence;\n\n\t/**\n\t * Events for LatestRaw.\n\t */\n\treadonly events: Listenable<LatestEvents<T, TRemoteAccessor>>;\n\n\t/**\n\t * Controls for management of sending updates.\n\t */\n\treadonly controls: BroadcastControls;\n\n\t/**\n\t * Current state for this client.\n\t * State for this client that will be transmitted to all other connected clients.\n\t * @remarks Manager assumes ownership of the value and its references. Make a deep clone before\n\t * setting, if needed. No comparison is done to detect changes; all sets are transmitted.\n\t */\n\tget local(): DeepReadonly<JsonDeserialized<T>>;\n\tset local(value: JsonSerializable<T>);\n\n\t/**\n\t * Array of {@link Attendee}s that have provided states.\n\t */\n\tgetStateAttendees(): Attendee[];\n\n\t/**\n\t * Iterable access to remote clients' values.\n\t */\n\tgetRemotes(): IterableIterator<LatestClientData<T, TRemoteAccessor>>;\n\n\t/**\n\t * Access to a specific attendee's value.\n\t */\n\tgetRemote(attendee: Attendee): LatestData<T, TRemoteAccessor>;\n}\n\n/**\n * Arguments that are passed to the {@link StateFactory}.{@link LatestFactory|latest} function to create a {@link LatestRaw} State object.\n *\n * @input\n * @beta\n */\nexport interface LatestArgumentsRaw<T extends object | null> {\n\t/**\n\t * The initial value of the local state.\n\t *\n\t * @remarks\n\t * `latest` assumes ownership of the value and its references.\n\t * Make a deep clone before passing, if needed.\n\t */\n\tlocal: JsonSerializable<T>;\n\n\t/**\n\t * See {@link BroadcastControlSettings}.\n\t */\n\tsettings?: BroadcastControlSettings | undefined;\n}\n\n/**\n * Arguments that are passed to the {@link StateFactory}.{@link LatestFactory|latest} function to create a {@link Latest} State object.\n *\n * @input\n * @beta\n */\nexport interface LatestArguments<T extends object | null> extends LatestArgumentsRaw<T> {\n\t/**\n\t * See {@link StateSchemaValidator}.\n\t */\n\tvalidator: StateSchemaValidator<T>;\n}\n\n/**\n * Type alias for the return type of {@link LatestFactory} when called with\n * {@link LatestArguments}.\n *\n * @remarks\n * Use this type instead of any InternalPresenceTypes that may be revealed from\n * examining factory return type.\n *\n * @typeparam RegistrationKeyRestrictions - Optional type parameter to constrain\n * allowed registration keys for this State object within a workspace.\n * Specification is recommended to highlight connection between schema and\n * factory when spread across modules.\n *\n * @beta\n * @sealed\n */\nexport type LatestConfiguration<\n\t// eslint-disable-next-line @rushstack/no-new-null -- undefined is not a valid replacement for null\n\tT extends object | null,\n\tRegistrationKeyRestrictions extends string = string,\n> = InternalTypes.ManagerFactory<\n\tRegistrationKeyRestrictions,\n\tInternalTypes.ValueRequiredState<T>,\n\tLatest<T>\n>;\n\n/**\n * Type alias for the return type of {@link LatestFactory} when called with\n * {@link LatestArgumentsRaw}.\n *\n * @remarks\n * Use this type instead of any InternalPresenceTypes that may be revealed from\n * examining factory return type.\n *\n * @typeparam RegistrationKeyRestrictions - Optional type parameter to constrain\n * allowed registration keys for this State object within a workspace.\n * Specification is recommended to highlight connection between schema and\n * factory when spread across modules.\n *\n * @beta\n * @sealed\n */\nexport type LatestRawConfiguration<\n\t// eslint-disable-next-line @rushstack/no-new-null -- undefined is not a valid replacement for null\n\tT extends object | null,\n\tRegistrationKeyRestrictions extends string = string,\n> = InternalTypes.ManagerFactory<\n\tRegistrationKeyRestrictions,\n\tInternalTypes.ValueRequiredState<T>,\n\tLatestRaw<T>\n>;\n\n/**\n * Factory for creating a {@link Latest} or {@link LatestRaw} State object.\n *\n * @beta\n * @sealed\n */\nexport interface LatestFactory {\n\t/**\n\t * Factory for creating a {@link Latest} State object.\n\t *\n\t * @remarks\n\t * This overload is used when called with {@link LatestArguments}.\n\t * That is, if a validator function is provided.\n\t */\n\t<T extends object | null, RegistrationKeyRestrictions extends string = string>(\n\t\targs: LatestArguments<T>,\n\t): LatestConfiguration<T, RegistrationKeyRestrictions>;\n\n\t/**\n\t * Factory for creating a {@link LatestRaw} State object.\n\t *\n\t * @remarks\n\t * This overload is used when called with {@link LatestArgumentsRaw}.\n\t * That is, if a validator function is _not_ provided.\n\t */\n\t<T extends object | null, RegistrationKeyRestrictions extends string = string>(\n\t\targs: LatestArgumentsRaw<T>,\n\t): LatestRawConfiguration<T, RegistrationKeyRestrictions>;\n}\n"]}
@@ -26,12 +26,13 @@ export {
26
26
  BroadcastControlSettings,
27
27
  BroadcastControls,
28
28
  ClientConnectionId,
29
- InternalTypes,
29
+ InternalPresenceTypes,
30
30
  KeySchemaValidator,
31
31
  Latest,
32
32
  LatestArguments,
33
33
  LatestArgumentsRaw,
34
34
  LatestClientData,
35
+ LatestConfiguration,
35
36
  LatestData,
36
37
  LatestEvents,
37
38
  LatestFactory,
@@ -39,14 +40,17 @@ export {
39
40
  LatestMapArguments,
40
41
  LatestMapArgumentsRaw,
41
42
  LatestMapClientData,
43
+ LatestMapConfiguration,
42
44
  LatestMapEvents,
43
45
  LatestMapFactory,
44
46
  LatestMapItemRemovedClientData,
45
47
  LatestMapItemUpdatedClientData,
46
48
  LatestMapRaw,
49
+ LatestMapRawConfiguration,
47
50
  LatestMapRawEvents,
48
51
  LatestMetadata,
49
52
  LatestRaw,
53
+ LatestRawConfiguration,
50
54
  LatestRawEvents,
51
55
  Presence,
52
56
  PresenceEvents,
@@ -65,13 +69,15 @@ export {
65
69
  // #endregion
66
70
 
67
71
  // #region @alpha APIs
68
- InternalUtilityTypes,
72
+ InternalPresenceUtilityTypes,
69
73
  NotificationEmitter,
70
74
  NotificationListenable,
71
75
  NotificationSubscriberSignatures,
72
76
  Notifications,
77
+ NotificationsConfiguration,
73
78
  NotificationsManager,
74
79
  NotificationsManagerEvents,
80
+ NotificationsWithSubscriptionsConfiguration,
75
81
  NotificationsWorkspace,
76
82
  NotificationsWorkspaceSchema,
77
83
  PresenceWithNotifications,
@@ -2,9 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { InternalTypes } from "./exposedInternalTypes.js";
6
5
  import type { InternalUtilityTypes } from "./exposedUtilityTypes.js";
7
- import type { NotificationsManager, NotificationSubscriberSignatures } from "./notificationsManagerTypes.js";
6
+ import type { NotificationsConfiguration, NotificationSubscriberSignatures, NotificationsWithSubscriptionsConfiguration } from "./notificationsManagerTypes.js";
8
7
  /**
9
8
  * Factory for creating a {@link NotificationsManager}.
10
9
  *
@@ -14,7 +13,7 @@ import type { NotificationsManager, NotificationSubscriberSignatures } from "./n
14
13
  * This overload requires explicit specification of the notification listener
15
14
  * types. It is useful when a schema is separately defined.
16
15
  */
17
- export declare function Notifications<T extends InternalUtilityTypes.NotificationListeners<T>, Key extends string = string>(initialSubscriptions: Partial<NotificationSubscriberSignatures<T>>): InternalTypes.ManagerFactory<Key, InternalTypes.ValueRequiredState<InternalTypes.NotificationType>, NotificationsManager<T>>;
16
+ export declare function Notifications<T extends InternalUtilityTypes.NotificationListeners<T>, Key extends string = string>(initialSubscriptions: Partial<NotificationSubscriberSignatures<T>>): NotificationsConfiguration<T, Key>;
18
17
  /**
19
18
  * Factory for creating a {@link NotificationsManager}.
20
19
  *
@@ -24,5 +23,5 @@ export declare function Notifications<T extends InternalUtilityTypes.Notificatio
24
23
  * This overload infers the notification listener types from the provided
25
24
  * subscriptions, simplifying usage when a schema is not separately defined.
26
25
  */
27
- export declare function Notifications<TSubscriptions extends InternalUtilityTypes.NotificationListenersWithSubscriberSignatures<TSubscriptions>, Key extends string = string>(initialSubscriptions: Partial<TSubscriptions>): InternalTypes.ManagerFactory<Key, InternalTypes.ValueRequiredState<InternalTypes.NotificationType>, NotificationsManager<InternalUtilityTypes.NotificationListenersFromSubscriberSignatures<TSubscriptions>>>;
26
+ export declare function Notifications<TSubscriptions extends InternalUtilityTypes.NotificationListenersWithSubscriberSignatures<TSubscriptions>, Key extends string = string>(initialSubscriptions: Partial<TSubscriptions>): NotificationsWithSubscriptionsConfiguration<TSubscriptions, Key>;
28
27
  //# sourceMappingURL=notificationsManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notificationsManager.d.ts","sourceRoot":"","sources":["../src/notificationsManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAGX,oBAAoB,EAEpB,gCAAgC,EAChC,MAAM,gCAAgC,CAAC;AAoHxC;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC5B,CAAC,SAAS,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACvD,GAAG,SAAS,MAAM,GAAG,MAAM,EAE3B,oBAAoB,EAAE,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,GAChE,aAAa,CAAC,cAAc,CAC9B,GAAG,EACH,aAAa,CAAC,kBAAkB,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAChE,oBAAoB,CAAC,CAAC,CAAC,CACvB,CAAC;AACF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC5B,cAAc,SACb,oBAAoB,CAAC,6CAA6C,CAAC,cAAc,CAAC,EACnF,GAAG,SAAS,MAAM,GAAG,MAAM,EAE3B,oBAAoB,EAAE,OAAO,CAAC,cAAc,CAAC,GAC3C,aAAa,CAAC,cAAc,CAC9B,GAAG,EACH,aAAa,CAAC,kBAAkB,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAChE,oBAAoB,CACnB,oBAAoB,CAAC,6CAA6C,CAAC,cAAc,CAAC,CAClF,CACD,CAAC"}
1
+ {"version":3,"file":"notificationsManager.d.ts","sourceRoot":"","sources":["../src/notificationsManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAGX,0BAA0B,EAG1B,gCAAgC,EAChC,2CAA2C,EAC3C,MAAM,gCAAgC,CAAC;AAoHxC;;;;;;;;GAQG;AACH,wBAAgB,aAAa,C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EM,MAAM,CACZ,QAAkB,EAClB,SAAiB,EACjB,WAA6E;QAE7E,MAAM,iBAAiB,GAAuB,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,KAAK,CAAC,IAA4D,CAAC;QACrF,IAAI,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YACxD,+EAA+E;YAC/E,oGAAoG;YACpG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAEpC,CAAC;YACF,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QACnF,CAAC;aAAM,CAAC;YACP,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,CAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAC/E,CAAC;QACH,CAAC;QACD,OAAO,iBAAiB,CAAC;IAC1B,CAAC;CACD;AA4CD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAM5B,oBAA6C;IAM7C,MAAM,OAAO,GAAG,CACf,GAAQ,EACR,eAGC,EAGA,EAAE,CAAC,CAAC;QACL,OAAO,EAAE,QAAQ,CAKhB,IAAI,wBAAwB,CAC3B,GAAG,EACH,mBAAmB,CAAC,eAAe,CAAC,EACpC,oBAAoB,CACpB,CACD;KACD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listeners } from \"@fluidframework/core-interfaces\";\nimport type { JsonTypeWith } from \"@fluidframework/core-interfaces/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\nimport { revealOpaqueJson, toOpaqueJson } from \"./internalUtils.js\";\nimport type {\n\tNotificationEmitter,\n\tNotificationListenable,\n\tNotificationsManager,\n\tNotificationsManagerEvents,\n\tNotificationSubscriberSignatures,\n} from \"./notificationsManagerTypes.js\";\nimport type { Attendee, PresenceWithNotifications as Presence } from \"./presence.js\";\nimport { datastoreFromHandle, type StateDatastore } from \"./stateDatastore.js\";\nimport type { PostUpdateAction, ValueManager } from \"./statesManagerTypes.js\";\nimport { brandIVM } from \"./valueManager.js\";\n\n/**\n * Object.keys retyped to support specific records keys and\n * branded string-based keys.\n */\nconst recordKeys = Object.keys as <K extends string>(o: Partial<Record<K, unknown>>) => K[];\n\nclass NotificationsManagerImpl<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tKey extends string,\n> implements\n\t\tNotificationsManager<T>,\n\t\tValueManager<\n\t\t\tInternalTypes.NotificationType,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>\n{\n\tpublic readonly events = createEmitter<NotificationsManagerEvents>();\n\n\tpublic readonly emit: NotificationEmitter<T> = {\n\t\tbroadcast: (name: string, ...args) => {\n\t\t\tthis.datastore.localUpdate(\n\t\t\t\tthis.key,\n\t\t\t\t{\n\t\t\t\t\trev: 0,\n\t\t\t\t\ttimestamp: 0,\n\t\t\t\t\tvalue: toOpaqueJson({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\targs: [...(args as JsonTypeWith<never>[])],\n\t\t\t\t\t}),\n\t\t\t\t\tignoreUnmonitored: true,\n\t\t\t\t},\n\t\t\t\t// This is a notification, so we want to send it immediately.\n\t\t\t\t{ allowableUpdateLatencyMs: 0 },\n\t\t\t);\n\t\t},\n\t\tunicast: (name: string, targetAttendee, ...args) => {\n\t\t\tthis.datastore.localUpdate(\n\t\t\t\tthis.key,\n\t\t\t\t{\n\t\t\t\t\trev: 0,\n\t\t\t\t\ttimestamp: 0,\n\t\t\t\t\tvalue: toOpaqueJson({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\targs: [...(args as JsonTypeWith<never>[])],\n\t\t\t\t\t}),\n\t\t\t\t\tignoreUnmonitored: true,\n\t\t\t\t},\n\t\t\t\t// This is a notification, so we want to send it immediately.\n\t\t\t\t{ allowableUpdateLatencyMs: 0, targetClientId: targetAttendee.getConnectionId() },\n\t\t\t);\n\t\t},\n\t};\n\n\t// Workaround for types\n\tprivate readonly notificationsInternal =\n\t\tcreateEmitter<NotificationSubscriberSignatures<T>>();\n\n\tpublic readonly notifications: NotificationListenable<T> = this.notificationsInternal;\n\n\tpublic constructor(\n\t\tprivate readonly key: Key,\n\t\tprivate readonly datastore: StateDatastore<\n\t\t\tKey,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>,\n\t\tinitialSubscriptions: Partial<NotificationSubscriberSignatures<T>>,\n\t) {\n\t\t// Add event listeners provided at instantiation\n\t\tfor (const subscriptionName of recordKeys(initialSubscriptions)) {\n\t\t\t// Lingering Event typing issues with Notifications specialization requires\n\t\t\t// this cast. The only thing that really matters is that name is a string.\n\t\t\tconst name = subscriptionName as keyof Listeners<NotificationSubscriberSignatures<T>>;\n\t\t\tconst value = initialSubscriptions[subscriptionName];\n\t\t\t// This check should not be needed while using exactOptionalPropertyTypes, but\n\t\t\t// typescript appears to ignore that with Partial<>. Good to be defensive\n\t\t\t// against callers sending `undefined` anyway.\n\t\t\tif (value !== undefined) {\n\t\t\t\tthis.notificationsInternal.on(name, value);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get presence(): Presence {\n\t\treturn this.datastore.presence;\n\t}\n\n\tpublic update(\n\t\tattendee: Attendee,\n\t\t_received: number,\n\t\tupdateValue: InternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\t): PostUpdateAction[] {\n\t\tconst postUpdateActions: PostUpdateAction[] = [];\n\t\tconst value = revealOpaqueJson(updateValue.value);\n\t\tconst eventName = value.name as keyof Listeners<NotificationSubscriberSignatures<T>>;\n\t\tif (this.notificationsInternal.hasListeners(eventName)) {\n\t\t\t// Without schema validation, we don't know that the args are the correct type.\n\t\t\t// For now we assume the user is sending the correct types and there is no corruption along the way.\n\t\t\tconst args = [attendee, ...value.args] as Parameters<\n\t\t\t\tNotificationSubscriberSignatures<T>[typeof eventName]\n\t\t\t>;\n\t\t\tpostUpdateActions.push(() => this.notificationsInternal.emit(eventName, ...args));\n\t\t} else {\n\t\t\tpostUpdateActions.push(() =>\n\t\t\t\tthis.events.emit(\"unattendedNotification\", value.name, attendee, ...value.args),\n\t\t\t);\n\t\t}\n\t\treturn postUpdateActions;\n\t}\n}\n\n/**\n * Factory for creating a {@link NotificationsManager}.\n *\n * @alpha\n *\n * @privateRemarks\n * This overload requires explicit specification of the notification listener\n * types. It is useful when a schema is separately defined.\n */\nexport function Notifications<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tKey extends string = string,\n>(\n\tinitialSubscriptions: Partial<NotificationSubscriberSignatures<T>>,\n): InternalTypes.ManagerFactory<\n\tKey,\n\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\tNotificationsManager<T>\n>;\n/**\n * Factory for creating a {@link NotificationsManager}.\n *\n * @alpha\n *\n * @privateRemarks\n * This overload infers the notification listener types from the provided\n * subscriptions, simplifying usage when a schema is not separately defined.\n */\nexport function Notifications<\n\tTSubscriptions extends\n\t\tInternalUtilityTypes.NotificationListenersWithSubscriberSignatures<TSubscriptions>,\n\tKey extends string = string,\n>(\n\tinitialSubscriptions: Partial<TSubscriptions>,\n): InternalTypes.ManagerFactory<\n\tKey,\n\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\tNotificationsManager<\n\t\tInternalUtilityTypes.NotificationListenersFromSubscriberSignatures<TSubscriptions>\n\t>\n>;\n\n/**\n * Factory for creating a {@link NotificationsManager}.\n *\n * @alpha\n */\nexport function Notifications<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tKey extends string = string,\n\tTSubscriptions extends\n\t\tNotificationSubscriberSignatures<T> = NotificationSubscriberSignatures<T>,\n>(\n\tinitialSubscriptions: Partial<TSubscriptions>,\n): InternalTypes.ManagerFactory<\n\tKey,\n\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\tNotificationsManager<T>\n> {\n\tconst factory = (\n\t\tkey: Key,\n\t\tdatastoreHandle: InternalTypes.StateDatastoreHandle<\n\t\t\tKey,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>,\n\t): {\n\t\tmanager: InternalTypes.StateValue<NotificationsManager<T>>;\n\t} => ({\n\t\tmanager: brandIVM<\n\t\t\tNotificationsManagerImpl<T, Key>,\n\t\t\tInternalTypes.NotificationType,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>(\n\t\t\tnew NotificationsManagerImpl(\n\t\t\t\tkey,\n\t\t\t\tdatastoreFromHandle(datastoreHandle),\n\t\t\t\tinitialSubscriptions,\n\t\t\t),\n\t\t),\n\t});\n\treturn Object.assign(factory, { instanceBase: NotificationsManagerImpl });\n}\n"]}
1
+ {"version":3,"file":"notificationsManager.js","sourceRoot":"","sources":["../src/notificationsManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAM7D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWpE,OAAO,EAAE,mBAAmB,EAAuB,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAiE,CAAC;AAE5F,MAAM,wBAAw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AO,GAAG,CACf,GAAQ,EACR,eAGC,EAGA,EAAE,CAAC,CAAC;QACL,OAAO,EAAE,QAAQ,CAKhB,IAAI,wBAAwB,CAC3B,GAAG,EACH,mBAAmB,CAAC,eAAe,CAAC,EACpC,oBAAoB,CACpB,CACD;KACD,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listeners } from \"@fluidframework/core-interfaces\";\nimport type { JsonTypeWith } from \"@fluidframework/core-interfaces/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\nimport { revealOpaqueJson, toOpaqueJson } from \"./internalUtils.js\";\nimport type {\n\tNotificationEmitter,\n\tNotificationListenable,\n\tNotificationsConfiguration,\n\tNotificationsManager,\n\tNotificationsManagerEvents,\n\tNotificationSubscriberSignatures,\n\tNotificationsWithSubscriptionsConfiguration,\n} from \"./notificationsManagerTypes.js\";\nimport type { Attendee, PresenceWithNotifications as Presence } from \"./presence.js\";\nimport { datastoreFromHandle, type StateDatastore } from \"./stateDatastore.js\";\nimport type { PostUpdateAction, ValueManager } from \"./statesManagerTypes.js\";\nimport { brandIVM } from \"./valueManager.js\";\n\n/**\n * Object.keys retyped to support specific records keys and\n * branded string-based keys.\n */\nconst recordKeys = Object.keys as <K extends string>(o: Partial<Record<K, unknown>>) => K[];\n\nclass NotificationsManagerImpl<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tKey extends string,\n> implements\n\t\tNotificationsManager<T>,\n\t\tValueManager<\n\t\t\tInternalTypes.NotificationType,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>\n{\n\tpublic readonly events = createEmitter<NotificationsManagerEvents>();\n\n\tpublic readonly emit: NotificationEmitter<T> = {\n\t\tbroadcast: (name: string, ...args) => {\n\t\t\tthis.datastore.localUpdate(\n\t\t\t\tthis.key,\n\t\t\t\t{\n\t\t\t\t\trev: 0,\n\t\t\t\t\ttimestamp: 0,\n\t\t\t\t\tvalue: toOpaqueJson({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\targs: [...(args as JsonTypeWith<never>[])],\n\t\t\t\t\t}),\n\t\t\t\t\tignoreUnmonitored: true,\n\t\t\t\t},\n\t\t\t\t// This is a notification, so we want to send it immediately.\n\t\t\t\t{ allowableUpdateLatencyMs: 0 },\n\t\t\t);\n\t\t},\n\t\tunicast: (name: string, targetAttendee, ...args) => {\n\t\t\tthis.datastore.localUpdate(\n\t\t\t\tthis.key,\n\t\t\t\t{\n\t\t\t\t\trev: 0,\n\t\t\t\t\ttimestamp: 0,\n\t\t\t\t\tvalue: toOpaqueJson({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\targs: [...(args as JsonTypeWith<never>[])],\n\t\t\t\t\t}),\n\t\t\t\t\tignoreUnmonitored: true,\n\t\t\t\t},\n\t\t\t\t// This is a notification, so we want to send it immediately.\n\t\t\t\t{ allowableUpdateLatencyMs: 0, targetClientId: targetAttendee.getConnectionId() },\n\t\t\t);\n\t\t},\n\t};\n\n\t// Workaround for types\n\tprivate readonly notificationsInternal =\n\t\tcreateEmitter<NotificationSubscriberSignatures<T>>();\n\n\tpublic readonly notifications: NotificationListenable<T> = this.notificationsInternal;\n\n\tpublic constructor(\n\t\tprivate readonly key: Key,\n\t\tprivate readonly datastore: StateDatastore<\n\t\t\tKey,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>,\n\t\tinitialSubscriptions: Partial<NotificationSubscriberSignatures<T>>,\n\t) {\n\t\t// Add event listeners provided at instantiation\n\t\tfor (const subscriptionName of recordKeys(initialSubscriptions)) {\n\t\t\t// Lingering Event typing issues with Notifications specialization requires\n\t\t\t// this cast. The only thing that really matters is that name is a string.\n\t\t\tconst name = subscriptionName as keyof Listeners<NotificationSubscriberSignatures<T>>;\n\t\t\tconst value = initialSubscriptions[subscriptionName];\n\t\t\t// This check should not be needed while using exactOptionalPropertyTypes, but\n\t\t\t// typescript appears to ignore that with Partial<>. Good to be defensive\n\t\t\t// against callers sending `undefined` anyway.\n\t\t\tif (value !== undefined) {\n\t\t\t\tthis.notificationsInternal.on(name, value);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get presence(): Presence {\n\t\treturn this.datastore.presence;\n\t}\n\n\tpublic update(\n\t\tattendee: Attendee,\n\t\t_received: number,\n\t\tupdateValue: InternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\t): PostUpdateAction[] {\n\t\tconst postUpdateActions: PostUpdateAction[] = [];\n\t\tconst value = revealOpaqueJson(updateValue.value);\n\t\tconst eventName = value.name as keyof Listeners<NotificationSubscriberSignatures<T>>;\n\t\tif (this.notificationsInternal.hasListeners(eventName)) {\n\t\t\t// Without schema validation, we don't know that the args are the correct type.\n\t\t\t// For now we assume the user is sending the correct types and there is no corruption along the way.\n\t\t\tconst args = [attendee, ...value.args] as Parameters<\n\t\t\t\tNotificationSubscriberSignatures<T>[typeof eventName]\n\t\t\t>;\n\t\t\tpostUpdateActions.push(() => this.notificationsInternal.emit(eventName, ...args));\n\t\t} else {\n\t\t\tpostUpdateActions.push(() =>\n\t\t\t\tthis.events.emit(\"unattendedNotification\", value.name, attendee, ...value.args),\n\t\t\t);\n\t\t}\n\t\treturn postUpdateActions;\n\t}\n}\n\n/**\n * Factory for creating a {@link NotificationsManager}.\n *\n * @alpha\n *\n * @privateRemarks\n * This overload requires explicit specification of the notification listener\n * types. It is useful when a schema is separately defined.\n */\nexport function Notifications<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tKey extends string = string,\n>(\n\tinitialSubscriptions: Partial<NotificationSubscriberSignatures<T>>,\n): NotificationsConfiguration<T, Key>;\n/**\n * Factory for creating a {@link NotificationsManager}.\n *\n * @alpha\n *\n * @privateRemarks\n * This overload infers the notification listener types from the provided\n * subscriptions, simplifying usage when a schema is not separately defined.\n */\nexport function Notifications<\n\tTSubscriptions extends\n\t\tInternalUtilityTypes.NotificationListenersWithSubscriberSignatures<TSubscriptions>,\n\tKey extends string = string,\n>(\n\tinitialSubscriptions: Partial<TSubscriptions>,\n): NotificationsWithSubscriptionsConfiguration<TSubscriptions, Key>;\n\n/**\n * Factory for creating a {@link NotificationsManager}.\n *\n * @alpha\n */\nexport function Notifications<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tKey extends string = string,\n\tTSubscriptions extends\n\t\tNotificationSubscriberSignatures<T> = NotificationSubscriberSignatures<T>,\n>(\n\tinitialSubscriptions: Partial<TSubscriptions>,\n): InternalTypes.ManagerFactory<\n\tKey,\n\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\tNotificationsManager<T>\n> {\n\tconst factory = (\n\t\tkey: Key,\n\t\tdatastoreHandle: InternalTypes.StateDatastoreHandle<\n\t\t\tKey,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>,\n\t): {\n\t\tmanager: InternalTypes.StateValue<NotificationsManager<T>>;\n\t} => ({\n\t\tmanager: brandIVM<\n\t\t\tNotificationsManagerImpl<T, Key>,\n\t\t\tInternalTypes.NotificationType,\n\t\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>\n\t\t>(\n\t\t\tnew NotificationsManagerImpl(\n\t\t\t\tkey,\n\t\t\t\tdatastoreFromHandle(datastoreHandle),\n\t\t\t\tinitialSubscriptions,\n\t\t\t),\n\t\t),\n\t});\n\treturn Object.assign(factory, { instanceBase: NotificationsManagerImpl });\n}\n"]}
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { Listenable, Off } from "@fluidframework/core-interfaces";
6
+ import type { InternalTypes } from "./exposedInternalTypes.js";
6
7
  import type { InternalUtilityTypes } from "./exposedUtilityTypes.js";
7
8
  import type { Attendee, PresenceWithNotifications as Presence } from "./presence.js";
8
9
  /**
@@ -108,4 +109,36 @@ export interface NotificationsManager<T extends InternalUtilityTypes.Notificatio
108
109
  */
109
110
  readonly notifications: NotificationListenable<T>;
110
111
  }
112
+ /**
113
+ * Type alias for the return type of {@link (Notifications:1)}.
114
+ *
115
+ * @remarks
116
+ * Use this type instead of any InternalPresenceTypes that may be revealed from
117
+ * examining factory return type.
118
+ *
119
+ * @typeparam RegistrationKeyRestrictions - Optional type parameter to constrain
120
+ * allowed registration keys for this Notification within a workspace.
121
+ * Specification is recommended to highlight connection between schema and
122
+ * factory when spread across modules.
123
+ *
124
+ * @alpha
125
+ * @sealed
126
+ */
127
+ export type NotificationsConfiguration<T extends InternalUtilityTypes.NotificationListeners<T>, RegistrationKeyRestrictions extends string = string> = InternalTypes.ManagerFactory<RegistrationKeyRestrictions, InternalTypes.ValueRequiredState<InternalTypes.NotificationType>, NotificationsManager<T>>;
128
+ /**
129
+ * Type alias for the return type of {@link (Notifications:2)}.
130
+ *
131
+ * @remarks
132
+ * Use this type instead of any InternalPresenceTypes that may be revealed from
133
+ * examining factory return type.
134
+ *
135
+ * @typeparam RegistrationKeyRestrictions - Optional type parameter to constrain
136
+ * allowed registration keys for this Notification within a workspace.
137
+ * Specification is recommended to highlight connection between schema and
138
+ * factory when spread across modules.
139
+ *
140
+ * @alpha
141
+ * @sealed
142
+ */
143
+ export type NotificationsWithSubscriptionsConfiguration<TSubscriptions extends InternalUtilityTypes.NotificationListenersWithSubscriberSignatures<TSubscriptions>, RegistrationKeyRestrictions extends string = string> = InternalTypes.ManagerFactory<RegistrationKeyRestrictions, InternalTypes.ValueRequiredState<InternalTypes.NotificationType>, NotificationsManager<InternalUtilityTypes.NotificationListenersFromSubscriberSignatures<TSubscriptions>>>;
111
144
  //# sourceMappingURL=notificationsManagerTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notificationsManagerTypes.d.ts","sour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qBAAqB,CAAC,CAAC,CAAC,EACvD,2BAA2B,SAAS,MAAM,GAAG,MAAM,IAChD,aAAa,CAAC,cAAc,CAC/B,2BAA2B,EAC3B,aAAa,CAAC,kBAAkB,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAChE,oBAAoB,CAAC,CAAC,CAAC,CACvB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,2CAA2C,CACtD,cAAc,SACb,oBAAoB,CAAC,6CAA6C,CAAC,cAAc,CAAC,EACnF,2BAA2B,SAAS,MAAM,GAAG,MAAM,IAChD,aAAa,CAAC,cAAc,CAC/B,2BAA2B,EAC3B,aAAa,CAAC,kBAAkB,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAChE,oBAAoB,CACnB,oBAAoB,CAAC,6CAA6C,CAAC,cAAc,CAAC,CAClF,CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationsManagerTypes.js","sourceRoot":"","sources":["../src/notificationsManagerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable, Off } from \"@fluidframework/core-interfaces\";\n\nimport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\nimport type { Attendee, PresenceWithNotifications as Presence } from \"./presence.js\";\n\n/**\n * @sealed\n * @alpha\n */\nexport interface NotificationsManagerEvents {\n\t/**\n\t * Raised when notification is received, but no subscribers were found.\n\t *\n\t * @eventProperty\n\t */\n\tunattendedNotification: (name: string, sender: Attendee, ...content: unknown[]) => void;\n}\n\n/**\n * An object which allows the registration of listeners so that subscribers can be\n * notified when a notification happens.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationListenable<\n\tTListeners extends InternalUtilityTypes.NotificationListeners<TListeners>,\n> {\n\t/**\n\t * Register a notification listener.\n\t * @param notificationName - the name of the notification\n\t * @param listener - The listener function to run when the notification is fired.\n\t * @returns A {@link @fluidframework/core-interfaces#Off | function} which will deregister the listener when called.\n\t * Calling the deregistration function more than once will have no effect.\n\t *\n\t * Listeners may also be deregistered by passing the listener to {@link NotificationListenable.off | off()}.\n\t * @remarks Registering the exact same `listener` object for the same notification more than once will throw an error.\n\t * If registering the same listener for the same notification multiple times is desired, consider using a wrapper function for the second subscription.\n\t */\n\ton<K extends keyof InternalUtilityTypes.NotificationListeners<TListeners>>(\n\t\tnotificationName: K,\n\t\tlistener: (\n\t\t\tsender: Attendee,\n\t\t\t...args: InternalUtilityTypes.JsonDeserializedParameters<TListeners[K]>\n\t\t) => void,\n\t): Off;\n\n\t/**\n\t * Deregister notification listener.\n\t * @param notificationName - The name of the notification.\n\t * @param listener - The listener function to remove from the current set of notification listeners.\n\t * @remarks If `listener` is not currently registered, this method will have no effect.\n\t *\n\t * Listeners may also be deregistered by calling the {@link @fluidframework/core-interfaces#Off | deregistration function} returned when they are {@link NotificationListenable.on | registered}.\n\t */\n\toff<K extends keyof InternalUtilityTypes.NotificationListeners<TListeners>>(\n\t\tnotificationName: K,\n\t\tlistener: (\n\t\t\tsender: Attendee,\n\t\t\t...args: InternalUtilityTypes.JsonDeserializedParameters<TListeners[K]>\n\t\t) => void,\n\t): void;\n}\n\n/**\n * Record of notification subscription signatures transformed from listener emit signatures.\n *\n * @remarks\n * Prepends the `sender: Attendee` parameter to each notification listener signature.\n *\n * @sealed\n * @alpha\n */\nexport type NotificationSubscriberSignatures<\n\tE extends InternalUtilityTypes.NotificationListeners<E>,\n> = {\n\t[K in keyof InternalUtilityTypes.NotificationListeners<E>]: (\n\t\tsender: Attendee,\n\t\t...args: InternalUtilityTypes.JsonDeserializedParameters<E[K]>\n\t) => void;\n};\n\n/**\n * Interface for a notification emitter that can send typed notification to other clients.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationEmitter<E extends InternalUtilityTypes.NotificationListeners<E>> {\n\t/**\n\t * Emits a notification with the specified name and arguments, notifying all clients.\n\t * @param notificationName - the name of the notification to fire\n\t * @param args - the arguments sent with the notification\n\t */\n\tbroadcast<K extends keyof InternalUtilityTypes.NotificationListeners<E>>(\n\t\tnotificationName: K,\n\t\t...args: Parameters<E[K]>\n\t): void;\n\n\t/**\n\t * Emits a notification with the specified name and arguments, notifying a single attendee.\n\t * @param notificationName - the name of the notification to fire\n\t * @param targetAttendee - the single attendee to notify\n\t * @param args - the arguments sent with the notification\n\t */\n\tunicast<K extends keyof InternalUtilityTypes.NotificationListeners<E>>(\n\t\tnotificationName: K,\n\t\ttargetAttendee: Attendee,\n\t\t...args: Parameters<E[K]>\n\t): void;\n}\n\n/**\n * Provides notifications from this client to others and subscription\n * to their notifications.\n *\n * @remarks Create using {@link (Notifications:1)} registered to\n * {@link NotificationsWorkspace} or {@link StatesWorkspace}.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationsManager<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n> {\n\t/**\n\t * Containing {@link Presence}\n\t */\n\treadonly presence: Presence;\n\n\t/**\n\t * Events for Notifications manager.\n\t */\n\treadonly events: Listenable<NotificationsManagerEvents>;\n\n\t/**\n\t * Send notifications to other clients.\n\t */\n\treadonly emit: NotificationEmitter<T>;\n\n\t/**\n\t * Provides subscription to notifications from other clients.\n\t */\n\treadonly notifications: NotificationListenable<T>;\n}\n"]}
1
+ {"version":3,"file":"notificationsManagerTypes.js","sourceRoot":"","sources":["../src/notificationsManagerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable, Off } from \"@fluidframework/core-interfaces\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\nimport type { Attendee, PresenceWithNotifications as Presence } from \"./presence.js\";\n\n/**\n * @sealed\n * @alpha\n */\nexport interface NotificationsManagerEvents {\n\t/**\n\t * Raised when notification is received, but no subscribers were found.\n\t *\n\t * @eventProperty\n\t */\n\tunattendedNotification: (name: string, sender: Attendee, ...content: unknown[]) => void;\n}\n\n/**\n * An object which allows the registration of listeners so that subscribers can be\n * notified when a notification happens.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationListenable<\n\tTListeners extends InternalUtilityTypes.NotificationListeners<TListeners>,\n> {\n\t/**\n\t * Register a notification listener.\n\t * @param notificationName - the name of the notification\n\t * @param listener - The listener function to run when the notification is fired.\n\t * @returns A {@link @fluidframework/core-interfaces#Off | function} which will deregister the listener when called.\n\t * Calling the deregistration function more than once will have no effect.\n\t *\n\t * Listeners may also be deregistered by passing the listener to {@link NotificationListenable.off | off()}.\n\t * @remarks Registering the exact same `listener` object for the same notification more than once will throw an error.\n\t * If registering the same listener for the same notification multiple times is desired, consider using a wrapper function for the second subscription.\n\t */\n\ton<K extends keyof InternalUtilityTypes.NotificationListeners<TListeners>>(\n\t\tnotificationName: K,\n\t\tlistener: (\n\t\t\tsender: Attendee,\n\t\t\t...args: InternalUtilityTypes.JsonDeserializedParameters<TListeners[K]>\n\t\t) => void,\n\t): Off;\n\n\t/**\n\t * Deregister notification listener.\n\t * @param notificationName - The name of the notification.\n\t * @param listener - The listener function to remove from the current set of notification listeners.\n\t * @remarks If `listener` is not currently registered, this method will have no effect.\n\t *\n\t * Listeners may also be deregistered by calling the {@link @fluidframework/core-interfaces#Off | deregistration function} returned when they are {@link NotificationListenable.on | registered}.\n\t */\n\toff<K extends keyof InternalUtilityTypes.NotificationListeners<TListeners>>(\n\t\tnotificationName: K,\n\t\tlistener: (\n\t\t\tsender: Attendee,\n\t\t\t...args: InternalUtilityTypes.JsonDeserializedParameters<TListeners[K]>\n\t\t) => void,\n\t): void;\n}\n\n/**\n * Record of notification subscription signatures transformed from listener emit signatures.\n *\n * @remarks\n * Prepends the `sender: Attendee` parameter to each notification listener signature.\n *\n * @sealed\n * @alpha\n */\nexport type NotificationSubscriberSignatures<\n\tE extends InternalUtilityTypes.NotificationListeners<E>,\n> = {\n\t[K in keyof InternalUtilityTypes.NotificationListeners<E>]: (\n\t\tsender: Attendee,\n\t\t...args: InternalUtilityTypes.JsonDeserializedParameters<E[K]>\n\t) => void;\n};\n\n/**\n * Interface for a notification emitter that can send typed notification to other clients.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationEmitter<E extends InternalUtilityTypes.NotificationListeners<E>> {\n\t/**\n\t * Emits a notification with the specified name and arguments, notifying all clients.\n\t * @param notificationName - the name of the notification to fire\n\t * @param args - the arguments sent with the notification\n\t */\n\tbroadcast<K extends keyof InternalUtilityTypes.NotificationListeners<E>>(\n\t\tnotificationName: K,\n\t\t...args: Parameters<E[K]>\n\t): void;\n\n\t/**\n\t * Emits a notification with the specified name and arguments, notifying a single attendee.\n\t * @param notificationName - the name of the notification to fire\n\t * @param targetAttendee - the single attendee to notify\n\t * @param args - the arguments sent with the notification\n\t */\n\tunicast<K extends keyof InternalUtilityTypes.NotificationListeners<E>>(\n\t\tnotificationName: K,\n\t\ttargetAttendee: Attendee,\n\t\t...args: Parameters<E[K]>\n\t): void;\n}\n\n/**\n * Provides notifications from this client to others and subscription\n * to their notifications.\n *\n * @remarks Create using {@link (Notifications:1)} registered to\n * {@link NotificationsWorkspace} or {@link StatesWorkspace}.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationsManager<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n> {\n\t/**\n\t * Containing {@link Presence}\n\t */\n\treadonly presence: Presence;\n\n\t/**\n\t * Events for Notifications manager.\n\t */\n\treadonly events: Listenable<NotificationsManagerEvents>;\n\n\t/**\n\t * Send notifications to other clients.\n\t */\n\treadonly emit: NotificationEmitter<T>;\n\n\t/**\n\t * Provides subscription to notifications from other clients.\n\t */\n\treadonly notifications: NotificationListenable<T>;\n}\n\n/**\n * Type alias for the return type of {@link (Notifications:1)}.\n *\n * @remarks\n * Use this type instead of any InternalPresenceTypes that may be revealed from\n * examining factory return type.\n *\n * @typeparam RegistrationKeyRestrictions - Optional type parameter to constrain\n * allowed registration keys for this Notification within a workspace.\n * Specification is recommended to highlight connection between schema and\n * factory when spread across modules.\n *\n * @alpha\n * @sealed\n */\nexport type NotificationsConfiguration<\n\tT extends InternalUtilityTypes.NotificationListeners<T>,\n\tRegistrationKeyRestrictions extends string = string,\n> = InternalTypes.ManagerFactory<\n\tRegistrationKeyRestrictions,\n\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\tNotificationsManager<T>\n>;\n\n/**\n * Type alias for the return type of {@link (Notifications:2)}.\n *\n * @remarks\n * Use this type instead of any InternalPresenceTypes that may be revealed from\n * examining factory return type.\n *\n * @typeparam RegistrationKeyRestrictions - Optional type parameter to constrain\n * allowed registration keys for this Notification within a workspace.\n * Specification is recommended to highlight connection between schema and\n * factory when spread across modules.\n *\n * @alpha\n * @sealed\n */\nexport type NotificationsWithSubscriptionsConfiguration<\n\tTSubscriptions extends\n\t\tInternalUtilityTypes.NotificationListenersWithSubscriberSignatures<TSubscriptions>,\n\tRegistrationKeyRestrictions extends string = string,\n> = InternalTypes.ManagerFactory<\n\tRegistrationKeyRestrictions,\n\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\tNotificationsManager<\n\t\tInternalUtilityTypes.NotificationListenersFromSubscriberSignatures<TSubscriptions>\n\t>\n>;\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/presence";
8
- export declare const pkgVersion = "2.83.0";
8
+ export declare const pkgVersion = "2.90.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/presence";
8
- export const pkgVersion = "2.83.0";
8
+ export const pkgVersion = "2.90.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/presence\";\nexport const pkgVersion = \"2.83.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/presence\";\nexport const pkgVersion = \"2.90.0\";\n"]}
package/lib/presence.d.ts CHANGED
@@ -199,7 +199,7 @@ export interface Presence {
199
199
  * @param controls - Optional settings for default broadcast controls
200
200
  * @returns A {@link StatesWorkspace}
201
201
  */
202
- getWorkspace<StatesSchema extends StatesWorkspaceSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema>;
202
+ getWorkspace<StatesSchema extends Partial<StatesWorkspaceSchema<SchemaKeys>>, SchemaKeys extends string & keyof StatesSchema = string & keyof StatesSchema>(workspaceAddress: WorkspaceAddress, requestedStates: StatesSchema, controls?: BroadcastControlSettings): StatesWorkspace<StatesSchema, unknown, SchemaKeys>;
203
203
  };
204
204
  }
205
205
  /**
@@ -223,7 +223,7 @@ export interface PresenceWithNotifications extends Presence {
223
223
  * @param requestedNotifications - Requested notifications for the workspace
224
224
  * @returns A Notifications workspace
225
225
  */
226
- getWorkspace<NotificationsSchema extends NotificationsWorkspaceSchema>(notificationsId: WorkspaceAddress, requestedNotifications: NotificationsSchema): NotificationsWorkspace<NotificationsSchema>;
226
+ getWorkspace<NotificationsSchema extends Partial<NotificationsWorkspaceSchema<SchemaKeys>>, SchemaKeys extends string & keyof NotificationsSchema = string & keyof NotificationsSchema>(notificationsId: WorkspaceAddress, requestedNotifications: NotificationsSchema): NotificationsWorkspace<NotificationsSchema, SchemaKeys>;
227
227
  };
228
228
  }
229
229
  //# sourceMappingURL=presence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,KAAK,EACX,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAA;CAAE,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAC1B;;OAEG;;IAGH;;OAEG;;CAEM,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,QAAQ,CAAC,kBAA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AGG;IACH,QAAQ,CAAC,MAAM,EAAE;QAChB;;;;;;;WAOG;QACH,YAAY,CACX,YAAY,SAAS,OAAO,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,EAC/D,UAAU,SAAS,MAAM,GAAG,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,YAAY,EAE5E,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,YAAY,EAC7B,QAAQ,CAAC,EAAE,wBAAwB,GACjC,eAAe,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;KACtD,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,yBAA0B,SAAQ,QAAQ;IAC1D,QAAQ,CAAC,aAAa,EAAE;QACvB;;;;;;WAMG;QACH,YAAY,CACX,mBAAmB,SAAS,OAAO,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC,EAC7E,UAAU,SAAS,MAAM,GAAG,MAAM,mBAAmB,GAAG,MAAM,GAC7D,MAAM,mBAAmB,EAE1B,eAAe,EAAE,gBAAgB,EACjC,sBAAsB,EAAE,mBAAmB,GACzC,sBAAsB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;KAC3D,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"presence.js","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6BH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type { SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ClientConnectionId } from \"./baseTypes.js\";\nimport type { BroadcastControlSettings } from \"./broadcastControlsTypes.js\";\nimport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceSchema,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\n/**\n * A Fluid client session identifier.\n *\n * @remarks\n * Each client once connected to a session is given a unique identifier for the\n * duration of the session. If a client disconnects and reconnects, it will\n * retain its identifier. Prefer use of {@link Attendee} as a way to\n * identify clients in a session. {@link Attendee.attendeeId} will provide\n * the session ID.\n *\n * @beta\n */\nexport type AttendeeId = SessionId & { readonly AttendeeId: \"AttendeeId\" };\n\n/**\n * The connection status of the {@link Attendee}.\n *\n * @beta\n */\nexport const AttendeeStatus = {\n\t/**\n\t * The {@link Attendee} is connected to the Fluid service.\n\t */\n\tConnected: \"Connected\",\n\n\t/**\n\t * The {@link Attendee} is not connected to the Fluid service.\n\t */\n\tDisconnected: \"Disconnected\",\n} as const;\n\n/**\n * Represents the connection status of an {@link Attendee}.\n *\n * This type can be either `'Connected'` or `'Disconnected'`, indicating whether\n * the attendee is currently connected to the Fluid service.\n *\n * When `'Disconnected'`:\n * - State changes are kept locally and communicated to others upon reconnect.\n * - Notification requests are discarded (silently).\n *\n * @beta\n */\nexport type AttendeeStatus = (typeof AttendeeStatus)[keyof typeof AttendeeStatus];\n\n/**\n * A client within a Fluid session (period of container connectivity to service).\n *\n * @remarks\n * Note: This is very preliminary attendee representation.\n *\n * {@link Attendee} should be used as key to distinguish between different\n * clients as they join, rejoin, and disconnect from a session. While a\n * client's {@link ClientConnectionId} from {@link Attendee.getConnectionStatus}\n * may change over time, `Attendee` will be fixed.\n *\n * @privateRemarks\n * As this is evolved, pay attention to how this relates to Audience, Service\n * Audience, and Quorum representations of clients and users.\n *\n * @sealed\n * @beta\n */\nexport interface Attendee<SpecificAttendeeId extends AttendeeId = AttendeeId> {\n\t/**\n\t * The session ID of the client that is stable over all connections.\n\t */\n\treadonly attendeeId: SpecificAttendeeId;\n\n\t/**\n\t * Get current client connection ID.\n\t *\n\t * @returns Current client connection ID.\n\t *\n\t * @remarks\n\t * Connection ID will change on reconnect.\n\t *\n\t * If {@link Attendee.getConnectionStatus} is {@link (AttendeeStatus:variable).Disconnected}, this will represent the last known connection ID.\n\t */\n\tgetConnectionId(): ClientConnectionId;\n\n\t/**\n\t * Get connection status of attendee.\n\t *\n\t * @returns Connection status of attendee.\n\t *\n\t */\n\tgetConnectionStatus(): AttendeeStatus;\n}\n\n/**\n * Utility type limiting to a specific attendee. (A attendee with\n * a specific session ID - not just any session ID.)\n */\nexport type SpecificAttendee<SpecificAttendeeId extends AttendeeId> =\n\tstring extends SpecificAttendeeId ? never : Attendee<SpecificAttendeeId>;\n\n/**\n * Events from {@link Presence.attendees}.\n *\n * @sealed\n * @beta\n */\nexport interface AttendeesEvents {\n\t/**\n\t * Raised when new client joins session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeConnected: (attendee: Attendee) => void;\n\n\t/**\n\t * Raised when client appears disconnected from session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeDisconnected: (attendee: Attendee) => void;\n}\n\n/**\n * Events from {@link Presence}.\n *\n * @sealed\n * @beta\n */\nexport interface PresenceEvents {\n\t/**\n\t * Raised when a workspace is activated within the session.\n\t *\n\t * \"Activated\" means that a workspace is being used by a client and this\n\t * client is seeing information for the first time.\n\t *\n\t * @remarks\n\t * Local workspaces may be passively acquired/registered when this event\n\t * is raised. For a notifications workspace, that lazy registration must\n\t * be done before the event handler returns to ensure no notifications\n\t * are missed.\n\t */\n\tworkspaceActivated: (\n\t\tworkspaceAddress: WorkspaceAddress,\n\t\ttype: \"States\" | \"Notifications\" | \"Unknown\",\n\t) => void;\n}\n\n/**\n * Provides top-level access to Presence feature set including known\n * {@link Attendee}s within a session and their custom states kept\n * under {@link StatesWorkspace}s.\n *\n * @sealed\n * @beta\n */\nexport interface Presence {\n\t/**\n\t * Events for Presence.\n\t */\n\treadonly events: Listenable<PresenceEvents>;\n\n\t/**\n\t * Container-wide {@link Attendee} information and event provider.\n\t *\n\t * @remarks\n\t * This provides access to all {@link Attendee}s in the session, including\n\t * the current client. As {@link StatesWorkspace} aren't required to be\n\t * uniform across an application, some {@link Attendee}s may be enumerated\n\t * here while not being present in any particular {@link StatesWorkspace}.\n\t */\n\treadonly attendees: {\n\t\t/**\n\t\t * Events for {@link Attendee}s.\n\t\t */\n\t\treadonly events: Listenable<AttendeesEvents>;\n\n\t\t/**\n\t\t * Get all {@link Attendee}s in the session.\n\t\t *\n\t\t * @remarks\n\t\t * Attendee states are dynamic and will change as clients join and leave\n\t\t * the session.\n\t\t */\n\t\tgetAttendees(): ReadonlySet<Attendee>;\n\n\t\t/**\n\t\t * Lookup a specific {@link Attendee} in the session.\n\t\t *\n\t\t * @param clientId - Client connection or session ID\n\t\t */\n\t\tgetAttendee(clientId: ClientConnectionId | AttendeeId): Attendee;\n\n\t\t/**\n\t\t * Get this client's {@link Attendee}.\n\t\t *\n\t\t * @returns This client's attendee.\n\t\t */\n\t\tgetMyself(): Attendee;\n\t};\n\n\t/**\n\t * Provides access to {@link StatesWorkspace}s that allow clients to\n\t * manage custom states.\n\t */\n\treadonly states: {\n\t\t/**\n\t\t * Acquires a {@link StatesWorkspace} from store or adds new one.\n\t\t *\n\t\t * @param workspaceAddress - Address of the requested {@link StatesWorkspace}\n\t\t * @param requestedStates - Requested states for the workspace\n\t\t * @param controls - Optional settings for default broadcast controls\n\t\t * @returns A {@link StatesWorkspace}\n\t\t */\n\t\tgetWorkspace<StatesSchema extends StatesWorkspaceSchema>(\n\t\t\tworkspaceAddress: WorkspaceAddress,\n\t\t\trequestedStates: StatesSchema,\n\t\t\tcontrols?: BroadcastControlSettings,\n\t\t): StatesWorkspace<StatesSchema>;\n\t};\n}\n\n/**\n * Provides top-level access to Presence feature set including known\n * {@link Attendee}s within a session and their custom states and\n * notifications kept under {@link StatesWorkspace}s and\n * {@link NotificationsWorkspace}s.\n *\n * @remarks\n * To access this alpha API, cast any `{@link Presence}` to `PresenceWithNotifications`.\n *\n * @sealed\n * @alpha\n */\nexport interface PresenceWithNotifications extends Presence {\n\treadonly notifications: {\n\t\t/**\n\t\t * Acquires a Notifications workspace from store or adds new one.\n\t\t *\n\t\t * @param workspaceAddress - Address of the requested Notifications Workspace\n\t\t * @param requestedNotifications - Requested notifications for the workspace\n\t\t * @returns A Notifications workspace\n\t\t */\n\t\tgetWorkspace<NotificationsSchema extends NotificationsWorkspaceSchema>(\n\t\t\tnotificationsId: WorkspaceAddress,\n\t\t\trequestedNotifications: NotificationsSchema,\n\t\t): NotificationsWorkspace<NotificationsSchema>;\n\t};\n}\n"]}
1
+ {"version":3,"file":"presence.js","sourceRoot":"","sources":["../src/presence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6BH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport type { SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ClientConnectionId } from \"./baseTypes.js\";\nimport type { BroadcastControlSettings } from \"./broadcastControlsTypes.js\";\nimport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceSchema,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\n/**\n * A Fluid client session identifier.\n *\n * @remarks\n * Each client once connected to a session is given a unique identifier for the\n * duration of the session. If a client disconnects and reconnects, it will\n * retain its identifier. Prefer use of {@link Attendee} as a way to\n * identify clients in a session. {@link Attendee.attendeeId} will provide\n * the session ID.\n *\n * @beta\n */\nexport type AttendeeId = SessionId & { readonly AttendeeId: \"AttendeeId\" };\n\n/**\n * The connection status of the {@link Attendee}.\n *\n * @beta\n */\nexport const AttendeeStatus = {\n\t/**\n\t * The {@link Attendee} is connected to the Fluid service.\n\t */\n\tConnected: \"Connected\",\n\n\t/**\n\t * The {@link Attendee} is not connected to the Fluid service.\n\t */\n\tDisconnected: \"Disconnected\",\n} as const;\n\n/**\n * Represents the connection status of an {@link Attendee}.\n *\n * This type can be either `'Connected'` or `'Disconnected'`, indicating whether\n * the attendee is currently connected to the Fluid service.\n *\n * When `'Disconnected'`:\n * - State changes are kept locally and communicated to others upon reconnect.\n * - Notification requests are discarded (silently).\n *\n * @beta\n */\nexport type AttendeeStatus = (typeof AttendeeStatus)[keyof typeof AttendeeStatus];\n\n/**\n * A client within a Fluid session (period of container connectivity to service).\n *\n * @remarks\n * Note: This is very preliminary attendee representation.\n *\n * {@link Attendee} should be used as key to distinguish between different\n * clients as they join, rejoin, and disconnect from a session. While a\n * client's {@link ClientConnectionId} from {@link Attendee.getConnectionStatus}\n * may change over time, `Attendee` will be fixed.\n *\n * @privateRemarks\n * As this is evolved, pay attention to how this relates to Audience, Service\n * Audience, and Quorum representations of clients and users.\n *\n * @sealed\n * @beta\n */\nexport interface Attendee<SpecificAttendeeId extends AttendeeId = AttendeeId> {\n\t/**\n\t * The session ID of the client that is stable over all connections.\n\t */\n\treadonly attendeeId: SpecificAttendeeId;\n\n\t/**\n\t * Get current client connection ID.\n\t *\n\t * @returns Current client connection ID.\n\t *\n\t * @remarks\n\t * Connection ID will change on reconnect.\n\t *\n\t * If {@link Attendee.getConnectionStatus} is {@link (AttendeeStatus:variable).Disconnected}, this will represent the last known connection ID.\n\t */\n\tgetConnectionId(): ClientConnectionId;\n\n\t/**\n\t * Get connection status of attendee.\n\t *\n\t * @returns Connection status of attendee.\n\t *\n\t */\n\tgetConnectionStatus(): AttendeeStatus;\n}\n\n/**\n * Utility type limiting to a specific attendee. (A attendee with\n * a specific session ID - not just any session ID.)\n */\nexport type SpecificAttendee<SpecificAttendeeId extends AttendeeId> =\n\tstring extends SpecificAttendeeId ? never : Attendee<SpecificAttendeeId>;\n\n/**\n * Events from {@link Presence.attendees}.\n *\n * @sealed\n * @beta\n */\nexport interface AttendeesEvents {\n\t/**\n\t * Raised when new client joins session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeConnected: (attendee: Attendee) => void;\n\n\t/**\n\t * Raised when client appears disconnected from session.\n\t *\n\t * @eventProperty\n\t */\n\tattendeeDisconnected: (attendee: Attendee) => void;\n}\n\n/**\n * Events from {@link Presence}.\n *\n * @sealed\n * @beta\n */\nexport interface PresenceEvents {\n\t/**\n\t * Raised when a workspace is activated within the session.\n\t *\n\t * \"Activated\" means that a workspace is being used by a client and this\n\t * client is seeing information for the first time.\n\t *\n\t * @remarks\n\t * Local workspaces may be passively acquired/registered when this event\n\t * is raised. For a notifications workspace, that lazy registration must\n\t * be done before the event handler returns to ensure no notifications\n\t * are missed.\n\t */\n\tworkspaceActivated: (\n\t\tworkspaceAddress: WorkspaceAddress,\n\t\ttype: \"States\" | \"Notifications\" | \"Unknown\",\n\t) => void;\n}\n\n/**\n * Provides top-level access to Presence feature set including known\n * {@link Attendee}s within a session and their custom states kept\n * under {@link StatesWorkspace}s.\n *\n * @sealed\n * @beta\n */\nexport interface Presence {\n\t/**\n\t * Events for Presence.\n\t */\n\treadonly events: Listenable<PresenceEvents>;\n\n\t/**\n\t * Container-wide {@link Attendee} information and event provider.\n\t *\n\t * @remarks\n\t * This provides access to all {@link Attendee}s in the session, including\n\t * the current client. As {@link StatesWorkspace} aren't required to be\n\t * uniform across an application, some {@link Attendee}s may be enumerated\n\t * here while not being present in any particular {@link StatesWorkspace}.\n\t */\n\treadonly attendees: {\n\t\t/**\n\t\t * Events for {@link Attendee}s.\n\t\t */\n\t\treadonly events: Listenable<AttendeesEvents>;\n\n\t\t/**\n\t\t * Get all {@link Attendee}s in the session.\n\t\t *\n\t\t * @remarks\n\t\t * Attendee states are dynamic and will change as clients join and leave\n\t\t * the session.\n\t\t */\n\t\tgetAttendees(): ReadonlySet<Attendee>;\n\n\t\t/**\n\t\t * Lookup a specific {@link Attendee} in the session.\n\t\t *\n\t\t * @param clientId - Client connection or session ID\n\t\t */\n\t\tgetAttendee(clientId: ClientConnectionId | AttendeeId): Attendee;\n\n\t\t/**\n\t\t * Get this client's {@link Attendee}.\n\t\t *\n\t\t * @returns This client's attendee.\n\t\t */\n\t\tgetMyself(): Attendee;\n\t};\n\n\t/**\n\t * Provides access to {@link StatesWorkspace}s that allow clients to\n\t * manage custom states.\n\t */\n\treadonly states: {\n\t\t/**\n\t\t * Acquires a {@link StatesWorkspace} from store or adds new one.\n\t\t *\n\t\t * @param workspaceAddress - Address of the requested {@link StatesWorkspace}\n\t\t * @param requestedStates - Requested states for the workspace\n\t\t * @param controls - Optional settings for default broadcast controls\n\t\t * @returns A {@link StatesWorkspace}\n\t\t */\n\t\tgetWorkspace<\n\t\t\tStatesSchema extends Partial<StatesWorkspaceSchema<SchemaKeys>>,\n\t\t\tSchemaKeys extends string & keyof StatesSchema = string & keyof StatesSchema,\n\t\t>(\n\t\t\tworkspaceAddress: WorkspaceAddress,\n\t\t\trequestedStates: StatesSchema,\n\t\t\tcontrols?: BroadcastControlSettings,\n\t\t): StatesWorkspace<StatesSchema, unknown, SchemaKeys>;\n\t};\n}\n\n/**\n * Provides top-level access to Presence feature set including known\n * {@link Attendee}s within a session and their custom states and\n * notifications kept under {@link StatesWorkspace}s and\n * {@link NotificationsWorkspace}s.\n *\n * @remarks\n * To access this alpha API, cast any `{@link Presence}` to `PresenceWithNotifications`.\n *\n * @sealed\n * @alpha\n */\nexport interface PresenceWithNotifications extends Presence {\n\treadonly notifications: {\n\t\t/**\n\t\t * Acquires a Notifications workspace from store or adds new one.\n\t\t *\n\t\t * @param workspaceAddress - Address of the requested Notifications Workspace\n\t\t * @param requestedNotifications - Requested notifications for the workspace\n\t\t * @returns A Notifications workspace\n\t\t */\n\t\tgetWorkspace<\n\t\t\tNotificationsSchema extends Partial<NotificationsWorkspaceSchema<SchemaKeys>>,\n\t\t\tSchemaKeys extends string & keyof NotificationsSchema = string &\n\t\t\t\tkeyof NotificationsSchema,\n\t\t>(\n\t\t\tnotificationsId: WorkspaceAddress,\n\t\t\trequestedNotifications: NotificationsSchema,\n\t\t): NotificationsWorkspace<NotificationsSchema, SchemaKeys>;\n\t};\n}\n"]}
@@ -23,8 +23,8 @@ interface AnyWorkspaceEntry<TSchema extends StatesWorkspaceSchema> {
23
23
  export interface PresenceDatastoreManager {
24
24
  joinSession(clientId: ClientConnectionId, alternateProvider: ClientConnectionId | undefined): void;
25
25
  onDisconnected(): void;
26
- getWorkspace<TSchema extends StatesWorkspaceSchema>(internalWorkspaceAddress: `s:${WorkspaceAddress}`, requestedContent: TSchema, controls?: BroadcastControlSettings): StatesWorkspace<TSchema>;
27
- getWorkspace<TSchema extends NotificationsWorkspaceSchema>(internalWorkspaceAddress: `n:${WorkspaceAddress}`, requestedContent: TSchema): NotificationsWorkspace<TSchema>;
26
+ getWorkspace<TSchema extends Partial<StatesWorkspaceSchema<TSchemaKeys>>, TSchemaKeys extends string & keyof TSchema>(internalWorkspaceAddress: `s:${WorkspaceAddress}`, requestedContent: TSchema, controls?: BroadcastControlSettings): StatesWorkspace<TSchema, unknown, TSchemaKeys>;
27
+ getWorkspace<TSchema extends Partial<NotificationsWorkspaceSchema<TSchemaKeys>>, TSchemaKeys extends string & keyof TSchema>(internalWorkspaceAddress: `n:${WorkspaceAddress}`, requestedContent: TSchema): NotificationsWorkspace<TSchema, TSchemaKeys>;
28
28
  processSignal(message: InboundExtensionMessage<SignalMessages> & {
29
29
  clientId: ClientConnectionId;
30
30
  }, local: boolean, optional: boolean): void;
@@ -1 +1 @@
1
- {"version":3,"file":"presenceDatastoreManager.d.ts","sourceRoot":"","sources":["../src/presenceDatastoreManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,K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