@fluidframework/presence 2.41.0-338186 → 2.41.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 (163) hide show
  1. package/README.md +6 -10
  2. package/dist/alpha.d.ts +18 -14
  3. package/dist/baseTypes.d.ts +1 -1
  4. package/dist/baseTypes.js.map +1 -1
  5. package/dist/beta.d.ts +53 -0
  6. package/dist/broadcastControls.d.ts +2 -2
  7. package/dist/broadcastControls.js.map +1 -1
  8. package/dist/datastorePresenceManagerFactory.d.ts +4 -1
  9. package/dist/datastorePresenceManagerFactory.d.ts.map +1 -1
  10. package/dist/datastorePresenceManagerFactory.js +23 -3
  11. package/dist/datastorePresenceManagerFactory.js.map +1 -1
  12. package/dist/experimentalAccess.d.ts +12 -4
  13. package/dist/experimentalAccess.d.ts.map +1 -1
  14. package/dist/experimentalAccess.js +24 -17
  15. package/dist/experimentalAccess.js.map +1 -1
  16. package/dist/exposedInternalTypes.d.ts +1 -1
  17. package/dist/exposedInternalTypes.js +1 -1
  18. package/dist/exposedInternalTypes.js.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +2 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/internalTypes.d.ts +25 -6
  24. package/dist/internalTypes.d.ts.map +1 -1
  25. package/dist/internalTypes.js.map +1 -1
  26. package/dist/internalUtils.d.ts +9 -4
  27. package/dist/internalUtils.d.ts.map +1 -1
  28. package/dist/internalUtils.js +5 -0
  29. package/dist/internalUtils.js.map +1 -1
  30. package/dist/latestMapValueManager.d.ts +8 -8
  31. package/dist/latestMapValueManager.js +1 -1
  32. package/dist/latestMapValueManager.js.map +1 -1
  33. package/dist/latestValueManager.d.ts +4 -4
  34. package/dist/latestValueManager.js +1 -1
  35. package/dist/latestValueManager.js.map +1 -1
  36. package/dist/latestValueTypes.d.ts +3 -3
  37. package/dist/latestValueTypes.js.map +1 -1
  38. package/dist/notificationsManager.d.ts +1 -1
  39. package/dist/notificationsManager.d.ts.map +1 -1
  40. package/dist/notificationsManager.js.map +1 -1
  41. package/dist/package.json +5 -4
  42. package/dist/presence.d.ts +19 -8
  43. package/dist/presence.d.ts.map +1 -1
  44. package/dist/presence.js +1 -1
  45. package/dist/presence.js.map +1 -1
  46. package/dist/presenceDatastoreManager.d.ts +6 -37
  47. package/dist/presenceDatastoreManager.d.ts.map +1 -1
  48. package/dist/presenceDatastoreManager.js +33 -31
  49. package/dist/presenceDatastoreManager.js.map +1 -1
  50. package/dist/presenceManager.d.ts +5 -5
  51. package/dist/presenceManager.d.ts.map +1 -1
  52. package/dist/presenceManager.js +12 -10
  53. package/dist/presenceManager.js.map +1 -1
  54. package/dist/presenceStates.d.ts +1 -1
  55. package/dist/presenceStates.d.ts.map +1 -1
  56. package/dist/presenceStates.js.map +1 -1
  57. package/dist/protocol.d.ts +74 -0
  58. package/dist/protocol.d.ts.map +1 -0
  59. package/dist/protocol.js +16 -0
  60. package/dist/protocol.js.map +1 -0
  61. package/dist/stateDatastore.d.ts +1 -1
  62. package/dist/stateDatastore.d.ts.map +1 -1
  63. package/dist/stateDatastore.js.map +1 -1
  64. package/dist/stateFactory.d.ts +1 -1
  65. package/dist/stateFactory.js +1 -1
  66. package/dist/stateFactory.js.map +1 -1
  67. package/dist/systemWorkspace.js.map +1 -1
  68. package/dist/types.d.ts +9 -8
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/types.js.map +1 -1
  71. package/lib/alpha.d.ts +18 -14
  72. package/lib/baseTypes.d.ts +1 -1
  73. package/lib/baseTypes.js.map +1 -1
  74. package/lib/beta.d.ts +53 -0
  75. package/lib/broadcastControls.d.ts +2 -2
  76. package/lib/broadcastControls.js.map +1 -1
  77. package/lib/datastorePresenceManagerFactory.d.ts +4 -1
  78. package/lib/datastorePresenceManagerFactory.d.ts.map +1 -1
  79. package/lib/datastorePresenceManagerFactory.js +23 -3
  80. package/lib/datastorePresenceManagerFactory.js.map +1 -1
  81. package/lib/experimentalAccess.d.ts +12 -4
  82. package/lib/experimentalAccess.d.ts.map +1 -1
  83. package/lib/experimentalAccess.js +22 -15
  84. package/lib/experimentalAccess.js.map +1 -1
  85. package/lib/exposedInternalTypes.d.ts +1 -1
  86. package/lib/exposedInternalTypes.js +1 -1
  87. package/lib/exposedInternalTypes.js.map +1 -1
  88. package/lib/index.d.ts +2 -2
  89. package/lib/index.d.ts.map +1 -1
  90. package/lib/index.js +1 -1
  91. package/lib/index.js.map +1 -1
  92. package/lib/internalTypes.d.ts +25 -6
  93. package/lib/internalTypes.d.ts.map +1 -1
  94. package/lib/internalTypes.js.map +1 -1
  95. package/lib/internalUtils.d.ts +9 -4
  96. package/lib/internalUtils.d.ts.map +1 -1
  97. package/lib/internalUtils.js +5 -0
  98. package/lib/internalUtils.js.map +1 -1
  99. package/lib/latestMapValueManager.d.ts +8 -8
  100. package/lib/latestMapValueManager.js +1 -1
  101. package/lib/latestMapValueManager.js.map +1 -1
  102. package/lib/latestValueManager.d.ts +4 -4
  103. package/lib/latestValueManager.js +1 -1
  104. package/lib/latestValueManager.js.map +1 -1
  105. package/lib/latestValueTypes.d.ts +3 -3
  106. package/lib/latestValueTypes.js.map +1 -1
  107. package/lib/notificationsManager.d.ts +1 -1
  108. package/lib/notificationsManager.d.ts.map +1 -1
  109. package/lib/notificationsManager.js.map +1 -1
  110. package/lib/presence.d.ts +19 -8
  111. package/lib/presence.d.ts.map +1 -1
  112. package/lib/presence.js +1 -1
  113. package/lib/presence.js.map +1 -1
  114. package/lib/presenceDatastoreManager.d.ts +6 -37
  115. package/lib/presenceDatastoreManager.d.ts.map +1 -1
  116. package/lib/presenceDatastoreManager.js +32 -30
  117. package/lib/presenceDatastoreManager.js.map +1 -1
  118. package/lib/presenceManager.d.ts +5 -5
  119. package/lib/presenceManager.d.ts.map +1 -1
  120. package/lib/presenceManager.js +12 -10
  121. package/lib/presenceManager.js.map +1 -1
  122. package/lib/presenceStates.d.ts +1 -1
  123. package/lib/presenceStates.d.ts.map +1 -1
  124. package/lib/presenceStates.js.map +1 -1
  125. package/lib/protocol.d.ts +74 -0
  126. package/lib/protocol.d.ts.map +1 -0
  127. package/lib/protocol.js +13 -0
  128. package/lib/protocol.js.map +1 -0
  129. package/lib/stateDatastore.d.ts +1 -1
  130. package/lib/stateDatastore.d.ts.map +1 -1
  131. package/lib/stateDatastore.js.map +1 -1
  132. package/lib/stateFactory.d.ts +1 -1
  133. package/lib/stateFactory.js +1 -1
  134. package/lib/stateFactory.js.map +1 -1
  135. package/lib/systemWorkspace.js.map +1 -1
  136. package/lib/types.d.ts +9 -8
  137. package/lib/types.d.ts.map +1 -1
  138. package/lib/types.js.map +1 -1
  139. package/package.json +30 -23
  140. package/dist/container-definitions/containerExtensions.d.ts +0 -137
  141. package/dist/container-definitions/containerExtensions.d.ts.map +0 -1
  142. package/dist/container-definitions/containerExtensions.js +0 -7
  143. package/dist/container-definitions/containerExtensions.js.map +0 -1
  144. package/dist/container-definitions/index.d.ts +0 -7
  145. package/dist/container-definitions/index.d.ts.map +0 -1
  146. package/dist/container-definitions/index.js +0 -7
  147. package/dist/container-definitions/index.js.map +0 -1
  148. package/dist/container-definitions/runtime.d.ts +0 -12
  149. package/dist/container-definitions/runtime.d.ts.map +0 -1
  150. package/dist/container-definitions/runtime.js +0 -7
  151. package/dist/container-definitions/runtime.js.map +0 -1
  152. package/lib/container-definitions/containerExtensions.d.ts +0 -137
  153. package/lib/container-definitions/containerExtensions.d.ts.map +0 -1
  154. package/lib/container-definitions/containerExtensions.js +0 -6
  155. package/lib/container-definitions/containerExtensions.js.map +0 -1
  156. package/lib/container-definitions/index.d.ts +0 -7
  157. package/lib/container-definitions/index.d.ts.map +0 -1
  158. package/lib/container-definitions/index.js +0 -6
  159. package/lib/container-definitions/index.js.map +0 -1
  160. package/lib/container-definitions/runtime.d.ts +0 -12
  161. package/lib/container-definitions/runtime.d.ts.map +0 -1
  162. package/lib/container-definitions/runtime.js +0 -6
  163. package/lib/container-definitions/runtime.js.map +0 -1
@@ -1,137 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { JsonDeserialized, JsonSerializable } from "@fluidframework/core-interfaces/internal";
6
- /**
7
- * While connected, the id of a client within a session.
8
- *
9
- * @internal
10
- */
11
- export type ClientConnectionId = string;
12
- /**
13
- * Common interface between incoming and outgoing extension signals.
14
- *
15
- * @sealed
16
- * @internal
17
- */
18
- export interface IExtensionMessage<TType extends string = string, TContent = unknown> {
19
- /**
20
- * Message type
21
- */
22
- type: TType;
23
- /**
24
- * Message content
25
- */
26
- content: JsonDeserialized<TContent>;
27
- /**
28
- * The client ID that submitted the message.
29
- * For server generated messages the clientId will be null.
30
- */
31
- clientId: ClientConnectionId | null;
32
- /**
33
- * Client ID of the singular client the message is being (or has been) sent to.
34
- * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.
35
- */
36
- targetClientId?: ClientConnectionId;
37
- }
38
- /**
39
- * Defines requirements for a component to register with container as an extension.
40
- *
41
- * @internal
42
- */
43
- export interface IContainerExtension<TContext extends unknown[]> {
44
- /**
45
- * Notifies the extension of a new use context.
46
- *
47
- * @param context - Context new reference to extension is acquired within
48
- */
49
- onNewContext(...context: TContext): void;
50
- /**
51
- * Callback for signal sent by this extension.
52
- *
53
- * @param address - Address of the signal
54
- * @param signal - Signal content and metadata
55
- * @param local - True if signal was sent by this client
56
- */
57
- processSignal?(address: string, signal: IExtensionMessage, local: boolean): void;
58
- }
59
- /**
60
- * Defines the runtime interface an extension may access.
61
- * In most cases this is a subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.
62
- *
63
- * @sealed
64
- * @internal
65
- */
66
- export interface IExtensionRuntime {
67
- /**
68
- * {@inheritdoc @fluidframework/container-runtime-definitions#IContainerRuntime.clientId}
69
- */
70
- get clientId(): ClientConnectionId | undefined;
71
- /**
72
- * Submits a signal to be sent to other clients.
73
- * @param address - Custom address for the signal.
74
- * @param type - Custom type of the signal.
75
- * @param content - Custom content of the signal. Should be a JSON serializable object or primitive via {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}.
76
- * @param targetClientId - When specified, the signal is only sent to the provided client id.
77
- *
78
- * Upon receipt of signal, {@link IContainerExtension.processSignal} will be called with the same
79
- * address, type, and content (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).
80
- */
81
- submitAddressedSignal<T>(address: string, type: string, content: JsonSerializable<T>, targetClientId?: ClientConnectionId): void;
82
- }
83
- /**
84
- * Factory method to create an extension instance.
85
- *
86
- * Any such method provided to {@link ContainerExtensionStore.acquireExtension}
87
- * must use the same value for a given {@link ContainerExtensionId} so that an
88
- * `instanceof` check may be performed at runtime.
89
- *
90
- * @typeParam T - Type of extension to create
91
- * @typeParam TContext - Array of optional custom context
92
- *
93
- * @param runtime - Runtime for extension to work against
94
- * @param context - Custom context for extension.
95
- * @returns Record providing:
96
- * `interface` instance (type `T`) that is provided to caller of
97
- * {@link ContainerExtensionStore.acquireExtension} and
98
- * `extension` store/runtime uses to interact with extension.
99
- *
100
- * @internal
101
- */
102
- export type ContainerExtensionFactory<T, TContext extends unknown[]> = new (runtime: IExtensionRuntime, ...context: TContext) => {
103
- readonly interface: T;
104
- readonly extension: IContainerExtension<TContext>;
105
- };
106
- /**
107
- * Unique identifier for extension
108
- *
109
- * @remarks
110
- * A string known to all clients working with a certain ContainerExtension and unique
111
- * among ContainerExtensions. Not `/` may be used in the string. Recommend using
112
- * concatenation of: type of unique identifier, `:` (required), and unique identifier.
113
- *
114
- * @example Examples
115
- * ```typescript
116
- * "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
117
- * "name:@foo-scope_bar:v1"
118
- * ```
119
- *
120
- * @internal
121
- */
122
- export type ContainerExtensionId = `${string}:${string}`;
123
- /**
124
- * @sealed
125
- * @internal
126
- */
127
- export interface ContainerExtensionStore {
128
- /**
129
- * Acquires an extension from store or adds new one.
130
- *
131
- * @param id - Identifier for the requested extension
132
- * @param factory - Factory to create the extension if not found
133
- * @returns The extension
134
- */
135
- acquireExtension<T, TContext extends unknown[]>(id: ContainerExtensionId, factory: ContainerExtensionFactory<T, TContext>, ...context: TContext): T;
136
- }
137
- //# sourceMappingURL=containerExtensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"containerExtensions.d.ts","sourceRoot":"","sources":["../../src/container-definitions/containerExtensions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,0CAA0C,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAG,OAAO;IACnF;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEpC;;;OAGG;IAEH,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEpC;;;OAGG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,OAAO,EAAE;IAC9D;;;;OAIG;IACH,YAAY,CAAC,GAAG,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEzC;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACjF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,IAAI,QAAQ,IAAI,kBAAkB,GAAG,SAAS,CAAC;IAE/C;;;;;;;;;OASG;IACH,qBAAqB,CAAC,CAAC,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,cAAc,CAAC,EAAE,kBAAkB,GACjC,IAAI,CAAC;CACR;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,EAAE,IAAI,KACtE,OAAO,EAAE,iBAAiB,EAC1B,GAAG,OAAO,EAAE,QAAQ,KAChB;IAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;CAAE,CAAC;AAElF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,oBAAoB,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,EAAE,EAC7C,EAAE,EAAE,oBAAoB,EACxB,OAAO,EAAE,yBAAyB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC/C,GAAG,OAAO,EAAE,QAAQ,GAClB,CAAC,CAAC;CACL"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=containerExtensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"containerExtensions.js","sourceRoot":"","sources":["../../src/container-definitions/containerExtensions.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\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * While connected, the id of a client within a session.\n *\n * @internal\n */\nexport type ClientConnectionId = string;\n\n/**\n * Common interface between incoming and outgoing extension signals.\n *\n * @sealed\n * @internal\n */\nexport interface IExtensionMessage<TType extends string = string, TContent = unknown> {\n\t/**\n\t * Message type\n\t */\n\ttype: TType;\n\n\t/**\n\t * Message content\n\t */\n\tcontent: JsonDeserialized<TContent>;\n\n\t/**\n\t * The client ID that submitted the message.\n\t * For server generated messages the clientId will be null.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tclientId: ClientConnectionId | null;\n\n\t/**\n\t * Client ID of the singular client the message is being (or has been) sent to.\n\t * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.\n\t */\n\ttargetClientId?: ClientConnectionId;\n}\n\n/**\n * Defines requirements for a component to register with container as an extension.\n *\n * @internal\n */\nexport interface IContainerExtension<TContext extends unknown[]> {\n\t/**\n\t * Notifies the extension of a new use context.\n\t *\n\t * @param context - Context new reference to extension is acquired within\n\t */\n\tonNewContext(...context: TContext): void;\n\n\t/**\n\t * Callback for signal sent by this extension.\n\t *\n\t * @param address - Address of the signal\n\t * @param signal - Signal content and metadata\n\t * @param local - True if signal was sent by this client\n\t */\n\tprocessSignal?(address: string, signal: IExtensionMessage, local: boolean): void;\n}\n\n/**\n * Defines the runtime interface an extension may access.\n * In most cases this is a subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.\n *\n * @sealed\n * @internal\n */\nexport interface IExtensionRuntime {\n\t/**\n\t * {@inheritdoc @fluidframework/container-runtime-definitions#IContainerRuntime.clientId}\n\t */\n\tget clientId(): ClientConnectionId | undefined;\n\n\t/**\n\t * Submits a signal to be sent to other clients.\n\t * @param address - Custom address for the signal.\n\t * @param type - Custom type of the signal.\n\t * @param content - Custom content of the signal. Should be a JSON serializable object or primitive via {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t *\n\t * Upon receipt of signal, {@link IContainerExtension.processSignal} will be called with the same\n\t * address, type, and content (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).\n\t */\n\tsubmitAddressedSignal<T>(\n\t\taddress: string,\n\t\ttype: string,\n\t\tcontent: JsonSerializable<T>,\n\t\ttargetClientId?: ClientConnectionId,\n\t): void;\n}\n\n/**\n * Factory method to create an extension instance.\n *\n * Any such method provided to {@link ContainerExtensionStore.acquireExtension}\n * must use the same value for a given {@link ContainerExtensionId} so that an\n * `instanceof` check may be performed at runtime.\n *\n * @typeParam T - Type of extension to create\n * @typeParam TContext - Array of optional custom context\n *\n * @param runtime - Runtime for extension to work against\n * @param context - Custom context for extension.\n * @returns Record providing:\n * `interface` instance (type `T`) that is provided to caller of\n * {@link ContainerExtensionStore.acquireExtension} and\n * `extension` store/runtime uses to interact with extension.\n *\n * @internal\n */\nexport type ContainerExtensionFactory<T, TContext extends unknown[]> = new (\n\truntime: IExtensionRuntime,\n\t...context: TContext\n) => { readonly interface: T; readonly extension: IContainerExtension<TContext> };\n\n/**\n * Unique identifier for extension\n *\n * @remarks\n * A string known to all clients working with a certain ContainerExtension and unique\n * among ContainerExtensions. Not `/` may be used in the string. Recommend using\n * concatenation of: type of unique identifier, `:` (required), and unique identifier.\n *\n * @example Examples\n * ```typescript\n * \"guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1\"\n * \"name:@foo-scope_bar:v1\"\n * ```\n *\n * @internal\n */\nexport type ContainerExtensionId = `${string}:${string}`;\n\n/**\n * @sealed\n * @internal\n */\nexport interface ContainerExtensionStore {\n\t/**\n\t * Acquires an extension from store or adds new one.\n\t *\n\t * @param id - Identifier for the requested extension\n\t * @param factory - Factory to create the extension if not found\n\t * @returns The extension\n\t */\n\tacquireExtension<T, TContext extends unknown[]>(\n\t\tid: ContainerExtensionId,\n\t\tfactory: ContainerExtensionFactory<T, TContext>,\n\t\t...context: TContext\n\t): T;\n}\n"]}
@@ -1,7 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export type { IRuntimeInternal } from "./runtime.js";
6
- export type * from "./containerExtensions.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container-definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,mBAAmB,0BAA0B,CAAC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/container-definitions/index.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IRuntimeInternal } from \"./runtime.js\";\n\n// eslint-disable-next-line no-restricted-syntax\nexport type * from \"./containerExtensions.js\";\n"]}
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { IRuntime } from "@fluidframework/container-definitions/internal";
6
- import type { ContainerExtensionStore } from "./containerExtensions.js";
7
- /**
8
- * @internal
9
- */
10
- export interface IRuntimeInternal extends IRuntime, ContainerExtensionStore {
11
- }
12
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/container-definitions/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ,EAAE,uBAAuB;CAAG"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /*!
3
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
- * Licensed under the MIT License.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/container-definitions/runtime.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 { IRuntime } from \"@fluidframework/container-definitions/internal\";\n\nimport type { ContainerExtensionStore } from \"./containerExtensions.js\";\n\n/**\n * @internal\n */\nexport interface IRuntimeInternal extends IRuntime, ContainerExtensionStore {}\n"]}
@@ -1,137 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { JsonDeserialized, JsonSerializable } from "@fluidframework/core-interfaces/internal";
6
- /**
7
- * While connected, the id of a client within a session.
8
- *
9
- * @internal
10
- */
11
- export type ClientConnectionId = string;
12
- /**
13
- * Common interface between incoming and outgoing extension signals.
14
- *
15
- * @sealed
16
- * @internal
17
- */
18
- export interface IExtensionMessage<TType extends string = string, TContent = unknown> {
19
- /**
20
- * Message type
21
- */
22
- type: TType;
23
- /**
24
- * Message content
25
- */
26
- content: JsonDeserialized<TContent>;
27
- /**
28
- * The client ID that submitted the message.
29
- * For server generated messages the clientId will be null.
30
- */
31
- clientId: ClientConnectionId | null;
32
- /**
33
- * Client ID of the singular client the message is being (or has been) sent to.
34
- * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.
35
- */
36
- targetClientId?: ClientConnectionId;
37
- }
38
- /**
39
- * Defines requirements for a component to register with container as an extension.
40
- *
41
- * @internal
42
- */
43
- export interface IContainerExtension<TContext extends unknown[]> {
44
- /**
45
- * Notifies the extension of a new use context.
46
- *
47
- * @param context - Context new reference to extension is acquired within
48
- */
49
- onNewContext(...context: TContext): void;
50
- /**
51
- * Callback for signal sent by this extension.
52
- *
53
- * @param address - Address of the signal
54
- * @param signal - Signal content and metadata
55
- * @param local - True if signal was sent by this client
56
- */
57
- processSignal?(address: string, signal: IExtensionMessage, local: boolean): void;
58
- }
59
- /**
60
- * Defines the runtime interface an extension may access.
61
- * In most cases this is a subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.
62
- *
63
- * @sealed
64
- * @internal
65
- */
66
- export interface IExtensionRuntime {
67
- /**
68
- * {@inheritdoc @fluidframework/container-runtime-definitions#IContainerRuntime.clientId}
69
- */
70
- get clientId(): ClientConnectionId | undefined;
71
- /**
72
- * Submits a signal to be sent to other clients.
73
- * @param address - Custom address for the signal.
74
- * @param type - Custom type of the signal.
75
- * @param content - Custom content of the signal. Should be a JSON serializable object or primitive via {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}.
76
- * @param targetClientId - When specified, the signal is only sent to the provided client id.
77
- *
78
- * Upon receipt of signal, {@link IContainerExtension.processSignal} will be called with the same
79
- * address, type, and content (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).
80
- */
81
- submitAddressedSignal<T>(address: string, type: string, content: JsonSerializable<T>, targetClientId?: ClientConnectionId): void;
82
- }
83
- /**
84
- * Factory method to create an extension instance.
85
- *
86
- * Any such method provided to {@link ContainerExtensionStore.acquireExtension}
87
- * must use the same value for a given {@link ContainerExtensionId} so that an
88
- * `instanceof` check may be performed at runtime.
89
- *
90
- * @typeParam T - Type of extension to create
91
- * @typeParam TContext - Array of optional custom context
92
- *
93
- * @param runtime - Runtime for extension to work against
94
- * @param context - Custom context for extension.
95
- * @returns Record providing:
96
- * `interface` instance (type `T`) that is provided to caller of
97
- * {@link ContainerExtensionStore.acquireExtension} and
98
- * `extension` store/runtime uses to interact with extension.
99
- *
100
- * @internal
101
- */
102
- export type ContainerExtensionFactory<T, TContext extends unknown[]> = new (runtime: IExtensionRuntime, ...context: TContext) => {
103
- readonly interface: T;
104
- readonly extension: IContainerExtension<TContext>;
105
- };
106
- /**
107
- * Unique identifier for extension
108
- *
109
- * @remarks
110
- * A string known to all clients working with a certain ContainerExtension and unique
111
- * among ContainerExtensions. Not `/` may be used in the string. Recommend using
112
- * concatenation of: type of unique identifier, `:` (required), and unique identifier.
113
- *
114
- * @example Examples
115
- * ```typescript
116
- * "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
117
- * "name:@foo-scope_bar:v1"
118
- * ```
119
- *
120
- * @internal
121
- */
122
- export type ContainerExtensionId = `${string}:${string}`;
123
- /**
124
- * @sealed
125
- * @internal
126
- */
127
- export interface ContainerExtensionStore {
128
- /**
129
- * Acquires an extension from store or adds new one.
130
- *
131
- * @param id - Identifier for the requested extension
132
- * @param factory - Factory to create the extension if not found
133
- * @returns The extension
134
- */
135
- acquireExtension<T, TContext extends unknown[]>(id: ContainerExtensionId, factory: ContainerExtensionFactory<T, TContext>, ...context: TContext): T;
136
- }
137
- //# sourceMappingURL=containerExtensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"containerExtensions.d.ts","sourceRoot":"","sources":["../../src/container-definitions/containerExtensions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,0CAA0C,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAG,OAAO;IACnF;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEpC;;;OAGG;IAEH,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEpC;;;OAGG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,OAAO,EAAE;IAC9D;;;;OAIG;IACH,YAAY,CAAC,GAAG,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEzC;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACjF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,IAAI,QAAQ,IAAI,kBAAkB,GAAG,SAAS,CAAC;IAE/C;;;;;;;;;OASG;IACH,qBAAqB,CAAC,CAAC,EACtB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,cAAc,CAAC,EAAE,kBAAkB,GACjC,IAAI,CAAC;CACR;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,EAAE,IAAI,KACtE,OAAO,EAAE,iBAAiB,EAC1B,GAAG,OAAO,EAAE,QAAQ,KAChB;IAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;CAAE,CAAC;AAElF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,oBAAoB,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,EAAE,QAAQ,SAAS,OAAO,EAAE,EAC7C,EAAE,EAAE,oBAAoB,EACxB,OAAO,EAAE,yBAAyB,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC/C,GAAG,OAAO,EAAE,QAAQ,GAClB,CAAC,CAAC;CACL"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export {};
6
- //# sourceMappingURL=containerExtensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"containerExtensions.js","sourceRoot":"","sources":["../../src/container-definitions/containerExtensions.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\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * While connected, the id of a client within a session.\n *\n * @internal\n */\nexport type ClientConnectionId = string;\n\n/**\n * Common interface between incoming and outgoing extension signals.\n *\n * @sealed\n * @internal\n */\nexport interface IExtensionMessage<TType extends string = string, TContent = unknown> {\n\t/**\n\t * Message type\n\t */\n\ttype: TType;\n\n\t/**\n\t * Message content\n\t */\n\tcontent: JsonDeserialized<TContent>;\n\n\t/**\n\t * The client ID that submitted the message.\n\t * For server generated messages the clientId will be null.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tclientId: ClientConnectionId | null;\n\n\t/**\n\t * Client ID of the singular client the message is being (or has been) sent to.\n\t * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.\n\t */\n\ttargetClientId?: ClientConnectionId;\n}\n\n/**\n * Defines requirements for a component to register with container as an extension.\n *\n * @internal\n */\nexport interface IContainerExtension<TContext extends unknown[]> {\n\t/**\n\t * Notifies the extension of a new use context.\n\t *\n\t * @param context - Context new reference to extension is acquired within\n\t */\n\tonNewContext(...context: TContext): void;\n\n\t/**\n\t * Callback for signal sent by this extension.\n\t *\n\t * @param address - Address of the signal\n\t * @param signal - Signal content and metadata\n\t * @param local - True if signal was sent by this client\n\t */\n\tprocessSignal?(address: string, signal: IExtensionMessage, local: boolean): void;\n}\n\n/**\n * Defines the runtime interface an extension may access.\n * In most cases this is a subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.\n *\n * @sealed\n * @internal\n */\nexport interface IExtensionRuntime {\n\t/**\n\t * {@inheritdoc @fluidframework/container-runtime-definitions#IContainerRuntime.clientId}\n\t */\n\tget clientId(): ClientConnectionId | undefined;\n\n\t/**\n\t * Submits a signal to be sent to other clients.\n\t * @param address - Custom address for the signal.\n\t * @param type - Custom type of the signal.\n\t * @param content - Custom content of the signal. Should be a JSON serializable object or primitive via {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t *\n\t * Upon receipt of signal, {@link IContainerExtension.processSignal} will be called with the same\n\t * address, type, and content (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).\n\t */\n\tsubmitAddressedSignal<T>(\n\t\taddress: string,\n\t\ttype: string,\n\t\tcontent: JsonSerializable<T>,\n\t\ttargetClientId?: ClientConnectionId,\n\t): void;\n}\n\n/**\n * Factory method to create an extension instance.\n *\n * Any such method provided to {@link ContainerExtensionStore.acquireExtension}\n * must use the same value for a given {@link ContainerExtensionId} so that an\n * `instanceof` check may be performed at runtime.\n *\n * @typeParam T - Type of extension to create\n * @typeParam TContext - Array of optional custom context\n *\n * @param runtime - Runtime for extension to work against\n * @param context - Custom context for extension.\n * @returns Record providing:\n * `interface` instance (type `T`) that is provided to caller of\n * {@link ContainerExtensionStore.acquireExtension} and\n * `extension` store/runtime uses to interact with extension.\n *\n * @internal\n */\nexport type ContainerExtensionFactory<T, TContext extends unknown[]> = new (\n\truntime: IExtensionRuntime,\n\t...context: TContext\n) => { readonly interface: T; readonly extension: IContainerExtension<TContext> };\n\n/**\n * Unique identifier for extension\n *\n * @remarks\n * A string known to all clients working with a certain ContainerExtension and unique\n * among ContainerExtensions. Not `/` may be used in the string. Recommend using\n * concatenation of: type of unique identifier, `:` (required), and unique identifier.\n *\n * @example Examples\n * ```typescript\n * \"guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1\"\n * \"name:@foo-scope_bar:v1\"\n * ```\n *\n * @internal\n */\nexport type ContainerExtensionId = `${string}:${string}`;\n\n/**\n * @sealed\n * @internal\n */\nexport interface ContainerExtensionStore {\n\t/**\n\t * Acquires an extension from store or adds new one.\n\t *\n\t * @param id - Identifier for the requested extension\n\t * @param factory - Factory to create the extension if not found\n\t * @returns The extension\n\t */\n\tacquireExtension<T, TContext extends unknown[]>(\n\t\tid: ContainerExtensionId,\n\t\tfactory: ContainerExtensionFactory<T, TContext>,\n\t\t...context: TContext\n\t): T;\n}\n"]}
@@ -1,7 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export type { IRuntimeInternal } from "./runtime.js";
6
- export type * from "./containerExtensions.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container-definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,mBAAmB,0BAA0B,CAAC"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export {};
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/container-definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IRuntimeInternal } from \"./runtime.js\";\n\n// eslint-disable-next-line no-restricted-syntax\nexport type * from \"./containerExtensions.js\";\n"]}
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { IRuntime } from "@fluidframework/container-definitions/internal";
6
- import type { ContainerExtensionStore } from "./containerExtensions.js";
7
- /**
8
- * @internal
9
- */
10
- export interface IRuntimeInternal extends IRuntime, ContainerExtensionStore {
11
- }
12
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/container-definitions/runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ,EAAE,uBAAuB;CAAG"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export {};
6
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/container-definitions/runtime.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 { IRuntime } from \"@fluidframework/container-definitions/internal\";\n\nimport type { ContainerExtensionStore } from \"./containerExtensions.js\";\n\n/**\n * @internal\n */\nexport interface IRuntimeInternal extends IRuntime, ContainerExtensionStore {}\n"]}