@fluidframework/presence 2.32.0 → 2.33.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 (153) hide show
  1. package/README.md +24 -24
  2. package/dist/alpha.d.ts +29 -25
  3. package/dist/baseTypes.d.ts +3 -3
  4. package/dist/baseTypes.js.map +1 -1
  5. package/dist/broadcastControls.d.ts +1 -1
  6. package/dist/broadcastControls.js.map +1 -1
  7. package/dist/datastorePresenceManagerFactory.d.ts +5 -5
  8. package/dist/datastorePresenceManagerFactory.d.ts.map +1 -1
  9. package/dist/datastorePresenceManagerFactory.js +6 -6
  10. package/dist/datastorePresenceManagerFactory.js.map +1 -1
  11. package/dist/experimentalAccess.d.ts +4 -4
  12. package/dist/experimentalAccess.d.ts.map +1 -1
  13. package/dist/experimentalAccess.js +6 -6
  14. package/dist/experimentalAccess.js.map +1 -1
  15. package/dist/exposedInternalTypes.d.ts +1 -1
  16. package/dist/exposedInternalTypes.js.map +1 -1
  17. package/dist/exposedUtilityTypes.d.ts +0 -8
  18. package/dist/exposedUtilityTypes.d.ts.map +1 -1
  19. package/dist/exposedUtilityTypes.js.map +1 -1
  20. package/dist/index.d.ts +8 -7
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +6 -8
  23. package/dist/index.js.map +1 -1
  24. package/dist/internalTypes.d.ts +3 -3
  25. package/dist/internalTypes.d.ts.map +1 -1
  26. package/dist/internalTypes.js.map +1 -1
  27. package/dist/internalUtils.d.ts +5 -0
  28. package/dist/internalUtils.d.ts.map +1 -1
  29. package/dist/internalUtils.js +8 -1
  30. package/dist/internalUtils.js.map +1 -1
  31. package/dist/latestMapValueManager.d.ts +57 -39
  32. package/dist/latestMapValueManager.d.ts.map +1 -1
  33. package/dist/latestMapValueManager.js +48 -39
  34. package/dist/latestMapValueManager.js.map +1 -1
  35. package/dist/latestValueManager.d.ts +38 -20
  36. package/dist/latestValueManager.d.ts.map +1 -1
  37. package/dist/latestValueManager.js +32 -28
  38. package/dist/latestValueManager.js.map +1 -1
  39. package/dist/latestValueTypes.d.ts +9 -10
  40. package/dist/latestValueTypes.d.ts.map +1 -1
  41. package/dist/latestValueTypes.js.map +1 -1
  42. package/dist/notificationsManager.d.ts +15 -10
  43. package/dist/notificationsManager.d.ts.map +1 -1
  44. package/dist/notificationsManager.js +8 -5
  45. package/dist/notificationsManager.js.map +1 -1
  46. package/dist/presence.d.ts +82 -66
  47. package/dist/presence.d.ts.map +1 -1
  48. package/dist/presence.js +5 -5
  49. package/dist/presence.js.map +1 -1
  50. package/dist/presenceDatastoreManager.d.ts +12 -10
  51. package/dist/presenceDatastoreManager.d.ts.map +1 -1
  52. package/dist/presenceDatastoreManager.js +10 -8
  53. package/dist/presenceDatastoreManager.js.map +1 -1
  54. package/dist/presenceManager.d.ts +2 -2
  55. package/dist/presenceManager.d.ts.map +1 -1
  56. package/dist/presenceManager.js +14 -22
  57. package/dist/presenceManager.js.map +1 -1
  58. package/dist/presenceStates.d.ts +14 -13
  59. package/dist/presenceStates.d.ts.map +1 -1
  60. package/dist/presenceStates.js +22 -15
  61. package/dist/presenceStates.js.map +1 -1
  62. package/dist/stateDatastore.d.ts +5 -4
  63. package/dist/stateDatastore.d.ts.map +1 -1
  64. package/dist/stateDatastore.js.map +1 -1
  65. package/dist/stateFactory.d.ts +22 -0
  66. package/dist/stateFactory.d.ts.map +1 -0
  67. package/dist/stateFactory.js +25 -0
  68. package/dist/stateFactory.js.map +1 -0
  69. package/dist/systemWorkspace.d.ts +7 -7
  70. package/dist/systemWorkspace.d.ts.map +1 -1
  71. package/dist/systemWorkspace.js +23 -23
  72. package/dist/systemWorkspace.js.map +1 -1
  73. package/dist/types.d.ts +50 -33
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js +0 -1
  76. package/dist/types.js.map +1 -1
  77. package/lib/alpha.d.ts +29 -25
  78. package/lib/baseTypes.d.ts +3 -3
  79. package/lib/baseTypes.js.map +1 -1
  80. package/lib/broadcastControls.d.ts +1 -1
  81. package/lib/broadcastControls.js.map +1 -1
  82. package/lib/datastorePresenceManagerFactory.d.ts +5 -5
  83. package/lib/datastorePresenceManagerFactory.d.ts.map +1 -1
  84. package/lib/datastorePresenceManagerFactory.js +4 -4
  85. package/lib/datastorePresenceManagerFactory.js.map +1 -1
  86. package/lib/experimentalAccess.d.ts +4 -4
  87. package/lib/experimentalAccess.d.ts.map +1 -1
  88. package/lib/experimentalAccess.js +4 -4
  89. package/lib/experimentalAccess.js.map +1 -1
  90. package/lib/exposedInternalTypes.d.ts +1 -1
  91. package/lib/exposedInternalTypes.js.map +1 -1
  92. package/lib/exposedUtilityTypes.d.ts +0 -8
  93. package/lib/exposedUtilityTypes.d.ts.map +1 -1
  94. package/lib/exposedUtilityTypes.js.map +1 -1
  95. package/lib/index.d.ts +8 -7
  96. package/lib/index.d.ts.map +1 -1
  97. package/lib/index.js +4 -5
  98. package/lib/index.js.map +1 -1
  99. package/lib/internalTypes.d.ts +3 -3
  100. package/lib/internalTypes.d.ts.map +1 -1
  101. package/lib/internalTypes.js.map +1 -1
  102. package/lib/internalUtils.d.ts +5 -0
  103. package/lib/internalUtils.d.ts.map +1 -1
  104. package/lib/internalUtils.js +6 -0
  105. package/lib/internalUtils.js.map +1 -1
  106. package/lib/latestMapValueManager.d.ts +57 -39
  107. package/lib/latestMapValueManager.d.ts.map +1 -1
  108. package/lib/latestMapValueManager.js +47 -38
  109. package/lib/latestMapValueManager.js.map +1 -1
  110. package/lib/latestValueManager.d.ts +38 -20
  111. package/lib/latestValueManager.d.ts.map +1 -1
  112. package/lib/latestValueManager.js +31 -27
  113. package/lib/latestValueManager.js.map +1 -1
  114. package/lib/latestValueTypes.d.ts +9 -10
  115. package/lib/latestValueTypes.d.ts.map +1 -1
  116. package/lib/latestValueTypes.js.map +1 -1
  117. package/lib/notificationsManager.d.ts +15 -10
  118. package/lib/notificationsManager.d.ts.map +1 -1
  119. package/lib/notificationsManager.js +8 -5
  120. package/lib/notificationsManager.js.map +1 -1
  121. package/lib/presence.d.ts +82 -66
  122. package/lib/presence.d.ts.map +1 -1
  123. package/lib/presence.js +4 -4
  124. package/lib/presence.js.map +1 -1
  125. package/lib/presenceDatastoreManager.d.ts +12 -10
  126. package/lib/presenceDatastoreManager.d.ts.map +1 -1
  127. package/lib/presenceDatastoreManager.js +10 -8
  128. package/lib/presenceDatastoreManager.js.map +1 -1
  129. package/lib/presenceManager.d.ts +2 -2
  130. package/lib/presenceManager.d.ts.map +1 -1
  131. package/lib/presenceManager.js +14 -22
  132. package/lib/presenceManager.js.map +1 -1
  133. package/lib/presenceStates.d.ts +14 -13
  134. package/lib/presenceStates.d.ts.map +1 -1
  135. package/lib/presenceStates.js +22 -15
  136. package/lib/presenceStates.js.map +1 -1
  137. package/lib/stateDatastore.d.ts +5 -4
  138. package/lib/stateDatastore.d.ts.map +1 -1
  139. package/lib/stateDatastore.js.map +1 -1
  140. package/lib/stateFactory.d.ts +22 -0
  141. package/lib/stateFactory.d.ts.map +1 -0
  142. package/lib/stateFactory.js +22 -0
  143. package/lib/stateFactory.js.map +1 -0
  144. package/lib/systemWorkspace.d.ts +7 -7
  145. package/lib/systemWorkspace.d.ts.map +1 -1
  146. package/lib/systemWorkspace.js +24 -24
  147. package/lib/systemWorkspace.js.map +1 -1
  148. package/lib/tsdoc-metadata.json +1 -1
  149. package/lib/types.d.ts +50 -33
  150. package/lib/types.d.ts.map +1 -1
  151. package/lib/types.js +0 -1
  152. package/lib/types.js.map +1 -1
  153. package/package.json +19 -19
package/lib/alpha.d.ts CHANGED
@@ -18,44 +18,48 @@
18
18
 
19
19
  export {
20
20
  // @alpha APIs
21
+ Attendee,
22
+ AttendeeId,
23
+ AttendeeStatus,
24
+ AttendeesEvents,
21
25
  BroadcastControlSettings,
22
26
  BroadcastControls,
23
27
  ClientConnectionId,
24
- ClientSessionId,
25
28
  ExperimentalPresenceDO,
26
29
  ExperimentalPresenceManager,
27
- IPresence,
28
- ISessionClient,
29
30
  InternalTypes,
30
31
  InternalUtilityTypes,
31
- Latest,
32
- LatestMap,
32
+ LatestArguments,
33
+ LatestClientData,
34
+ LatestData,
35
+ LatestMapArguments,
36
+ LatestMapClientData,
33
37
  LatestMapItemRemovedClientData,
34
- LatestMapItemValueClientData,
35
- LatestMapValueClientData,
36
- LatestMapValueManager,
37
- LatestMapValueManagerEvents,
38
- LatestValueClientData,
39
- LatestValueData,
40
- LatestValueManager,
41
- LatestValueManagerEvents,
42
- LatestValueMetadata,
38
+ LatestMapItemUpdatedClientData,
39
+ LatestMapRaw,
40
+ LatestMapRawEvents,
41
+ LatestMetadata,
42
+ LatestRaw,
43
+ LatestRawEvents,
43
44
  NotificationEmitter,
44
45
  NotificationListenable,
45
46
  NotificationSubscriptions,
46
47
  Notifications,
47
48
  NotificationsManager,
48
49
  NotificationsManagerEvents,
50
+ NotificationsWorkspace,
51
+ NotificationsWorkspaceSchema,
52
+ Presence,
49
53
  PresenceEvents,
50
- PresenceNotifications,
51
- PresenceNotificationsSchema,
52
- PresenceStates,
53
- PresenceStatesEntries,
54
- PresenceStatesSchema,
55
- PresenceWorkspaceAddress,
56
- PresenceWorkspaceEntry,
57
- SessionClientStatus,
58
- ValueMap,
59
- acquirePresence,
60
- acquirePresenceViaDataObject
54
+ StateFactory,
55
+ StateMap,
56
+ StatesWorkspace,
57
+ StatesWorkspaceEntries,
58
+ StatesWorkspaceEntry,
59
+ StatesWorkspaceSchema,
60
+ WorkspaceAddress,
61
+ getPresence,
62
+ getPresenceViaDataObject,
63
+ latest,
64
+ latestMap
61
65
  } from "./index.js";
@@ -8,9 +8,9 @@
8
8
  * @remarks
9
9
  * Each client connection is given a unique identifier for the duration of the
10
10
  * connection. If a client disconnects and reconnects, it will be given a new
11
- * identifier. Prefer use of {@link ISessionClient} as a way to identify clients
12
- * in a session. {@link ISessionClient.getConnectionId} will provide the current
13
- * connection identifier for a logical session client.
11
+ * identifier. Prefer use of {@link Attendee} as a way to identify clients
12
+ * in a session. {@link Attendee.getConnectionId} will provide the current
13
+ * connection identifier for a logical attendee.
14
14
  *
15
15
  * @privateRemarks
16
16
  * This represents what is commonly `clientId` in Fluid code. Ideally this is
@@ -1 +1 @@
1
- {"version":3,"file":"baseTypes.js","sourceRoot":"","sources":["../src/baseTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A Fluid client connection identifier.\n *\n * @remarks\n * Each client connection is given a unique identifier for the duration of the\n * connection. If a client disconnects and reconnects, it will be given a new\n * identifier. Prefer use of {@link ISessionClient} as a way to identify clients\n * in a session. {@link ISessionClient.getConnectionId} will provide the current\n * connection identifier for a logical session client.\n *\n * @privateRemarks\n * This represents what is commonly `clientId` in Fluid code. Ideally this is\n * moved somewhere more central and we brand it to avoid confusion with other\n * strings. Branding broadly is likely a breaking change and may take decent\n * effort to manage.\n *\n * @alpha\n */\nexport type ClientConnectionId = string;\n"]}
1
+ {"version":3,"file":"baseTypes.js","sourceRoot":"","sources":["../src/baseTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A Fluid client connection identifier.\n *\n * @remarks\n * Each client connection is given a unique identifier for the duration of the\n * connection. If a client disconnects and reconnects, it will be given a new\n * identifier. Prefer use of {@link Attendee} as a way to identify clients\n * in a session. {@link Attendee.getConnectionId} will provide the current\n * connection identifier for a logical attendee.\n *\n * @privateRemarks\n * This represents what is commonly `clientId` in Fluid code. Ideally this is\n * moved somewhere more central and we brand it to avoid confusion with other\n * strings. Branding broadly is likely a breaking change and may take decent\n * effort to manage.\n *\n * @alpha\n */\nexport type ClientConnectionId = string;\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * Common controls for Value Managers.
6
+ * Common controls for States objects.
7
7
  *
8
8
  * @sealed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CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Common controls for Value Managers.\n *\n * @sealed\n * @alpha\n */\nexport interface BroadcastControls {\n\t/**\n\t * Maximum time in milliseconds that a local value update is allowed\n\t * to remain pending before it must be broadcast.\n\t *\n\t * @remarks\n\t * There is no guarantee of broadcast within time allowed\n\t * as other conditions such as disconnect or service throttling may\n\t * cause a delay.\n\t *\n\t * Setting to `undefined` will restore to a system default.\n\t */\n\tallowableUpdateLatencyMs: number | undefined;\n\n\t/**\n\t * Target time in milliseconds between oldest changed local state\n\t * has been broadcast and forced rebroadcast of all local values.\n\t * A value of less than 10 disables forced refresh.\n\t *\n\t * @privateRemarks\n\t * Any time less than 10 milliseconds is likely to generate too\n\t * many signals. Ideally this feature becomes obsolete as\n\t * we understand the system better and account for holes.\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// forcedRefreshIntervalMs: number | undefined;\n}\n\n/**\n * Value set to configure {@link BroadcastControls}.\n *\n * @alpha\n */\nexport interface BroadcastControlSettings {\n\t/**\n\t * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}\n\t *\n\t * @defaultValue 60 [milliseconds]\n\t */\n\treadonly allowableUpdateLatencyMs?: number;\n\n\t/**\n\t * {@inheritdoc BroadcastControls.forcedRefreshIntervalMs}\n\t *\n\t * @defaultValue 0 (disabled)\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// readonly forcedRefreshIntervalMs?: number;\n}\n\nclass ForcedRefreshControl\n\timplements\n\t\tPick<\n\t\t\tBroadcastControls & { forcedRefreshIntervalMs: number | undefined },\n\t\t\t\"forcedRefreshIntervalMs\"\n\t\t>\n{\n\tprivate _forcedRefreshInterval: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\t// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;\n\t}\n\n\tpublic get forcedRefreshIntervalMs(): number | undefined {\n\t\treturn this._forcedRefreshInterval;\n\t}\n\tpublic set forcedRefreshIntervalMs(value: number | undefined) {\n\t\tif (value === undefined) {\n\t\t\tthis._forcedRefreshInterval = undefined;\n\t\t} else {\n\t\t\tthis._forcedRefreshInterval = value >= 10 ? value : undefined;\n\t\t\tif (value >= 10) {\n\t\t\t\t// TODO: enable periodic forced refresh\n\t\t\t\tthrow new Error(\"Forced Refresh feature is not implemented\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @internal\n */\nexport class OptionalBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tpublic allowableUpdateLatencyMs: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\tsuper(settings);\n\t\tthis.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} but always provides defined value for\n * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.\n *\n * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}\n * is set to `undefined`, the default will be restored.\n *\n * @internal\n */\nexport class RequiredBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tprivate _allowableUpdateLatencyMs: number;\n\n\tpublic constructor(private readonly defaultAllowableUpdateLatencyMs: number) {\n\t\tsuper();\n\t\tthis._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;\n\t}\n\n\tpublic get allowableUpdateLatencyMs(): number {\n\t\treturn this._allowableUpdateLatencyMs;\n\t}\n\tpublic set allowableUpdateLatencyMs(value: number | undefined) {\n\t\tthis._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;\n\t}\n}\n"]}
1
+ {"version":3,"file":"broadcastControls.js","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0DH,MAAM,oBAAoB;IASzB,YAAmB,QAAmC;QACrD,mEAAmE;IACpE,CAAC;IAED,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IACD,IAAW,uBAAuB,CAAC,KAAyB;QAC3D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;QACzC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,sBAAsB,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YAC9D,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;gBACjB,uCAAuC;gBACvC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC9D,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,wBACZ,SAAQ,oBAAoB;IAK5B,YAAmB,QAAmC;QACrD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,wBAAwB,GAAG,QAAQ,EAAE,wBAAwB,CAAC;IACpE,CAAC;CACD;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,wBACZ,SAAQ,oBAAoB;IAK5B,YAAoC,+BAAuC;QAC1E,KAAK,EAAE,CAAC;QAD2B,oCAA+B,GAA/B,+BAA+B,CAAQ;QAE1E,IAAI,CAAC,yBAAyB,GAAG,+BAA+B,CAAC;IAClE,CAAC;IAED,IAAW,wBAAwB;QAClC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACvC,CAAC;IACD,IAAW,wBAAwB,CAAC,KAAyB;QAC5D,IAAI,CAAC,yBAAyB,GAAG,KAAK,IAAI,IAAI,CAAC,+BAA+B,CAAC;IAChF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Common controls for States objects.\n *\n * @sealed\n * @alpha\n */\nexport interface BroadcastControls {\n\t/**\n\t * Maximum time in milliseconds that a local value update is allowed\n\t * to remain pending before it must be broadcast.\n\t *\n\t * @remarks\n\t * There is no guarantee of broadcast within time allowed\n\t * as other conditions such as disconnect or service throttling may\n\t * cause a delay.\n\t *\n\t * Setting to `undefined` will restore to a system default.\n\t */\n\tallowableUpdateLatencyMs: number | undefined;\n\n\t/**\n\t * Target time in milliseconds between oldest changed local state\n\t * has been broadcast and forced rebroadcast of all local values.\n\t * A value of less than 10 disables forced refresh.\n\t *\n\t * @privateRemarks\n\t * Any time less than 10 milliseconds is likely to generate too\n\t * many signals. Ideally this feature becomes obsolete as\n\t * we understand the system better and account for holes.\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// forcedRefreshIntervalMs: number | undefined;\n}\n\n/**\n * Value set to configure {@link BroadcastControls}.\n *\n * @alpha\n */\nexport interface BroadcastControlSettings {\n\t/**\n\t * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}\n\t *\n\t * @defaultValue 60 [milliseconds]\n\t */\n\treadonly allowableUpdateLatencyMs?: number;\n\n\t/**\n\t * {@inheritdoc BroadcastControls.forcedRefreshIntervalMs}\n\t *\n\t * @defaultValue 0 (disabled)\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// readonly forcedRefreshIntervalMs?: number;\n}\n\nclass ForcedRefreshControl\n\timplements\n\t\tPick<\n\t\t\tBroadcastControls & { forcedRefreshIntervalMs: number | undefined },\n\t\t\t\"forcedRefreshIntervalMs\"\n\t\t>\n{\n\tprivate _forcedRefreshInterval: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\t// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;\n\t}\n\n\tpublic get forcedRefreshIntervalMs(): number | undefined {\n\t\treturn this._forcedRefreshInterval;\n\t}\n\tpublic set forcedRefreshIntervalMs(value: number | undefined) {\n\t\tif (value === undefined) {\n\t\t\tthis._forcedRefreshInterval = undefined;\n\t\t} else {\n\t\t\tthis._forcedRefreshInterval = value >= 10 ? value : undefined;\n\t\t\tif (value >= 10) {\n\t\t\t\t// TODO: enable periodic forced refresh\n\t\t\t\tthrow new Error(\"Forced Refresh feature is not implemented\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @internal\n */\nexport class OptionalBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tpublic allowableUpdateLatencyMs: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\tsuper(settings);\n\t\tthis.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} but always provides defined value for\n * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.\n *\n * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}\n * is set to `undefined`, the default will be restored.\n *\n * @internal\n */\nexport class RequiredBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tprivate _allowableUpdateLatencyMs: number;\n\n\tpublic constructor(private readonly defaultAllowableUpdateLatencyMs: number) {\n\t\tsuper();\n\t\tthis._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;\n\t}\n\n\tpublic get allowableUpdateLatencyMs(): number {\n\t\treturn this._allowableUpdateLatencyMs;\n\t}\n\tpublic set allowableUpdateLatencyMs(value: number | undefined) {\n\t\tthis._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;\n\t}\n}\n"]}
@@ -4,12 +4,12 @@
4
4
  */
5
5
  import type { IFluidLoadable } from "@fluidframework/core-interfaces";
6
6
  import type { SharedObjectKind } from "@fluidframework/shared-object-base";
7
- import type { IPresence } from "./presence.js";
7
+ import type { Presence } from "./presence.js";
8
8
  /**
9
9
  * Brand for Experimental Presence Data Object.
10
10
  *
11
11
  * @remarks
12
- * See {@link acquirePresenceViaDataObject} for example usage.
12
+ * See {@link getPresenceViaDataObject} for example usage.
13
13
  *
14
14
  * @sealed
15
15
  * @alpha
@@ -25,7 +25,7 @@ export declare class ExperimentalPresenceDO {
25
25
  */
26
26
  export declare const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadable & ExperimentalPresenceDO>;
27
27
  /**
28
- * Acquire IPresence from a DataStore based Presence Manager
28
+ * Acquire Presence from a DataStore based Presence Manager
29
29
  *
30
30
  * @example
31
31
  * ```typescript
@@ -37,12 +37,12 @@ export declare const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadabl
37
37
  * ```
38
38
  * then
39
39
  * ```typescript
40
- * const presence = acquirePresenceViaDataObject(
40
+ * const presence = getPresenceViaDataObject(
41
41
  * container.initialObjects.experimentalPresence,
42
42
  * );
43
43
  * ```
44
44
  *
45
45
  * @alpha
46
46
  */
47
- export declare function acquirePresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): IPresence;
47
+ export declare function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence;
48
48
  //# sourceMappingURL=datastorePresenceManagerFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"datastorePresenceManagerFactory.d.ts","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAkD/C;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;CAC/C;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,2DAGtC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC3C,aAAa,EAAE,sBAAsB,GACnC,SAAS,CAMX"}
1
+ {"version":3,"file":"datastorePresenceManagerFactory.d.ts","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAkD9C;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;CAC/C;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,2DAGtC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,sBAAsB,GAAG,QAAQ,CAMxF"}
@@ -29,7 +29,7 @@ class PresenceManagerDataObject extends LoadableFluidObject {
29
29
  }
30
30
  }
31
31
  /**
32
- * Factory class to create {@link IPresence} in own data store.
32
+ * Factory class to create {@link Presence} in own data store.
33
33
  */
34
34
  class PresenceManagerFactory {
35
35
  constructor() {
@@ -47,7 +47,7 @@ class PresenceManagerFactory {
47
47
  */
48
48
  export const ExperimentalPresenceManager = new PresenceManagerFactory();
49
49
  /**
50
- * Acquire IPresence from a DataStore based Presence Manager
50
+ * Acquire Presence from a DataStore based Presence Manager
51
51
  *
52
52
  * @example
53
53
  * ```typescript
@@ -59,14 +59,14 @@ export const ExperimentalPresenceManager = new PresenceManagerFactory();
59
59
  * ```
60
60
  * then
61
61
  * ```typescript
62
- * const presence = acquirePresenceViaDataObject(
62
+ * const presence = getPresenceViaDataObject(
63
63
  * container.initialObjects.experimentalPresence,
64
64
  * );
65
65
  * ```
66
66
  *
67
67
  * @alpha
68
68
  */
69
- export function acquirePresenceViaDataObject(fluidLoadable) {
69
+ export function getPresenceViaDataObject(fluidLoadable) {
70
70
  if (fluidLoadable instanceof PresenceManagerDataObject) {
71
71
  return fluidLoadable.presenceManager();
72
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"datastorePresenceManagerFactory.js","s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sB,EAEzB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,4BAA4B,CAC3C,aAAqC;IAErC,IAAI,aAAa,YAAY,yBAAyB,EAAE,CAAC;QACxD,OAAO,aAAa,CAAC,eAAe,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACxF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/*\n * Hacky support for internal datastore based usages.\n */\n\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IInboundSignalMessage } from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\n\nimport { BasicDataStoreFactory, LoadableFluidObject } from \"./datastoreSupport.js\";\nimport type { IPresence } from \"./presence.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\n\nimport type { IExtensionMessage } from \"@fluidframework/presence/internal/container-definitions/internal\";\n\nfunction assertSignalMessageIsValid(\n\tmessage: IInboundSignalMessage | IExtensionMessage,\n): asserts message is IExtensionMessage {\n\tassert(message.clientId !== null, 0xa58 /* Signal must have a client ID */);\n\t// The other difference between messages is that `content` for\n\t// IExtensionMessage is JsonDeserialized and we are fine assuming that.\n}\n\n/**\n * Simple FluidObject holding Presence Manager.\n */\nclass PresenceManagerDataObject extends LoadableFluidObject {\n\t// Creation of presence manager is deferred until first acquisition to avoid\n\t// instantiations and stand-up by Summarizer that has no actual use.\n\tprivate _presenceManager: IPresence | undefined;\n\n\tpublic presenceManager(): IPresence {\n\t\tif (!this._presenceManager) {\n\t\t\t// TODO: investigate if ContainerExtensionStore (path-based address routing for\n\t\t\t// Signals) is readily detectable here and use that presence manager directly.\n\t\t\tconst manager = createPresenceManager(this.runtime);\n\t\t\tthis.runtime.on(\"signal\", (message: IInboundSignalMessage, local: boolean) => {\n\t\t\t\tassertSignalMessageIsValid(message);\n\t\t\t\tmanager.processSignal(\"\", message, local);\n\t\t\t});\n\t\t\tthis._presenceManager = manager;\n\t\t}\n\t\treturn this._presenceManager;\n\t}\n}\n\n/**\n * Factory class to create {@link IPresence} in own data store.\n */\nclass PresenceManagerFactory {\n\tpublic is(value: IFluidLoadable | ExperimentalPresenceDO): value is ExperimentalPresenceDO {\n\t\treturn value instanceof PresenceManagerDataObject;\n\t}\n\n\tpublic readonly factory = new BasicDataStoreFactory(\n\t\t\"@fluidframework/presence\",\n\t\tPresenceManagerDataObject,\n\t);\n}\n\n/**\n * Brand for Experimental Presence Data Object.\n *\n * @remarks\n * See {@link acquirePresenceViaDataObject} for example usage.\n *\n * @sealed\n * @alpha\n */\nexport declare class ExperimentalPresenceDO {\n\tprivate readonly _self: ExperimentalPresenceDO;\n}\n\n/**\n * DataStore based Presence Manager that is used as fallback for preferred Container\n * Extension based version requires registration. Export SharedObjectKind for registration.\n *\n * @alpha\n */\nexport const ExperimentalPresenceManager =\n\tnew PresenceManagerFactory() as unknown as SharedObjectKind<\n\t\tIFluidLoadable & ExperimentalPresenceDO\n\t>;\n\n/**\n * Acquire IPresence from a DataStore based Presence Manager\n *\n * @example\n * ```typescript\n * const containerSchema = {\n * \tinitialObjects: {\n * \t\texperimentalPresence: ExperimentalPresenceDO,\n * \t},\n * } satisfies ContainerSchema;\n * ```\n * then\n * ```typescript\n * const presence = acquirePresenceViaDataObject(\n * \tcontainer.initialObjects.experimentalPresence,\n * \t);\n * ```\n *\n * @alpha\n */\nexport function acquirePresenceViaDataObject(\n\tfluidLoadable: ExperimentalPresenceDO,\n): IPresence {\n\tif (fluidLoadable instanceof PresenceManagerDataObject) {\n\t\treturn fluidLoadable.presenceManager();\n\t}\n\n\tthrow new Error(\"Incompatible loadable; make sure to use ExperimentalPresenceManager\");\n}\n"]}
1
+ {"version":3,"file":"datastorePresenceManagerFactory.js","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts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;;;;;;GAmBG;AACH,MAAM,UAAU,wBAAwB,CAAC,aAAqC;IAC7E,IAAI,aAAa,YAAY,yBAAyB,EAAE,CAAC;QACxD,OAAO,aAAa,CAAC,eAAe,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACxF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/*\n * Hacky support for internal datastore based usages.\n */\n\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IInboundSignalMessage } from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\n\nimport { BasicDataStoreFactory, LoadableFluidObject } from \"./datastoreSupport.js\";\nimport type { Presence } from \"./presence.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\n\nimport type { IExtensionMessage } from \"@fluidframework/presence/internal/container-definitions/internal\";\n\nfunction assertSignalMessageIsValid(\n\tmessage: IInboundSignalMessage | IExtensionMessage,\n): asserts message is IExtensionMessage {\n\tassert(message.clientId !== null, 0xa58 /* Signal must have a client ID */);\n\t// The other difference between messages is that `content` for\n\t// IExtensionMessage is JsonDeserialized and we are fine assuming that.\n}\n\n/**\n * Simple FluidObject holding Presence Manager.\n */\nclass PresenceManagerDataObject extends LoadableFluidObject {\n\t// Creation of presence manager is deferred until first acquisition to avoid\n\t// instantiations and stand-up by Summarizer that has no actual use.\n\tprivate _presenceManager: Presence | undefined;\n\n\tpublic presenceManager(): Presence {\n\t\tif (!this._presenceManager) {\n\t\t\t// TODO: investigate if ContainerExtensionStore (path-based address routing for\n\t\t\t// Signals) is readily detectable here and use that presence manager directly.\n\t\t\tconst manager = createPresenceManager(this.runtime);\n\t\t\tthis.runtime.on(\"signal\", (message: IInboundSignalMessage, local: boolean) => {\n\t\t\t\tassertSignalMessageIsValid(message);\n\t\t\t\tmanager.processSignal(\"\", message, local);\n\t\t\t});\n\t\t\tthis._presenceManager = manager;\n\t\t}\n\t\treturn this._presenceManager;\n\t}\n}\n\n/**\n * Factory class to create {@link Presence} in own data store.\n */\nclass PresenceManagerFactory {\n\tpublic is(value: IFluidLoadable | ExperimentalPresenceDO): value is ExperimentalPresenceDO {\n\t\treturn value instanceof PresenceManagerDataObject;\n\t}\n\n\tpublic readonly factory = new BasicDataStoreFactory(\n\t\t\"@fluidframework/presence\",\n\t\tPresenceManagerDataObject,\n\t);\n}\n\n/**\n * Brand for Experimental Presence Data Object.\n *\n * @remarks\n * See {@link getPresenceViaDataObject} for example usage.\n *\n * @sealed\n * @alpha\n */\nexport declare class ExperimentalPresenceDO {\n\tprivate readonly _self: ExperimentalPresenceDO;\n}\n\n/**\n * DataStore based Presence Manager that is used as fallback for preferred Container\n * Extension based version requires registration. Export SharedObjectKind for registration.\n *\n * @alpha\n */\nexport const ExperimentalPresenceManager =\n\tnew PresenceManagerFactory() as unknown as SharedObjectKind<\n\t\tIFluidLoadable & ExperimentalPresenceDO\n\t>;\n\n/**\n * Acquire Presence from a DataStore based Presence Manager\n *\n * @example\n * ```typescript\n * const containerSchema = {\n * \tinitialObjects: {\n * \t\texperimentalPresence: ExperimentalPresenceDO,\n * \t},\n * } satisfies ContainerSchema;\n * ```\n * then\n * ```typescript\n * const presence = getPresenceViaDataObject(\n * \tcontainer.initialObjects.experimentalPresence,\n * \t);\n * ```\n *\n * @alpha\n */\nexport function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence {\n\tif (fluidLoadable instanceof PresenceManagerDataObject) {\n\t\treturn fluidLoadable.presenceManager();\n\t}\n\n\tthrow new Error(\"Incompatible loadable; make sure to use ExperimentalPresenceManager\");\n}\n"]}
@@ -3,13 +3,13 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IFluidContainer } from "@fluidframework/fluid-static";
6
- import type { IPresence } from "./presence.js";
6
+ import type { Presence } from "./presence.js";
7
7
  /**
8
- * Acquire an IPresence from a Fluid Container
8
+ * Acquire an Presence from a Fluid Container
9
9
  * @param fluidContainer - Fluid Container to acquire the map from
10
- * @returns the IPresence
10
+ * @returns the Presence
11
11
  *
12
12
  * @alpha
13
13
  */
14
- export declare function acquirePresence(fluidContainer: IFluidContainer): IPresence;
14
+ export declare function getPresence(fluidContainer: IFluidContainer): Presence;
15
15
  //# sourceMappingURL=experimentalAccess.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"experimentalAccess.d.ts","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AA2C/C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,eAAe,GAAG,SAAS,CAiB1E"}
1
+ {"version":3,"file":"experimentalAccess.d.ts","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA2C9C;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,eAAe,GAAG,QAAQ,CAiBrE"}
@@ -26,16 +26,16 @@ class ContainerPresenceManager {
26
26
  }
27
27
  ContainerPresenceManager.extensionId = "dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a";
28
28
  /**
29
- * Acquire an IPresence from a Fluid Container
29
+ * Acquire an Presence from a Fluid Container
30
30
  * @param fluidContainer - Fluid Container to acquire the map from
31
- * @returns the IPresence
31
+ * @returns the Presence
32
32
  *
33
33
  * @alpha
34
34
  */
35
- export function acquirePresence(fluidContainer) {
35
+ export function getPresence(fluidContainer) {
36
36
  assert(isInternalFluidContainer(fluidContainer), 0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */);
37
37
  const innerContainer = fluidContainer.container;
38
- assert(isContainerExtensionStore(innerContainer), 0xa39 /* Container does not support extensions. Use acquirePresenceViaDataObject. */);
38
+ assert(isContainerExtensionStore(innerContainer), 0xa39 /* Container does not support extensions. Use getPresenceViaDataObject. */);
39
39
  const presence = innerContainer.acquireExtension(ContainerPresenceManager.extensionId, ContainerPresenceManager);
40
40
  return presence;
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"experimentalAccess.js","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAMjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAS7D,SAAS,yBAAyB,CACjC,OAAiF;IAEjF,OAAQ,OAAmC,CAAC,gBAAgB,KAAK,SAAS,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,wBAAwB;IAK7B,YAAmB,OAA0B;QAH7B,cAAS,GAAG,IAAI,CAAC;QAIhC,4FAA4F;QAC5F,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,GAAG,qBAAqB,CACpD,OAAuC,CACvC,CAAC;IACH,CAAC;IAEM,YAAY;QAClB,QAAQ;IACT,CAAC;IAIM,aAAa,CAAC,OAAe,EAAE,OAA0B,EAAE,KAAc;QAC/E,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;;AAJsB,oCAAW,GAAG,0CAA0C,AAA7C,CAA8C;AAOjF;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,cAA+B;IAC9D,MAAM,CACL,wBAAwB,CAAC,cAAc,CAAC,EACxC,KAAK,CAAC,yGAAyG,CAC/G,CAAC;IACF,MAAM,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC;IAEhD,MAAM,CACL,yBAAyB,CAAC,cAAc,CAAC,EACzC,KAAK,CAAC,8EAA8E,CACpF,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,CAAC,gBAAgB,CAC/C,wBAAwB,CAAC,WAAW,EACpC,wBAAwB,CACxB,CAAC;IACF,OAAO,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerExperimental } from \"@fluidframework/container-loader/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\nimport { isInternalFluidContainer } from \"@fluidframework/fluid-static/internal\";\nimport type { IContainerRuntimeBase } from \"@fluidframework/runtime-definitions/internal\";\n\nimport type { IEphemeralRuntime } from \"./internalTypes.js\";\nimport type { IPresence } from \"./presence.js\";\nimport type { PresenceExtensionInterface } from \"./presenceManager.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\n\nimport type {\n\tContainerExtensionStore,\n\tIContainerExtension,\n\tIExtensionMessage,\n\tIExtensionRuntime,\n} from \"@fluidframework/presence/internal/container-definitions/internal\";\n\nfunction isContainerExtensionStore(\n\tmanager: ContainerExtensionStore | IContainerRuntimeBase | IContainerExperimental,\n): manager is ContainerExtensionStore {\n\treturn (manager as ContainerExtensionStore).acquireExtension !== undefined;\n}\n\n/**\n * Common Presence manager for a container\n */\nclass ContainerPresenceManager implements IContainerExtension<never> {\n\tpublic readonly interface: IPresence;\n\tpublic readonly extension = this;\n\tprivate readonly manager: PresenceExtensionInterface;\n\n\tpublic constructor(runtime: IExtensionRuntime) {\n\t\t// TODO create the appropriate ephemeral runtime (map address must be in submitSignal, etc.)\n\t\tthis.interface = this.manager = createPresenceManager(\n\t\t\truntime as unknown as IEphemeralRuntime,\n\t\t);\n\t}\n\n\tpublic onNewContext(): void {\n\t\t// No-op\n\t}\n\n\tpublic static readonly extensionId = \"dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a\";\n\n\tpublic processSignal(address: string, message: IExtensionMessage, local: boolean): void {\n\t\tthis.manager.processSignal(address, message, local);\n\t}\n}\n\n/**\n * Acquire an IPresence from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the IPresence\n *\n * @alpha\n */\nexport function acquirePresence(fluidContainer: IFluidContainer): IPresence {\n\tassert(\n\t\tisInternalFluidContainer(fluidContainer),\n\t\t0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */,\n\t);\n\tconst innerContainer = fluidContainer.container;\n\n\tassert(\n\t\tisContainerExtensionStore(innerContainer),\n\t\t0xa39 /* Container does not support extensions. Use acquirePresenceViaDataObject. */,\n\t);\n\n\tconst presence = innerContainer.acquireExtension(\n\t\tContainerPresenceManager.extensionId,\n\t\tContainerPresenceManager,\n\t);\n\treturn presence;\n}\n"]}
1
+ {"version":3,"file":"experimentalAccess.js","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAMjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAS7D,SAAS,yBAAyB,CACjC,OAAiF;IAEjF,OAAQ,OAAmC,CAAC,gBAAgB,KAAK,SAAS,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,MAAM,wBAAwB;IAK7B,YAAmB,OAA0B;QAH7B,cAAS,GAAG,IAAI,CAAC;QAIhC,4FAA4F;QAC5F,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,GAAG,qBAAqB,CACpD,OAAuC,CACvC,CAAC;IACH,CAAC;IAEM,YAAY;QAClB,QAAQ;IACT,CAAC;IAIM,aAAa,CAAC,OAAe,EAAE,OAA0B,EAAE,KAAc;QAC/E,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;;AAJsB,oCAAW,GAAG,0CAA0C,AAA7C,CAA8C;AAOjF;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,cAA+B;IAC1D,MAAM,CACL,wBAAwB,CAAC,cAAc,CAAC,EACxC,KAAK,CAAC,yGAAyG,CAC/G,CAAC;IACF,MAAM,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC;IAEhD,MAAM,CACL,yBAAyB,CAAC,cAAc,CAAC,EACzC,KAAK,CAAC,0EAA0E,CAChF,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,CAAC,gBAAgB,CAC/C,wBAAwB,CAAC,WAAW,EACpC,wBAAwB,CACxB,CAAC;IACF,OAAO,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerExperimental } from \"@fluidframework/container-loader/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\nimport { isInternalFluidContainer } from \"@fluidframework/fluid-static/internal\";\nimport type { IContainerRuntimeBase } from \"@fluidframework/runtime-definitions/internal\";\n\nimport type { IEphemeralRuntime } from \"./internalTypes.js\";\nimport type { Presence } from \"./presence.js\";\nimport type { PresenceExtensionInterface } from \"./presenceManager.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\n\nimport type {\n\tContainerExtensionStore,\n\tIContainerExtension,\n\tIExtensionMessage,\n\tIExtensionRuntime,\n} from \"@fluidframework/presence/internal/container-definitions/internal\";\n\nfunction isContainerExtensionStore(\n\tmanager: ContainerExtensionStore | IContainerRuntimeBase | IContainerExperimental,\n): manager is ContainerExtensionStore {\n\treturn (manager as ContainerExtensionStore).acquireExtension !== undefined;\n}\n\n/**\n * Common Presence manager for a container\n */\nclass ContainerPresenceManager implements IContainerExtension<never> {\n\tpublic readonly interface: Presence;\n\tpublic readonly extension = this;\n\tprivate readonly manager: PresenceExtensionInterface;\n\n\tpublic constructor(runtime: IExtensionRuntime) {\n\t\t// TODO create the appropriate ephemeral runtime (map address must be in submitSignal, etc.)\n\t\tthis.interface = this.manager = createPresenceManager(\n\t\t\truntime as unknown as IEphemeralRuntime,\n\t\t);\n\t}\n\n\tpublic onNewContext(): void {\n\t\t// No-op\n\t}\n\n\tpublic static readonly extensionId = \"dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a\";\n\n\tpublic processSignal(address: string, message: IExtensionMessage, local: boolean): void {\n\t\tthis.manager.processSignal(address, message, local);\n\t}\n}\n\n/**\n * Acquire an Presence from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the Presence\n *\n * @alpha\n */\nexport function getPresence(fluidContainer: IFluidContainer): Presence {\n\tassert(\n\t\tisInternalFluidContainer(fluidContainer),\n\t\t0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */,\n\t);\n\tconst innerContainer = fluidContainer.container;\n\n\tassert(\n\t\tisContainerExtensionStore(innerContainer),\n\t\t0xa39 /* Container does not support extensions. Use getPresenceViaDataObject. */,\n\t);\n\n\tconst presence = innerContainer.acquireExtension(\n\t\tContainerPresenceManager.extensionId,\n\t\tContainerPresenceManager,\n\t);\n\treturn presence;\n}\n"]}
@@ -79,7 +79,7 @@ export declare namespace InternalTypes {
79
79
  */
80
80
  type StateValue<T> = T & StateValueBrand<T>;
81
81
  /**
82
- * Package internal function declaration for value manager instantiation.
82
+ * Package internal function declaration for state and notification instantiation.
83
83
  *
84
84
  * @system
85
85
  */
@@ -1 +1 @@
1
- {"version":3,"file":"exposedInternalTypes.js","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;;;;GAMG;AACH,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CA2G7B;AA3GD,WAAiB,aAAa;AA2G9B,CAAC,EA3GgB,aAAa,KAAb,aAAa,QA2G7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\n/**\n * Collection of value types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalTypes {\n\t/**\n\t * @system\n\t */\n\texport interface ValueStateMetadata {\n\t\trev: number;\n\t\ttimestamp: number;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueOptionalState<TValue> extends ValueStateMetadata {\n\t\tvalue?: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueRequiredState<TValue> extends ValueStateMetadata {\n\t\tvalue: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueDirectory<T> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name: string | number]: ValueOptionalState<T> | ValueDirectory<T>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport type ValueDirectoryOrState<T> = ValueRequiredState<T> | ValueDirectory<T>;\n\n\t/**\n\t * @system\n\t */\n\texport interface MapValueState<T, Keys extends string | number> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name in Keys]: ValueOptionalState<T>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport declare class StateDatastoreHandle<TKey, TValue extends ValueDirectoryOrState<any>> {\n\t\tprivate readonly StateDatastoreHandle: StateDatastoreHandle<TKey, TValue>;\n\t}\n\n\t/**\n\t * Brand to ensure state values internal type safety without revealing\n\t * internals that are subject to change.\n\t *\n\t * @system\n\t */\n\texport declare class StateValueBrand<T> {\n\t\tprivate readonly StateValue: StateValue<T>;\n\t}\n\n\t/**\n\t * This type provides no additional functionality over the type it wraps.\n\t * It is used to ensure type safety within package.\n\t * Users may find it convenient to just use the type it wraps directly.\n\t *\n\t * @privateRemarks\n\t * Checkout filtering omitting unknown from T (`Omit<T,unknown> &`).\n\t *\n\t * @system\n\t */\n\texport type StateValue<T> = T & StateValueBrand<T>;\n\n\t/**\n\t * Package internal function declaration for value manager instantiation.\n\t *\n\t * @system\n\t */\n\texport type ManagerFactory<\n\t\tTKey extends string,\n\t\tTValue extends ValueDirectoryOrState<any>,\n\t\tTManager,\n\t> = { instanceBase: new (...args: any[]) => any } & ((\n\t\tkey: TKey,\n\t\tdatastoreHandle: StateDatastoreHandle<TKey, TValue>,\n\t) => {\n\t\tinitialData?: { value: TValue; allowableUpdateLatencyMs: number | undefined };\n\t\tmanager: StateValue<TManager>;\n\t});\n\n\t/**\n\t * @system\n\t */\n\texport interface NotificationType {\n\t\tname: string;\n\t\targs: (JsonSerializable<unknown> & JsonDeserialized<unknown>)[];\n\t}\n}\n"]}
1
+ {"version":3,"file":"exposedInternalTypes.js","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;;;;GAMG;AACH,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CA2G7B;AA3GD,WAAiB,aAAa;AA2G9B,CAAC,EA3GgB,aAAa,KAAb,aAAa,QA2G7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\n/**\n * Collection of value types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalTypes {\n\t/**\n\t * @system\n\t */\n\texport interface ValueStateMetadata {\n\t\trev: number;\n\t\ttimestamp: number;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueOptionalState<TValue> extends ValueStateMetadata {\n\t\tvalue?: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueRequiredState<TValue> extends ValueStateMetadata {\n\t\tvalue: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueDirectory<T> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name: string | number]: ValueOptionalState<T> | ValueDirectory<T>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport type ValueDirectoryOrState<T> = ValueRequiredState<T> | ValueDirectory<T>;\n\n\t/**\n\t * @system\n\t */\n\texport interface MapValueState<T, Keys extends string | number> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name in Keys]: ValueOptionalState<T>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport declare class StateDatastoreHandle<TKey, TValue extends ValueDirectoryOrState<any>> {\n\t\tprivate readonly StateDatastoreHandle: StateDatastoreHandle<TKey, TValue>;\n\t}\n\n\t/**\n\t * Brand to ensure state values internal type safety without revealing\n\t * internals that are subject to change.\n\t *\n\t * @system\n\t */\n\texport declare class StateValueBrand<T> {\n\t\tprivate readonly StateValue: StateValue<T>;\n\t}\n\n\t/**\n\t * This type provides no additional functionality over the type it wraps.\n\t * It is used to ensure type safety within package.\n\t * Users may find it convenient to just use the type it wraps directly.\n\t *\n\t * @privateRemarks\n\t * Checkout filtering omitting unknown from T (`Omit<T,unknown> &`).\n\t *\n\t * @system\n\t */\n\texport type StateValue<T> = T & StateValueBrand<T>;\n\n\t/**\n\t * Package internal function declaration for state and notification instantiation.\n\t *\n\t * @system\n\t */\n\texport type ManagerFactory<\n\t\tTKey extends string,\n\t\tTValue extends ValueDirectoryOrState<any>,\n\t\tTManager,\n\t> = { instanceBase: new (...args: any[]) => any } & ((\n\t\tkey: TKey,\n\t\tdatastoreHandle: StateDatastoreHandle<TKey, TValue>,\n\t) => {\n\t\tinitialData?: { value: TValue; allowableUpdateLatencyMs: number | undefined };\n\t\tmanager: StateValue<TManager>;\n\t});\n\n\t/**\n\t * @system\n\t */\n\texport interface NotificationType {\n\t\tname: string;\n\t\targs: (JsonSerializable<unknown> & JsonDeserialized<unknown>)[];\n\t}\n}\n"]}
@@ -11,14 +11,6 @@ import type { InternalUtilityTypes as CoreInternalUtilityTypes, JsonDeserialized
11
11
  * @system
12
12
  */
13
13
  export declare namespace InternalUtilityTypes {
14
- /**
15
- * Recursively/deeply makes all properties of a type readonly.
16
- *
17
- * @system
18
- */
19
- type FullyReadonly<T> = {
20
- readonly [K in keyof T]: FullyReadonly<T[K]>;
21
- };
22
14
  /**
23
15
  * `true` iff the given type is an acceptable shape for a notification.
24
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"exposedUtilityTypes.d.ts","sourceRoot":"","sources":["../src/exposedUtilityTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,oBAAoB,IAAI,wBAAwB,EAChD,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,8DAA8D,CAAC;AAEtE;;;;;;GAMG;AAEH,yBAAiB,oBAAoB,CAAC;IACrC;;;;OAIG;IACH,KAAY,aAAa,CAAC,CAAC,IAAI;QAC9B,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,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IACH,KAAY,sBAAsB,CAAC,KAAK,IAAI,KAAK,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,GACjF,wBAAwB,CAAC,UAAU,CACnC,CAAC,EACD,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,EACzC,IAAI,EACJ,KAAK,CACL,GACA,KAAK,CAAC;IAET;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAY,qBAAqB,CAAC,CAAC,IAAI;SACrC,CAAC,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;KACtF,CAAC;IAEF;;;;OAIG;IACH,KAAY,0BAA0B,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,SAAS,CACnF,GAAG,IAAI,EAAE,MAAM,CAAC,KACZ,GAAG,GACL,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;IAET;;;;OAIG;IACH,KAAY,0BAA0B,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,SAAS,CACnF,GAAG,IAAI,EAAE,MAAM,CAAC,KACZ,GAAG,GACL,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"exposedUtilityTypes.js","sourceRoot":"","sources":["../src/exposedUtilityTypes.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 {\n\tInternalUtilityTypes as CoreInternalUtilityTypes,\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\n/**\n * Collection of utility types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalUtilityTypes {\n\t/**\n\t * Recursively/deeply makes all properties of a type readonly.\n\t *\n\t * @system\n\t */\n\texport type FullyReadonly<T> = {\n\t\treadonly [K in keyof T]: FullyReadonly<T[K]>;\n\t};\n\n\t/**\n\t * `true` iff the given type is an acceptable shape for a notification.\n\t *\n\t * @system\n\t */\n\texport type IsNotificationListener<Event> = Event extends (...args: infer P) => void\n\t\t? CoreInternalUtilityTypes.IfSameType<\n\t\t\t\tP,\n\t\t\t\tJsonSerializable<P> & JsonDeserialized<P>,\n\t\t\t\ttrue,\n\t\t\t\tfalse\n\t\t\t>\n\t\t: false;\n\n\t/**\n\t * Used to specify the kinds of notifications emitted by a {@link NotificationListenable}.\n\t *\n\t * @remarks\n\t *\n\t * Any object type is a valid NotificationListeners, but only the notification-like\n\t * properties of that type will be included.\n\t *\n\t * @example\n\t *\n\t * ```typescript\n\t * interface MyNotifications {\n\t * load: (user: string, data: IUserData) => void;\n\t * requestPause: (period: number) => void;\n\t * }\n\t * ```\n\t *\n\t * @system\n\t */\n\texport type NotificationListeners<E> = {\n\t\t[P in string & keyof E as IsNotificationListener<E[P]> extends true ? P : never]: E[P];\n\t};\n\n\t/**\n\t * {@link @fluidframework/core-interfaces#JsonDeserialized} version of the parameters of a function.\n\t *\n\t * @system\n\t */\n\texport type JsonDeserializedParameters<T extends (...args: any) => any> = T extends (\n\t\t...args: infer P\n\t) => any\n\t\t? JsonDeserialized<P>\n\t\t: never;\n\n\t/**\n\t * {@link @fluidframework/core-interfaces#JsonSerializable} version of the parameters of a function.\n\t *\n\t * @system\n\t */\n\texport type JsonSerializableParameters<T extends (...args: any) => any> = T extends (\n\t\t...args: infer P\n\t) => any\n\t\t? JsonSerializable<P>\n\t\t: never;\n}\n"]}
1
+ {"version":3,"file":"exposedUtilityTypes.js","sourceRoot":"","sources":["../src/exposedUtilityTypes.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 {\n\tInternalUtilityTypes as CoreInternalUtilityTypes,\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\n/**\n * Collection of utility types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalUtilityTypes {\n\t/**\n\t * `true` iff the given type is an acceptable shape for a notification.\n\t *\n\t * @system\n\t */\n\texport type IsNotificationListener<Event> = Event extends (...args: infer P) => void\n\t\t? CoreInternalUtilityTypes.IfSameType<\n\t\t\t\tP,\n\t\t\t\tJsonSerializable<P> & JsonDeserialized<P>,\n\t\t\t\ttrue,\n\t\t\t\tfalse\n\t\t\t>\n\t\t: false;\n\n\t/**\n\t * Used to specify the kinds of notifications emitted by a {@link NotificationListenable}.\n\t *\n\t * @remarks\n\t *\n\t * Any object type is a valid NotificationListeners, but only the notification-like\n\t * properties of that type will be included.\n\t *\n\t * @example\n\t *\n\t * ```typescript\n\t * interface MyNotifications {\n\t * load: (user: string, data: IUserData) => void;\n\t * requestPause: (period: number) => void;\n\t * }\n\t * ```\n\t *\n\t * @system\n\t */\n\texport type NotificationListeners<E> = {\n\t\t[P in string & keyof E as IsNotificationListener<E[P]> extends true ? P : never]: E[P];\n\t};\n\n\t/**\n\t * {@link @fluidframework/core-interfaces#JsonDeserialized} version of the parameters of a function.\n\t *\n\t * @system\n\t */\n\texport type JsonDeserializedParameters<T extends (...args: any) => any> = T extends (\n\t\t...args: infer P\n\t) => any\n\t\t? JsonDeserialized<P>\n\t\t: never;\n\n\t/**\n\t * {@link @fluidframework/core-interfaces#JsonSerializable} version of the parameters of a function.\n\t *\n\t * @system\n\t */\n\texport type JsonSerializableParameters<T extends (...args: any) => any> = T extends (\n\t\t...args: infer P\n\t) => any\n\t\t? JsonSerializable<P>\n\t\t: never;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -10,15 +10,16 @@
10
10
  * @packageDocumentation
11
11
  */
12
12
  export type { ClientConnectionId } from "./baseTypes.js";
13
- export type { PresenceNotifications, PresenceNotificationsSchema, PresenceStates, PresenceStatesEntries, PresenceStatesSchema, PresenceWorkspaceAddress, PresenceWorkspaceEntry, } from "./types.js";
14
- export { type ClientSessionId, type IPresence, type ISessionClient, type PresenceEvents, SessionClientStatus, } from "./presence.js";
13
+ export type { NotificationsWorkspace, NotificationsWorkspaceSchema, StatesWorkspace, StatesWorkspaceEntries, StatesWorkspaceSchema, StatesWorkspaceEntry, WorkspaceAddress, } from "./types.js";
14
+ export { type Attendee, type AttendeesEvents, type AttendeeId, AttendeeStatus, type Presence, type PresenceEvents, } from "./presence.js";
15
15
  export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControls.js";
16
- export { acquirePresence } from "./experimentalAccess.js";
17
- export { acquirePresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
18
- export { LatestMap, type LatestMapItemRemovedClientData, type LatestMapItemValueClientData, type LatestMapValueClientData, type LatestMapValueManager, type LatestMapValueManagerEvents, type ValueMap, } from "./latestMapValueManager.js";
19
- export { Latest, type LatestValueManager, type LatestValueManagerEvents, } from "./latestValueManager.js";
20
- export type { LatestValueClientData, LatestValueData, LatestValueMetadata, } from "./latestValueTypes.js";
16
+ export { getPresence } from "./experimentalAccess.js";
17
+ export { getPresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
18
+ export type { latestMap, LatestMapArguments, LatestMapRaw, LatestMapClientData, LatestMapRawEvents, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, StateMap, } from "./latestMapValueManager.js";
19
+ export type { latest, LatestArguments, LatestRaw, LatestRawEvents, } from "./latestValueManager.js";
20
+ export type { LatestClientData, LatestData, LatestMetadata, } from "./latestValueTypes.js";
21
21
  export { type NotificationEmitter, type NotificationListenable, type NotificationSubscriptions, Notifications, type NotificationsManager, type NotificationsManagerEvents, } from "./notificationsManager.js";
22
+ export { StateFactory } from "./stateFactory.js";
22
23
  export type { InternalTypes } from "./exposedInternalTypes.js";
23
24
  export type { InternalUtilityTypes } from "./exposedUtilityTypes.js";
24
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACX,qBAAqB,EACrB,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,mBAAmB,GACnB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACN,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACN,SAAS,EACT,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,QAAQ,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,MAAM,EACN,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACnB,MAAM,uBAAuB,CAAC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xB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
package/lib/index.js CHANGED
@@ -2,10 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { SessionClientStatus, } from "./presence.js";
6
- export { acquirePresence } from "./experimentalAccess.js";
7
- export { acquirePresenceViaDataObject, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
8
- export { LatestMap, } from "./latestMapValueManager.js";
9
- export { Latest, } from "./latestValueManager.js";
5
+ export { AttendeeStatus, } from "./presence.js";
6
+ export { getPresence } from "./experimentalAccess.js";
7
+ export { getPresenceViaDataObject, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
10
8
  export { Notifications, } from "./notificationsManager.js";
9
+ export { StateFactory } from "./stateFactory.js";
11
10
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAKN,mBAAmB,GACnB,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACN,4BAA4B,EAE5B,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACN,SAAS,GAOT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,MAAM,GAGN,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAIN,aAAa,GAGb,MAAM,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tPresenceNotifications,\n\tPresenceNotificationsSchema,\n\tPresenceStates,\n\tPresenceStatesEntries,\n\tPresenceStatesSchema,\n\tPresenceWorkspaceAddress,\n\tPresenceWorkspaceEntry,\n} from \"./types.js\";\n\nexport {\n\ttype ClientSessionId,\n\ttype IPresence,\n\ttype ISessionClient,\n\ttype PresenceEvents,\n\tSessionClientStatus,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport { acquirePresence } from \"./experimentalAccess.js\";\n\nexport {\n\tacquirePresenceViaDataObject,\n\ttype ExperimentalPresenceDO,\n\tExperimentalPresenceManager,\n} from \"./datastorePresenceManagerFactory.js\";\n\nexport {\n\tLatestMap,\n\ttype LatestMapItemRemovedClientData,\n\ttype LatestMapItemValueClientData,\n\ttype LatestMapValueClientData,\n\ttype LatestMapValueManager,\n\ttype LatestMapValueManagerEvents,\n\ttype ValueMap,\n} from \"./latestMapValueManager.js\";\nexport {\n\tLatest,\n\ttype LatestValueManager,\n\ttype LatestValueManagerEvents,\n} from \"./latestValueManager.js\";\nexport type {\n\tLatestValueClientData,\n\tLatestValueData,\n\tLatestValueMetadata,\n} from \"./latestValueTypes.js\";\n\nexport {\n\ttype NotificationEmitter,\n\ttype NotificationListenable,\n\ttype NotificationSubscriptions,\n\tNotifications,\n\ttype NotificationsManager,\n\ttype NotificationsManagerEvents,\n} from \"./notificationsManager.js\";\n\nexport type { InternalTypes } from \"./exposedInternalTypes.js\";\nexport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAGd,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EACN,wBAAwB,EAExB,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAwB9C,OAAO,EAIN,aAAa,GAGb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceEntries,\n\tStatesWorkspaceSchema,\n\tStatesWorkspaceEntry,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\nexport {\n\ttype Attendee,\n\ttype AttendeesEvents,\n\ttype AttendeeId,\n\tAttendeeStatus,\n\ttype Presence,\n\ttype PresenceEvents,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport { getPresence } from \"./experimentalAccess.js\";\n\nexport {\n\tgetPresenceViaDataObject,\n\ttype ExperimentalPresenceDO,\n\tExperimentalPresenceManager,\n} from \"./datastorePresenceManagerFactory.js\";\n\nexport type {\n\tlatestMap,\n\tLatestMapArguments,\n\tLatestMapRaw,\n\tLatestMapClientData,\n\tLatestMapRawEvents,\n\tLatestMapItemRemovedClientData,\n\tLatestMapItemUpdatedClientData,\n\tStateMap,\n} from \"./latestMapValueManager.js\";\nexport type {\n\tlatest,\n\tLatestArguments,\n\tLatestRaw,\n\tLatestRawEvents,\n} from \"./latestValueManager.js\";\nexport type {\n\tLatestClientData,\n\tLatestData,\n\tLatestMetadata,\n} from \"./latestValueTypes.js\";\n\nexport {\n\ttype NotificationEmitter,\n\ttype NotificationListenable,\n\ttype NotificationSubscriptions,\n\tNotifications,\n\ttype NotificationsManager,\n\ttype NotificationsManagerEvents,\n} from \"./notificationsManager.js\";\n\nexport { StateFactory } from \"./stateFactory.js\";\n\nexport type { InternalTypes } from \"./exposedInternalTypes.js\";\nexport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\n"]}
@@ -5,13 +5,13 @@
5
5
  import type { IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
6
6
  import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
7
7
  import type { InternalTypes } from "./exposedInternalTypes.js";
8
- import type { ClientSessionId, ISessionClient } from "./presence.js";
8
+ import type { AttendeeId, Attendee } from "./presence.js";
9
9
  import type { IRuntimeInternal } from "@fluidframework/presence/internal/container-definitions/internal";
10
10
  /**
11
11
  * @internal
12
12
  */
13
13
  export interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {
14
- [ClientSessionId: ClientSessionId]: TValue;
14
+ [AttendeeId: AttendeeId]: TValue;
15
15
  }
16
16
  /**
17
17
  * This interface is a subset of (IContainerRuntime & IRuntimeInternal) and
@@ -28,7 +28,7 @@ export type IEphemeralRuntime = Pick<(IContainerRuntime & IRuntimeInternal) | IF
28
28
  */
29
29
  export interface ValueManager<TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue> = InternalTypes.ValueDirectoryOrState<TValue>> {
30
30
  readonly value?: TValueState;
31
- update(client: ISessionClient, received: number, value: TValueState): PostUpdateAction[];
31
+ update(attendee: Attendee, received: number, value: TValueState): PostUpdateAction[];
32
32
  }
33
33
  /**
34
34
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"internalTypes.d.ts","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":"AAAA;;;GAG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AAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAE7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kEAAkE,CAAC;AAEzG;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,aAAa,CAAC,qBAAqB,CAAC,OAAO,CAAC;IAIxF,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CACnC,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,GAAG,sBAAsB,EAC/D,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,cAAc,CACtF,GACA,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,YAAY,CAC5B,MAAM,EACN,WAAW,SACV,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC;IAG1F,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,gBAAgB,EAAE,CAAC;CACrF;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"internalTypes.js","sourceRoot":"","sources":["../src/internalTypes.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 { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { ClientSessionId, ISessionClient } from \"./presence.js\";\n\nimport type { IRuntimeInternal } from \"@fluidframework/presence/internal/container-definitions/internal\";\n\n/**\n * @internal\n */\nexport interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {\n\t// Caution: any particular item may or may not exist\n\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t[ClientSessionId: ClientSessionId]: TValue;\n}\n\n/**\n * This interface is a subset of (IContainerRuntime & IRuntimeInternal) and\n * (IFluidDataStoreRuntime) that is needed by the Presence States.\n *\n * @privateRemarks\n * Replace with non-DataStore based interface.\n *\n * @internal\n */\nexport type IEphemeralRuntime = Pick<\n\t(IContainerRuntime & IRuntimeInternal) | IFluidDataStoreRuntime,\n\t\"clientId\" | \"connected\" | \"getAudience\" | \"getQuorum\" | \"off\" | \"on\" | \"submitSignal\"\n> &\n\tPartial<Pick<IFluidDataStoreRuntime, \"logger\">>;\n\n/**\n * @internal\n */\nexport interface ValueManager<\n\tTValue,\n\tTValueState extends\n\t\tInternalTypes.ValueDirectoryOrState<TValue> = InternalTypes.ValueDirectoryOrState<TValue>,\n> {\n\t// Most value managers should provide value - implement Required<ValueManager<...>>\n\treadonly value?: TValueState;\n\tupdate(client: ISessionClient, received: number, value: TValueState): PostUpdateAction[];\n}\n\n/**\n * @internal\n */\nexport type PostUpdateAction = () => void;\n"]}
1
+ {"version":3,"file":"internalTypes.js","sourceRoot":"","sources":["../src/internalTypes.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 { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { AttendeeId, Attendee } from \"./presence.js\";\n\nimport type { IRuntimeInternal } from \"@fluidframework/presence/internal/container-definitions/internal\";\n\n/**\n * @internal\n */\nexport interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {\n\t// Caution: any particular item may or may not exist\n\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t[AttendeeId: AttendeeId]: TValue;\n}\n\n/**\n * This interface is a subset of (IContainerRuntime & IRuntimeInternal) and\n * (IFluidDataStoreRuntime) that is needed by the Presence States.\n *\n * @privateRemarks\n * Replace with non-DataStore based interface.\n *\n * @internal\n */\nexport type IEphemeralRuntime = Pick<\n\t(IContainerRuntime & IRuntimeInternal) | IFluidDataStoreRuntime,\n\t\"clientId\" | \"connected\" | \"getAudience\" | \"getQuorum\" | \"off\" | \"on\" | \"submitSignal\"\n> &\n\tPartial<Pick<IFluidDataStoreRuntime, \"logger\">>;\n\n/**\n * @internal\n */\nexport interface ValueManager<\n\tTValue,\n\tTValueState extends\n\t\tInternalTypes.ValueDirectoryOrState<TValue> = InternalTypes.ValueDirectoryOrState<TValue>,\n> {\n\t// State objects should provide value - implement Required<ValueManager<...>>\n\treadonly value?: TValueState;\n\tupdate(attendee: Attendee, received: number, value: TValueState): PostUpdateAction[];\n}\n\n/**\n * @internal\n */\nexport type PostUpdateAction = () => void;\n"]}
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import type { DeepReadonly } from "@fluidframework/core-interfaces/internal";
5
6
  /**
6
7
  * Returns union of types of values in a record.
7
8
  */
@@ -51,5 +52,9 @@ export declare const objectKeys: <T>(o: T) => (keyof MapNumberIndicesToStrings<T
51
52
  * value (the result of `defaultValue`)
52
53
  */
53
54
  export declare function getOrCreateRecord<K extends string | number | symbol, V>(record: Record<K, V>, key: K, defaultValue: (key: K) => V): V;
55
+ /**
56
+ * Do nothing helper to apply deep immutability to a value's type.
57
+ */
58
+ export declare function asDeeplyReadonly<T>(value: T): DeepReadonly<T>;
54
59
  export {};
55
60
  //# sourceMappingURL=internalUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internalUtils.d.ts","sourceRoot":"","sources":["../src/internalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7C,KAAK,yBAAyB,CAAC,CAAC,IAAI;KAClC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,KAAK,aAAa,CAAC,CAAC,IAAI;KACtB,CAAC,IAAI,MAAM,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC,MAAM,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAElD,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,SAA4B,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC;AAE7E;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,SACtC,CAAC,KACA,cAAc,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,UAAU,SAAy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AAE7E;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,SACtC,CAAC,KACA,cAAc,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,UAAU,SAAyB,CAAC,KAAK,CAAC,MAAM,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;AAE7F;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,EACtE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,GAAG,EAAE,CAAC,EACN,YAAY,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GACzB,CAAC,CAKH;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAE7D"}
@@ -43,4 +43,10 @@ export function getOrCreateRecord(record, key, defaultValue) {
43
43
  }
44
44
  return record[key];
45
45
  }
46
+ /**
47
+ * Do nothing helper to apply deep immutability to a value's type.
48
+ */
49
+ export function asDeeplyReadonly(value) {
50
+ return value;
51
+ }
46
52
  //# sourceMappingURL=internalUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internalUtils.js","sourceRoot":"","sources":["../src/internalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAwC,CAAC;AAE7E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAEN,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAA2D,CAAC;AAE7F;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAoB,EACpB,GAAM,EACN,YAA2B;IAE3B,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Returns union of types of values in a record.\n */\nexport type RecordEntryTypes<T> = T[keyof T];\n\ntype MapNumberIndicesToStrings<T> = {\n\t[K in keyof T as K extends number ? `${K}` : K]: T[K];\n};\n\ntype KeyValuePairs<T> = {\n\t[K in keyof MapNumberIndicesToStrings<Required<T>>]: [K, Required<T>[K]];\n}[keyof MapNumberIndicesToStrings<Required<T>>][];\n\ntype RequiredAndNotUndefined<T> = {\n\t[K in keyof T]-?: Exclude<T[K], undefined>;\n};\n\n/**\n * Object.entries retyped to preserve known keys and their types.\n *\n * @internal\n */\nexport const objectEntries = Object.entries as <T>(o: T) => KeyValuePairs<T>;\n\n/**\n * Object.entries retyped to preserve known keys and their types.\n *\n * @remarks\n * Given `T` should not contain `undefined` values. If it does, use\n * {@link objectEntries} instead. Without `undefined` values, this\n * typing provides best handling of objects with optional properties.\n *\n * @internal\n */\nexport const objectEntriesWithoutUndefined = Object.entries as <T>(\n\to: T,\n) => KeyValuePairs<RequiredAndNotUndefined<T>>;\n\n/**\n * Object.keys retyped to preserve known keys and their types.\n *\n * @internal\n */\nexport const objectKeys = Object.keys as <T>(o: T) => (keyof MapNumberIndicesToStrings<T>)[];\n\n/**\n * Retrieve a value from a record with the given key, or create a new entry if\n * the key is not in the record.\n *\n * @param record - The record to index/update\n * @param key - The key to lookup in the record\n * @param defaultValue - a function which returns a default value. This is\n * called and used to set an initial value for the given key in the record if\n * none exists.\n * @returns either the existing value for the given key, or the newly-created\n * value (the result of `defaultValue`)\n */\nexport function getOrCreateRecord<K extends string | number | symbol, V>(\n\trecord: Record<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tif (!(key in record)) {\n\t\trecord[key] = defaultValue(key);\n\t}\n\treturn record[key];\n}\n"]}
1
+ {"version":3,"file":"internalUtils.js","sourceRoot":"","sources":["../src/internalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAwC,CAAC;AAE7E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAEN,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAA2D,CAAC;AAE7F;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAoB,EACpB,GAAM,EACN,YAA2B;IAE3B,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAI,KAAQ;IAC3C,OAAO,KAAwB,CAAC;AACjC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { DeepReadonly } from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * Returns union of types of values in a record.\n */\nexport type RecordEntryTypes<T> = T[keyof T];\n\ntype MapNumberIndicesToStrings<T> = {\n\t[K in keyof T as K extends number ? `${K}` : K]: T[K];\n};\n\ntype KeyValuePairs<T> = {\n\t[K in keyof MapNumberIndicesToStrings<Required<T>>]: [K, Required<T>[K]];\n}[keyof MapNumberIndicesToStrings<Required<T>>][];\n\ntype RequiredAndNotUndefined<T> = {\n\t[K in keyof T]-?: Exclude<T[K], undefined>;\n};\n\n/**\n * Object.entries retyped to preserve known keys and their types.\n *\n * @internal\n */\nexport const objectEntries = Object.entries as <T>(o: T) => KeyValuePairs<T>;\n\n/**\n * Object.entries retyped to preserve known keys and their types.\n *\n * @remarks\n * Given `T` should not contain `undefined` values. If it does, use\n * {@link objectEntries} instead. Without `undefined` values, this\n * typing provides best handling of objects with optional properties.\n *\n * @internal\n */\nexport const objectEntriesWithoutUndefined = Object.entries as <T>(\n\to: T,\n) => KeyValuePairs<RequiredAndNotUndefined<T>>;\n\n/**\n * Object.keys retyped to preserve known keys and their types.\n *\n * @internal\n */\nexport const objectKeys = Object.keys as <T>(o: T) => (keyof MapNumberIndicesToStrings<T>)[];\n\n/**\n * Retrieve a value from a record with the given key, or create a new entry if\n * the key is not in the record.\n *\n * @param record - The record to index/update\n * @param key - The key to lookup in the record\n * @param defaultValue - a function which returns a default value. This is\n * called and used to set an initial value for the given key in the record if\n * none exists.\n * @returns either the existing value for the given key, or the newly-created\n * value (the result of `defaultValue`)\n */\nexport function getOrCreateRecord<K extends string | number | symbol, V>(\n\trecord: Record<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tif (!(key in record)) {\n\t\trecord[key] = defaultValue(key);\n\t}\n\treturn record[key];\n}\n\n/**\n * Do nothing helper to apply deep immutability to a value's type.\n */\nexport function asDeeplyReadonly<T>(value: T): DeepReadonly<T> {\n\treturn value as DeepReadonly<T>;\n}\n"]}