@fluidframework/presence 2.41.0-338401 → 2.42.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.
- package/README.md +6 -10
- package/dist/alpha.d.ts +18 -14
- package/dist/baseTypes.d.ts +1 -1
- package/dist/baseTypes.js.map +1 -1
- package/dist/beta.d.ts +53 -0
- package/dist/broadcastControls.d.ts +4 -5
- package/dist/broadcastControls.d.ts.map +1 -1
- package/dist/broadcastControls.js +2 -3
- package/dist/broadcastControls.js.map +1 -1
- package/dist/datastorePresenceManagerFactory.d.ts +4 -1
- package/dist/datastorePresenceManagerFactory.d.ts.map +1 -1
- package/dist/datastorePresenceManagerFactory.js +24 -3
- package/dist/datastorePresenceManagerFactory.js.map +1 -1
- package/dist/datastoreSupport.d.ts +7 -2
- package/dist/datastoreSupport.d.ts.map +1 -1
- package/dist/datastoreSupport.js +6 -4
- package/dist/datastoreSupport.js.map +1 -1
- package/dist/experimentalAccess.d.ts +12 -4
- package/dist/experimentalAccess.d.ts.map +1 -1
- package/dist/experimentalAccess.js +24 -17
- package/dist/experimentalAccess.js.map +1 -1
- package/dist/exposedInternalTypes.d.ts +23 -5
- package/dist/exposedInternalTypes.d.ts.map +1 -1
- package/dist/exposedInternalTypes.js +1 -1
- package/dist/exposedInternalTypes.js.map +1 -1
- package/dist/exposedUtilityTypes.d.ts +6 -5
- package/dist/exposedUtilityTypes.d.ts.map +1 -1
- package/dist/exposedUtilityTypes.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +32 -11
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/internalUtils.d.ts +34 -11
- package/dist/internalUtils.d.ts.map +1 -1
- package/dist/internalUtils.js +39 -7
- package/dist/internalUtils.js.map +1 -1
- package/dist/latestMapValueManager.d.ts +36 -15
- package/dist/latestMapValueManager.d.ts.map +1 -1
- package/dist/latestMapValueManager.js +11 -10
- package/dist/latestMapValueManager.js.map +1 -1
- package/dist/latestValueManager.d.ts +21 -7
- package/dist/latestValueManager.d.ts.map +1 -1
- package/dist/latestValueManager.js +21 -10
- package/dist/latestValueManager.js.map +1 -1
- package/dist/latestValueTypes.d.ts +14 -4
- package/dist/latestValueTypes.d.ts.map +1 -1
- package/dist/latestValueTypes.js.map +1 -1
- package/dist/notificationsManager.d.ts +3 -3
- package/dist/notificationsManager.d.ts.map +1 -1
- package/dist/notificationsManager.js +14 -7
- package/dist/notificationsManager.js.map +1 -1
- package/dist/package.json +5 -4
- package/dist/presence.d.ts +26 -13
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js +1 -1
- package/dist/presence.js.map +1 -1
- package/dist/presenceDatastoreManager.d.ts +9 -41
- package/dist/presenceDatastoreManager.d.ts.map +1 -1
- package/dist/presenceDatastoreManager.js +50 -36
- package/dist/presenceDatastoreManager.js.map +1 -1
- package/dist/presenceManager.d.ts +5 -9
- package/dist/presenceManager.d.ts.map +1 -1
- package/dist/presenceManager.js +13 -13
- package/dist/presenceManager.js.map +1 -1
- package/dist/presenceStates.d.ts +9 -14
- package/dist/presenceStates.d.ts.map +1 -1
- package/dist/presenceStates.js +1 -8
- package/dist/presenceStates.js.map +1 -1
- package/dist/protocol.d.ts +99 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +20 -0
- package/dist/protocol.js.map +1 -0
- package/dist/stateDatastore.d.ts +9 -8
- package/dist/stateDatastore.d.ts.map +1 -1
- package/dist/stateDatastore.js +0 -4
- package/dist/stateDatastore.js.map +1 -1
- package/dist/stateFactory.d.ts +1 -1
- package/dist/stateFactory.js +1 -1
- package/dist/stateFactory.js.map +1 -1
- package/dist/systemWorkspace.d.ts +12 -6
- package/dist/systemWorkspace.d.ts.map +1 -1
- package/dist/systemWorkspace.js +14 -4
- package/dist/systemWorkspace.js.map +1 -1
- package/dist/types.d.ts +12 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/valueManager.d.ts +0 -4
- package/dist/valueManager.d.ts.map +1 -1
- package/dist/valueManager.js +0 -4
- package/dist/valueManager.js.map +1 -1
- package/lib/alpha.d.ts +18 -14
- package/lib/baseTypes.d.ts +1 -1
- package/lib/baseTypes.js.map +1 -1
- package/lib/beta.d.ts +53 -0
- package/lib/broadcastControls.d.ts +4 -5
- package/lib/broadcastControls.d.ts.map +1 -1
- package/lib/broadcastControls.js +2 -3
- package/lib/broadcastControls.js.map +1 -1
- package/lib/datastorePresenceManagerFactory.d.ts +4 -1
- package/lib/datastorePresenceManagerFactory.d.ts.map +1 -1
- package/lib/datastorePresenceManagerFactory.js +24 -3
- package/lib/datastorePresenceManagerFactory.js.map +1 -1
- package/lib/datastoreSupport.d.ts +7 -2
- package/lib/datastoreSupport.d.ts.map +1 -1
- package/lib/datastoreSupport.js +6 -4
- package/lib/datastoreSupport.js.map +1 -1
- package/lib/experimentalAccess.d.ts +12 -4
- package/lib/experimentalAccess.d.ts.map +1 -1
- package/lib/experimentalAccess.js +22 -15
- package/lib/experimentalAccess.js.map +1 -1
- package/lib/exposedInternalTypes.d.ts +23 -5
- package/lib/exposedInternalTypes.d.ts.map +1 -1
- package/lib/exposedInternalTypes.js +1 -1
- package/lib/exposedInternalTypes.js.map +1 -1
- package/lib/exposedUtilityTypes.d.ts +6 -5
- package/lib/exposedUtilityTypes.d.ts.map +1 -1
- package/lib/exposedUtilityTypes.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +32 -11
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/internalUtils.d.ts +34 -11
- package/lib/internalUtils.d.ts.map +1 -1
- package/lib/internalUtils.js +35 -6
- package/lib/internalUtils.js.map +1 -1
- package/lib/latestMapValueManager.d.ts +36 -15
- package/lib/latestMapValueManager.d.ts.map +1 -1
- package/lib/latestMapValueManager.js +12 -11
- package/lib/latestMapValueManager.js.map +1 -1
- package/lib/latestValueManager.d.ts +21 -7
- package/lib/latestValueManager.d.ts.map +1 -1
- package/lib/latestValueManager.js +20 -10
- package/lib/latestValueManager.js.map +1 -1
- package/lib/latestValueTypes.d.ts +14 -4
- package/lib/latestValueTypes.d.ts.map +1 -1
- package/lib/latestValueTypes.js.map +1 -1
- package/lib/notificationsManager.d.ts +3 -3
- package/lib/notificationsManager.d.ts.map +1 -1
- package/lib/notificationsManager.js +14 -7
- package/lib/notificationsManager.js.map +1 -1
- package/lib/presence.d.ts +26 -13
- package/lib/presence.d.ts.map +1 -1
- package/lib/presence.js +1 -1
- package/lib/presence.js.map +1 -1
- package/lib/presenceDatastoreManager.d.ts +9 -41
- package/lib/presenceDatastoreManager.d.ts.map +1 -1
- package/lib/presenceDatastoreManager.js +49 -35
- package/lib/presenceDatastoreManager.js.map +1 -1
- package/lib/presenceManager.d.ts +5 -9
- package/lib/presenceManager.d.ts.map +1 -1
- package/lib/presenceManager.js +13 -13
- package/lib/presenceManager.js.map +1 -1
- package/lib/presenceStates.d.ts +9 -14
- package/lib/presenceStates.d.ts.map +1 -1
- package/lib/presenceStates.js +1 -8
- package/lib/presenceStates.js.map +1 -1
- package/lib/protocol.d.ts +99 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +17 -0
- package/lib/protocol.js.map +1 -0
- package/lib/stateDatastore.d.ts +9 -8
- package/lib/stateDatastore.d.ts.map +1 -1
- package/lib/stateDatastore.js +0 -4
- package/lib/stateDatastore.js.map +1 -1
- package/lib/stateFactory.d.ts +1 -1
- package/lib/stateFactory.js +1 -1
- package/lib/stateFactory.js.map +1 -1
- package/lib/systemWorkspace.d.ts +12 -6
- package/lib/systemWorkspace.d.ts.map +1 -1
- package/lib/systemWorkspace.js +14 -4
- package/lib/systemWorkspace.js.map +1 -1
- package/lib/types.d.ts +12 -10
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/valueManager.d.ts +0 -4
- package/lib/valueManager.d.ts.map +1 -1
- package/lib/valueManager.js +0 -4
- package/lib/valueManager.js.map +1 -1
- package/package.json +30 -23
- package/dist/container-definitions/containerExtensions.d.ts +0 -137
- package/dist/container-definitions/containerExtensions.d.ts.map +0 -1
- package/dist/container-definitions/containerExtensions.js +0 -7
- package/dist/container-definitions/containerExtensions.js.map +0 -1
- package/dist/container-definitions/index.d.ts +0 -7
- package/dist/container-definitions/index.d.ts.map +0 -1
- package/dist/container-definitions/index.js +0 -7
- package/dist/container-definitions/index.js.map +0 -1
- package/dist/container-definitions/runtime.d.ts +0 -12
- package/dist/container-definitions/runtime.d.ts.map +0 -1
- package/dist/container-definitions/runtime.js +0 -7
- package/dist/container-definitions/runtime.js.map +0 -1
- package/lib/container-definitions/containerExtensions.d.ts +0 -137
- package/lib/container-definitions/containerExtensions.d.ts.map +0 -1
- package/lib/container-definitions/containerExtensions.js +0 -6
- package/lib/container-definitions/containerExtensions.js.map +0 -1
- package/lib/container-definitions/index.d.ts +0 -7
- package/lib/container-definitions/index.d.ts.map +0 -1
- package/lib/container-definitions/index.js +0 -6
- package/lib/container-definitions/index.js.map +0 -1
- package/lib/container-definitions/runtime.d.ts +0 -12
- package/lib/container-definitions/runtime.d.ts.map +0 -1
- package/lib/container-definitions/runtime.js +0 -6
- package/lib/container-definitions/runtime.js.map +0 -1
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IFluidContainer } from "@fluidframework/fluid-static";
|
|
6
|
-
import type { Presence } from "./presence.js";
|
|
6
|
+
import type { Presence, PresenceWithNotifications } from "./presence.js";
|
|
7
7
|
/**
|
|
8
|
-
* Acquire
|
|
8
|
+
* Acquire a {@link Presence} from a Fluid Container
|
|
9
9
|
* @param fluidContainer - Fluid Container to acquire the map from
|
|
10
|
-
* @returns the Presence
|
|
10
|
+
* @returns the {@link Presence}
|
|
11
|
+
*
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
export declare const getPresence: (fluidContainer: IFluidContainer) => Presence;
|
|
15
|
+
/**
|
|
16
|
+
* Acquire a {@link PresenceWithNotifications} from a Fluid Container
|
|
17
|
+
* @param fluidContainer - Fluid Container to acquire the map from
|
|
18
|
+
* @returns the {@link PresenceWithNotifications}
|
|
11
19
|
*
|
|
12
20
|
* @alpha
|
|
13
21
|
*/
|
|
14
|
-
export declare function
|
|
22
|
+
export declare function getPresenceAlpha(fluidContainer: IFluidContainer): PresenceWithNotifications;
|
|
15
23
|
//# sourceMappingURL=experimentalAccess.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimentalAccess.d.ts","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"experimentalAccess.d.ts","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIpE,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AA6CzE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,CAAC,cAAc,EAAE,eAAe,KAAK,QAA2B,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,eAAe,GAAG,yBAAyB,CAW3F"}
|
|
@@ -5,38 +5,45 @@
|
|
|
5
5
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { isInternalFluidContainer } from "@fluidframework/fluid-static/internal";
|
|
7
7
|
import { createPresenceManager } from "./presenceManager.js";
|
|
8
|
-
function isContainerExtensionStore(manager) {
|
|
9
|
-
return manager.acquireExtension !== undefined;
|
|
10
|
-
}
|
|
11
8
|
/**
|
|
12
9
|
* Common Presence manager for a container
|
|
13
10
|
*/
|
|
14
11
|
class ContainerPresenceManager {
|
|
15
|
-
constructor(
|
|
12
|
+
constructor(host) {
|
|
16
13
|
this.extension = this;
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
this.interface = this.manager = createPresenceManager({
|
|
15
|
+
...host,
|
|
16
|
+
submitSignal: (message) => {
|
|
17
|
+
host.submitAddressedSignal([], message);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
onNewUse() {
|
|
21
22
|
// No-op
|
|
22
23
|
}
|
|
23
|
-
processSignal(
|
|
24
|
-
this.manager.processSignal(
|
|
24
|
+
processSignal(addressChain, message, local) {
|
|
25
|
+
this.manager.processSignal(addressChain, message, local);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
ContainerPresenceManager.extensionId = "dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a";
|
|
28
29
|
/**
|
|
29
|
-
* Acquire
|
|
30
|
+
* Acquire a {@link Presence} from a Fluid Container
|
|
31
|
+
* @param fluidContainer - Fluid Container to acquire the map from
|
|
32
|
+
* @returns the {@link Presence}
|
|
33
|
+
*
|
|
34
|
+
* @beta
|
|
35
|
+
*/
|
|
36
|
+
export const getPresence = getPresenceAlpha;
|
|
37
|
+
/**
|
|
38
|
+
* Acquire a {@link PresenceWithNotifications} from a Fluid Container
|
|
30
39
|
* @param fluidContainer - Fluid Container to acquire the map from
|
|
31
|
-
* @returns the
|
|
40
|
+
* @returns the {@link PresenceWithNotifications}
|
|
32
41
|
*
|
|
33
42
|
* @alpha
|
|
34
43
|
*/
|
|
35
|
-
export function
|
|
44
|
+
export function getPresenceAlpha(fluidContainer) {
|
|
36
45
|
assert(isInternalFluidContainer(fluidContainer), 0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */);
|
|
37
|
-
const
|
|
38
|
-
assert(isContainerExtensionStore(innerContainer), 0xa39 /* Container does not support extensions. Use getPresenceViaDataObject. */);
|
|
39
|
-
const presence = innerContainer.acquireExtension(ContainerPresenceManager.extensionId, ContainerPresenceManager);
|
|
46
|
+
const presence = fluidContainer.acquireExtension(ContainerPresenceManager.extensionId, ContainerPresenceManager);
|
|
40
47
|
return presence;
|
|
41
48
|
}
|
|
42
49
|
//# sourceMappingURL=experimentalAccess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimentalAccess.js","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"experimentalAccess.js","sourceRoot":"","sources":["../src/experimentalAccess.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAKjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D;;GAEG;AACH,MAAM,wBAAwB;IAa7B,YAAmB,IAAmB;QAJtB,cAAS,GAAG,IAAI,CAAC;QAKhC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,GAAG,qBAAqB,CAAC;YACrD,GAAG,IAAI;YACP,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE;gBACzB,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACzC,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;IAEM,QAAQ;QACd,QAAQ;IACT,CAAC;IAIM,aAAa,CACnB,YAAsB,EACtB,OAAgD,EAChD,KAAc;QAEd,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;;AARsB,oCAAW,GAAG,0CAA0C,AAA7C,CAA8C;AAWjF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAkD,gBAAgB,CAAC;AAE3F;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,cAA+B;IAC/D,MAAM,CACL,wBAAwB,CAAC,cAAc,CAAC,EACxC,KAAK,CAAC,yGAAyG,CAC/G,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 {\n\tContainerExtension,\n\tContainerExtensionFactory,\n\tInboundExtensionMessage,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\nimport { isInternalFluidContainer } from \"@fluidframework/fluid-static/internal\";\n\nimport type { ExtensionHost, ExtensionRuntimeProperties } from \"./internalTypes.js\";\nimport type { Presence, PresenceWithNotifications } from \"./presence.js\";\nimport type { PresenceExtensionInterface } from \"./presenceManager.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\nimport type { SignalMessages } from \"./protocol.js\";\n\n/**\n * Common Presence manager for a container\n */\nclass ContainerPresenceManager\n\timplements\n\t\tContainerExtension<ExtensionRuntimeProperties>,\n\t\tInstanceType<\n\t\t\tContainerExtensionFactory<PresenceWithNotifications, ExtensionRuntimeProperties>\n\t\t>\n{\n\t// ContainerExtensionFactory return elements\n\tpublic readonly interface: PresenceWithNotifications;\n\tpublic readonly extension = this;\n\n\tprivate readonly manager: PresenceExtensionInterface;\n\n\tpublic constructor(host: ExtensionHost) {\n\t\tthis.interface = this.manager = createPresenceManager({\n\t\t\t...host,\n\t\t\tsubmitSignal: (message) => {\n\t\t\t\thost.submitAddressedSignal([], message);\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic onNewUse(): void {\n\t\t// No-op\n\t}\n\n\tpublic static readonly extensionId = \"dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a\";\n\n\tpublic processSignal(\n\t\taddressChain: string[],\n\t\tmessage: InboundExtensionMessage<SignalMessages>,\n\t\tlocal: boolean,\n\t): void {\n\t\tthis.manager.processSignal(addressChain, message, local);\n\t}\n}\n\n/**\n * Acquire a {@link Presence} from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the {@link Presence}\n *\n * @beta\n */\nexport const getPresence: (fluidContainer: IFluidContainer) => Presence = getPresenceAlpha;\n\n/**\n * Acquire a {@link PresenceWithNotifications} from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the {@link PresenceWithNotifications}\n *\n * @alpha\n */\nexport function getPresenceAlpha(fluidContainer: IFluidContainer): PresenceWithNotifications {\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\n\tconst presence = fluidContainer.acquireExtension(\n\t\tContainerPresenceManager.extensionId,\n\t\tContainerPresenceManager,\n\t);\n\treturn presence;\n}\n"]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { OpaqueJsonDeserialized } from "@fluidframework/core-interfaces/internal/exposedUtilityTypes";
|
|
6
6
|
/**
|
|
7
7
|
* Collection of value types that are not intended to be used/imported
|
|
8
8
|
* directly outside of this package.
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @beta
|
|
11
11
|
* @system
|
|
12
12
|
*/
|
|
13
13
|
export declare namespace InternalTypes {
|
|
@@ -19,16 +19,34 @@ export declare namespace InternalTypes {
|
|
|
19
19
|
timestamp: number;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
+
* Represents a state that may have a value.
|
|
23
|
+
* And it includes standard metadata.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* See {@link InternalTypes.ValueRequiredState}.
|
|
27
|
+
*
|
|
22
28
|
* @system
|
|
23
29
|
*/
|
|
24
30
|
interface ValueOptionalState<TValue> extends ValueStateMetadata {
|
|
25
|
-
value?:
|
|
31
|
+
value?: OpaqueJsonDeserialized<TValue>;
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
34
|
+
* Represents a state that must have a value.
|
|
35
|
+
* And it includes standard metadata.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The value is wrapped in `OpaqueJsonDeserialized` as uses are expected
|
|
39
|
+
* to involve generic or unknown types that will be filtered. It is here
|
|
40
|
+
* mostly as a convenience to the many such uses that would otherwise
|
|
41
|
+
* need to specify some wrapper themselves.
|
|
42
|
+
*
|
|
43
|
+
* For known cases, construct a custom interface that extends
|
|
44
|
+
* {@link InternalTypes.ValueStateMetadata}.
|
|
45
|
+
*
|
|
28
46
|
* @system
|
|
29
47
|
*/
|
|
30
48
|
interface ValueRequiredState<TValue> extends ValueStateMetadata {
|
|
31
|
-
value:
|
|
49
|
+
value: OpaqueJsonDeserialized<TValue>;
|
|
32
50
|
}
|
|
33
51
|
/**
|
|
34
52
|
* @system
|
|
@@ -97,7 +115,7 @@ export declare namespace InternalTypes {
|
|
|
97
115
|
*/
|
|
98
116
|
interface NotificationType {
|
|
99
117
|
name: string;
|
|
100
|
-
args:
|
|
118
|
+
args: unknown[];
|
|
101
119
|
}
|
|
102
120
|
}
|
|
103
121
|
//# sourceMappingURL=exposedInternalTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedInternalTypes.d.ts","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"exposedInternalTypes.d.ts","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAE3G;;;;;;GAMG;AAEH,yBAAiB,aAAa,CAAC;IAC9B;;OAEG;IACH,UAAiB,kBAAkB;QAClC,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;KAClB;IAED;;;;;;;;OAQG;IACH,UAAiB,kBAAkB,CAAC,MAAM,CAAE,SAAQ,kBAAkB;QACrE,KAAK,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;KACvC;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAiB,kBAAkB,CAAC,MAAM,CAAE,SAAQ,kBAAkB;QACrE,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;KACtC;IAED;;OAEG;IACH,UAAiB,cAAc,CAAC,CAAC;QAChC,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE;YAIN,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;SACnE,CAAC;KACF;IAED;;OAEG;IACH,KAAY,qBAAqB,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAEjF;;OAEG;IACH,UAAiB,aAAa,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM;QAC7D,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE;aAIL,IAAI,IAAI,IAAI,GAAG,kBAAkB,CAAC,CAAC,CAAC;SACrC,CAAC;KACF;IAED;;OAEG;IACH,MAAqB,oBAAoB,CAAC,IAAI,EAAE,MAAM,SAAS,qBAAqB,CAAC,GAAG,CAAC;QACxF,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqC;KAC1E;IAED;;;;;OAKG;IACH,MAAqB,eAAe,CAAC,CAAC;QACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;KAC3C;IAED;;;;;;;;;OASG;IACH,KAAY,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAEnD;;;;OAIG;IACH,KAAY,cAAc,CACzB,IAAI,SAAS,MAAM,EACnB,MAAM,SAAS,qBAAqB,CAAC,GAAG,CAAC,EACzC,QAAQ,IACL;QAAE,YAAY,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;KAAE,GAAG,CAAC,CACpD,GAAG,EAAE,IAAI,EACT,eAAe,EAAE,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,KAC/C;QACJ,WAAW,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;QAC9E,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;KAC9B,CAAC,CAAC;IAEH;;OAEG;IACH,UAAiB,gBAAgB;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,OAAO,EAAE,CAAC;KAChB;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedInternalTypes.js","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"exposedInternalTypes.js","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;GAMG;AACH,2DAA2D;AAC3D,MAAM,KAAW,aAAa,CA6H7B;AA7HD,WAAiB,aAAa;AA6H9B,CAAC,EA7HgB,aAAa,KAAb,aAAa,QA6H7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { OpaqueJsonDeserialized } 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 * @beta\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 * Represents a state that may have a value.\n\t * And it includes standard metadata.\n\t *\n\t * @remarks\n\t * See {@link InternalTypes.ValueRequiredState}.\n\t *\n\t * @system\n\t */\n\texport interface ValueOptionalState<TValue> extends ValueStateMetadata {\n\t\tvalue?: OpaqueJsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * Represents a state that must have a value.\n\t * And it includes standard metadata.\n\t *\n\t * @remarks\n\t * The value is wrapped in `OpaqueJsonDeserialized` as uses are expected\n\t * to involve generic or unknown types that will be filtered. It is here\n\t * mostly as a convenience to the many such uses that would otherwise\n\t * need to specify some wrapper themselves.\n\t *\n\t * For known cases, construct a custom interface that extends\n\t * {@link InternalTypes.ValueStateMetadata}.\n\t *\n\t * @system\n\t */\n\texport interface ValueRequiredState<TValue> extends ValueStateMetadata {\n\t\tvalue: OpaqueJsonDeserialized<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: unknown[];\n\t}\n}\n"]}
|
|
@@ -12,11 +12,12 @@ import type { InternalUtilityTypes as CoreInternalUtilityTypes, JsonDeserialized
|
|
|
12
12
|
*/
|
|
13
13
|
export declare namespace InternalUtilityTypes {
|
|
14
14
|
/**
|
|
15
|
-
* `
|
|
15
|
+
* Yields `IfListener` when the given type is an acceptable shape for a notification.
|
|
16
|
+
* `Else` otherwise.
|
|
16
17
|
*
|
|
17
18
|
* @system
|
|
18
19
|
*/
|
|
19
|
-
type
|
|
20
|
+
type IfNotificationListener<Event, IfListener, Else> = Event extends (...args: infer P) => void ? CoreInternalUtilityTypes.IfSameType<P, JsonSerializable<P>, IfListener, Else> : Else;
|
|
20
21
|
/**
|
|
21
22
|
* Used to specify the kinds of notifications emitted by a {@link NotificationListenable}.
|
|
22
23
|
*
|
|
@@ -37,19 +38,19 @@ export declare namespace InternalUtilityTypes {
|
|
|
37
38
|
* @system
|
|
38
39
|
*/
|
|
39
40
|
type NotificationListeners<E> = {
|
|
40
|
-
[P in
|
|
41
|
+
[P in keyof E as IfNotificationListener<E[P], P, never>]: E[P];
|
|
41
42
|
};
|
|
42
43
|
/**
|
|
43
44
|
* {@link @fluidframework/core-interfaces#JsonDeserialized} version of the parameters of a function.
|
|
44
45
|
*
|
|
45
46
|
* @system
|
|
46
47
|
*/
|
|
47
|
-
type JsonDeserializedParameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? JsonDeserialized<P> : never;
|
|
48
|
+
type JsonDeserializedParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? JsonDeserialized<P> : never;
|
|
48
49
|
/**
|
|
49
50
|
* {@link @fluidframework/core-interfaces#JsonSerializable} version of the parameters of a function.
|
|
50
51
|
*
|
|
51
52
|
* @system
|
|
52
53
|
*/
|
|
53
|
-
type JsonSerializableParameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? JsonSerializable<P> : never;
|
|
54
|
+
type JsonSerializableParameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? JsonSerializable<P> : never;
|
|
54
55
|
}
|
|
55
56
|
//# sourceMappingURL=exposedUtilityTypes.d.ts.map
|
|
@@ -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
|
|
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;;;;;OAKG;IACH,KAAY,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,IAAI,KAAK,SAAS,CAC3E,GAAG,IAAI,EAAE,MAAM,CAAC,KACZ,IAAI,GACN,wBAAwB,CAAC,UAAU,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,GAC7E,IAAI,CAAC;IAER;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAY,qBAAqB,CAAC,CAAC,IAAI;SACrC,CAAC,IAAI,MAAM,CAAC,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAC9D,CAAC;IAEF;;;;OAIG;IACH,KAAY,0BAA0B,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,SAAS,CACrF,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,EAAE,KAAK,GAAG,IAAI,CAAC,SAAS,CACrF,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 * `
|
|
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 * Yields `IfListener` when the given type is an acceptable shape for a notification.\n\t * `Else` otherwise.\n\t *\n\t * @system\n\t */\n\texport type IfNotificationListener<Event, IfListener, Else> = Event extends (\n\t\t...args: infer P\n\t) => void\n\t\t? CoreInternalUtilityTypes.IfSameType<P, JsonSerializable<P>, IfListener, Else>\n\t\t: Else;\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 keyof E as IfNotificationListener<E[P], 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
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export type { ClientConnectionId } from "./baseTypes.js";
|
|
13
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";
|
|
14
|
+
export { type Attendee, type AttendeesEvents, type AttendeeId, AttendeeStatus, type Presence, type PresenceEvents, type PresenceWithNotifications, } from "./presence.js";
|
|
15
15
|
export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControls.js";
|
|
16
|
-
export { getPresence } from "./experimentalAccess.js";
|
|
16
|
+
export { getPresence, getPresenceAlpha } from "./experimentalAccess.js";
|
|
17
17
|
export { getPresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
18
18
|
export type { latestMap, LatestMapArguments, LatestMapRaw, LatestMapClientData, LatestMapRawEvents, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, StateMap, } from "./latestMapValueManager.js";
|
|
19
19
|
export type { latest, LatestArguments, LatestRaw, LatestRawEvents, } from "./latestValueManager.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -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,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,
|
|
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,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACN,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EACX,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,8BAA8B,EAC9B,8BAA8B,EAC9B,QAAQ,GACR,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACX,MAAM,EACN,eAAe,EACf,SAAS,EACT,eAAe,GACf,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,gBAAgB,EAChB,UAAU,EACV,cAAc,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,mBAAmB,EACxB,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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { AttendeeStatus, } from "./presence.js";
|
|
6
|
-
export { getPresence } from "./experimentalAccess.js";
|
|
6
|
+
export { getPresence, getPresenceAlpha } from "./experimentalAccess.js";
|
|
7
7
|
export { getPresenceViaDataObject, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
8
8
|
export { Notifications, } from "./notificationsManager.js";
|
|
9
9
|
export { StateFactory } from "./stateFactory.js";
|
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,EAIN,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAId,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,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\ttype PresenceWithNotifications,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport { getPresence, getPresenceAlpha } 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"]}
|
package/lib/internalTypes.d.ts
CHANGED
|
@@ -2,36 +2,57 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
6
|
-
import type { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions/internal";
|
|
5
|
+
import type { ExtensionHost as ContainerExtensionHost } from "@fluidframework/container-runtime-definitions/internal";
|
|
7
6
|
import type { InternalTypes } from "./exposedInternalTypes.js";
|
|
8
7
|
import type { AttendeeId, Attendee } from "./presence.js";
|
|
9
|
-
import type {
|
|
8
|
+
import type { OutboundAcknowledgementMessage, OutboundClientJoinMessage, OutboundDatastoreUpdateMessage, SignalMessages } from "./protocol.js";
|
|
10
9
|
/**
|
|
11
|
-
* @
|
|
10
|
+
* Presence {@link ContainerExtension} version of {@link @fluidframework/container-runtime-definitions#ExtensionRuntimeProperties}
|
|
11
|
+
*/
|
|
12
|
+
export interface ExtensionRuntimeProperties {
|
|
13
|
+
SignalMessages: SignalMessages;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Presence specific ExtensionHost
|
|
17
|
+
*/
|
|
18
|
+
export type ExtensionHost = ContainerExtensionHost<ExtensionRuntimeProperties>;
|
|
19
|
+
/**
|
|
20
|
+
* Basic structure of set of {@link Attendee} records within Presence datastore
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* This is commonly exists per named state in State Managers.
|
|
12
24
|
*/
|
|
13
25
|
export interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {
|
|
14
26
|
[AttendeeId: AttendeeId]: TValue;
|
|
15
27
|
}
|
|
16
28
|
/**
|
|
17
|
-
* This interface is a subset of (
|
|
18
|
-
*
|
|
29
|
+
* This interface is a subset of ExtensionHost (and mostly of
|
|
30
|
+
* FluidDataStoreRuntime) that is needed by the Presence States.
|
|
19
31
|
*
|
|
20
32
|
* @privateRemarks
|
|
21
33
|
* Replace with non-DataStore based interface.
|
|
22
|
-
*
|
|
23
|
-
* @internal
|
|
24
34
|
*/
|
|
25
|
-
export type IEphemeralRuntime =
|
|
35
|
+
export type IEphemeralRuntime = Omit<ExtensionHost, "logger" | "submitAddressedSignal"> & Partial<Pick<ExtensionHost, "logger">> & {
|
|
36
|
+
/**
|
|
37
|
+
* Submits the signal to be sent to other clients.
|
|
38
|
+
* @param type - Type of the signal.
|
|
39
|
+
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
40
|
+
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
41
|
+
*/
|
|
42
|
+
submitSignal: (message: OutboundAcknowledgementMessage | OutboundClientJoinMessage | OutboundDatastoreUpdateMessage) => void;
|
|
43
|
+
};
|
|
26
44
|
/**
|
|
27
|
-
*
|
|
45
|
+
* Contract for State Managers as used by a States Workspace (`PresenceStatesImpl`)
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* See uses of `unbrandIVM`.
|
|
28
49
|
*/
|
|
29
50
|
export interface ValueManager<TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue> = InternalTypes.ValueDirectoryOrState<TValue>> {
|
|
30
51
|
readonly value?: TValueState;
|
|
31
52
|
update(attendee: Attendee, received: number, value: TValueState): PostUpdateAction[];
|
|
32
53
|
}
|
|
33
54
|
/**
|
|
34
|
-
*
|
|
55
|
+
* A function to be called at the end of an update frame
|
|
35
56
|
*/
|
|
36
57
|
export type PostUpdateAction = () => void;
|
|
37
58
|
//# sourceMappingURL=internalTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalTypes.d.ts","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"internalTypes.d.ts","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AAEtH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACX,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C,cAAc,EAAE,cAAc,CAAC;CAC/B;AACD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,aAAa,CAAC,qBAAqB,CAAC,OAAO,CAAC;IAIxF,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;CACjC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,uBAAuB,CAAC,GAEtF,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,GAAG;IACxC;;;;;OAKG;IACH,YAAY,EAAE,CACb,OAAO,EACJ,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,KAC7B,IAAI,CAAC;CACV,CAAC;AAEH;;;;;GAKG;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"}
|
package/lib/internalTypes.js.map
CHANGED
|
@@ -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 {
|
|
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 { ExtensionHost as ContainerExtensionHost } from \"@fluidframework/container-runtime-definitions/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { AttendeeId, Attendee } from \"./presence.js\";\nimport type {\n\tOutboundAcknowledgementMessage,\n\tOutboundClientJoinMessage,\n\tOutboundDatastoreUpdateMessage,\n\tSignalMessages,\n} from \"./protocol.js\";\n\n/**\n * Presence {@link ContainerExtension} version of {@link @fluidframework/container-runtime-definitions#ExtensionRuntimeProperties}\n */\nexport interface ExtensionRuntimeProperties {\n\tSignalMessages: SignalMessages;\n}\n/**\n * Presence specific ExtensionHost\n */\nexport type ExtensionHost = ContainerExtensionHost<ExtensionRuntimeProperties>;\n\n/**\n * Basic structure of set of {@link Attendee} records within Presence datastore\n *\n * @remarks\n * This is commonly exists per named state in State Managers.\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 ExtensionHost (and mostly of\n * FluidDataStoreRuntime) that is needed by the Presence States.\n *\n * @privateRemarks\n * Replace with non-DataStore based interface.\n */\nexport type IEphemeralRuntime = Omit<ExtensionHost, \"logger\" | \"submitAddressedSignal\"> &\n\t// Apart from tests, there is always a logger. So this could be promoted to required.\n\tPartial<Pick<ExtensionHost, \"logger\">> & {\n\t\t/**\n\t\t * Submits the signal to be sent to other clients.\n\t\t * @param type - Type of the signal.\n\t\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t\t */\n\t\tsubmitSignal: (\n\t\t\tmessage:\n\t\t\t\t| OutboundAcknowledgementMessage\n\t\t\t\t| OutboundClientJoinMessage\n\t\t\t\t| OutboundDatastoreUpdateMessage,\n\t\t) => void;\n\t};\n\n/**\n * Contract for State Managers as used by a States Workspace (`PresenceStatesImpl`)\n *\n * @remarks\n * See uses of `unbrandIVM`.\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 * A function to be called at the end of an update frame\n */\nexport type PostUpdateAction = () => void;\n"]}
|
package/lib/internalUtils.d.ts
CHANGED
|
@@ -2,7 +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
|
+
import type { DeepReadonly, JsonDeserialized, JsonSerializable, OpaqueJsonDeserialized, OpaqueJsonSerializable } from "@fluidframework/core-interfaces/internal";
|
|
6
6
|
/**
|
|
7
7
|
* Returns union of types of values in a record.
|
|
8
8
|
*/
|
|
@@ -19,9 +19,12 @@ type RequiredAndNotUndefined<T> = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Object.entries retyped to preserve known keys and their types.
|
|
21
21
|
*
|
|
22
|
-
* @
|
|
22
|
+
* @privateRemarks
|
|
23
|
+
* The is a defect in this utility when a string index appears in the object.
|
|
24
|
+
* In such a case, the only result is `[string, T]`, where `T` is the type
|
|
25
|
+
* of the string index entry.
|
|
23
26
|
*/
|
|
24
|
-
export declare const objectEntries: <T>(o: T) => KeyValuePairs<T>;
|
|
27
|
+
export declare const objectEntries: <const T>(o: T) => KeyValuePairs<T>;
|
|
25
28
|
/**
|
|
26
29
|
* Object.entries retyped to preserve known keys and their types.
|
|
27
30
|
*
|
|
@@ -29,16 +32,12 @@ export declare const objectEntries: <T>(o: T) => KeyValuePairs<T>;
|
|
|
29
32
|
* Given `T` should not contain `undefined` values. If it does, use
|
|
30
33
|
* {@link objectEntries} instead. Without `undefined` values, this
|
|
31
34
|
* typing provides best handling of objects with optional properties.
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
35
|
*/
|
|
35
|
-
export declare const objectEntriesWithoutUndefined: <T>(o: T) => KeyValuePairs<RequiredAndNotUndefined<T>>;
|
|
36
|
+
export declare const objectEntriesWithoutUndefined: <const T>(o: T) => KeyValuePairs<RequiredAndNotUndefined<T>>;
|
|
36
37
|
/**
|
|
37
38
|
* Object.keys retyped to preserve known keys and their types.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
39
|
*/
|
|
41
|
-
export declare const objectKeys: <T>(o: T) => (keyof MapNumberIndicesToStrings<T>)[];
|
|
40
|
+
export declare const objectKeys: <const T>(o: T) => (keyof MapNumberIndicesToStrings<T>)[];
|
|
42
41
|
/**
|
|
43
42
|
* Retrieve a value from a record with the given key, or create a new entry if
|
|
44
43
|
* the key is not in the record.
|
|
@@ -51,10 +50,34 @@ export declare const objectKeys: <T>(o: T) => (keyof MapNumberIndicesToStrings<T
|
|
|
51
50
|
* @returns either the existing value for the given key, or the newly-created
|
|
52
51
|
* value (the result of `defaultValue`)
|
|
53
52
|
*/
|
|
54
|
-
export declare function getOrCreateRecord<K extends string | number | symbol, V>(record: Record<K, V>, key: K, defaultValue: (key: K) => V): V;
|
|
53
|
+
export declare function getOrCreateRecord<const K extends string | number | symbol, const V>(record: Record<K, V>, key: K, defaultValue: (key: K) => V): V;
|
|
55
54
|
/**
|
|
56
|
-
*
|
|
55
|
+
* No-runtime-effect helper to apply deep immutability to a value's type.
|
|
57
56
|
*/
|
|
58
57
|
export declare function asDeeplyReadonly<T>(value: T): DeepReadonly<T>;
|
|
58
|
+
export declare function asDeeplyReadonlyDeserializedJson<T>(value: OpaqueJsonDeserialized<T>): DeepReadonly<JsonDeserialized<T>>;
|
|
59
|
+
export declare function asDeeplyReadonlyDeserializedJson<T>(value: OpaqueJsonDeserialized<T> | undefined): DeepReadonly<JsonDeserialized<T>> | undefined;
|
|
60
|
+
type RevealOpaqueJsonDeserialized<T> = T extends OpaqueJsonDeserialized<infer U> ? JsonDeserialized<U> : {
|
|
61
|
+
[Key in keyof T]: RevealOpaqueJsonDeserialized<T[Key]>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* No-runtime-effect helper to reveal the JSON type from a value's opaque JSON
|
|
65
|
+
* types throughout a structure.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* {@link OpaqueJsonDeserialized} instances will be replaced shallowly such
|
|
69
|
+
* that nested instances are retained.
|
|
70
|
+
*/
|
|
71
|
+
export declare function revealOpaqueJson<T>(value: T): RevealOpaqueJsonDeserialized<T>;
|
|
72
|
+
/**
|
|
73
|
+
* No-runtime-effect helper to automatically cast JSON type to Opaque JSON type
|
|
74
|
+
* at outermost scope.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Types that satisfy {@link JsonSerializable} may also be deserialized. Thus,
|
|
78
|
+
* the return type is both {@link OpaqueJsonSerializable} and
|
|
79
|
+
* {@link OpaqueJsonDeserialized}.
|
|
80
|
+
*/
|
|
81
|
+
export declare function toOpaqueJson<const T>(value: JsonSerializable<T>): OpaqueJsonSerializable<T> & OpaqueJsonDeserialized<T>;
|
|
59
82
|
export {};
|
|
60
83
|
//# sourceMappingURL=internalUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalUtils.d.ts","sourceRoot":"","sources":["../src/internalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"internalUtils.d.ts","sourceRoot":"","sources":["../src/internalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,0CAA0C,CAAC;AAElD;;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;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,eAAkC,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC;AAEnF;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,eACtC,CAAC,KACA,cAAc,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,UAAU,eACnB,CAAC,KACA,CAAC,MAAM,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC,EAClF,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;AAED,wBAAgB,gCAAgC,CAAC,CAAC,EACjD,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAC9B,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,wBAAgB,gCAAgC,CAAC,CAAC,EACjD,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,SAAS,GAC1C,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAWjD,KAAK,4BAA4B,CAAC,CAAC,IAAI,CAAC,SAAS,sBAAsB,CAAC,MAAM,CAAC,CAAC,GAC7E,gBAAgB,CAAC,CAAC,CAAC,GACnB;KAAG,GAAG,IAAI,MAAM,CAAC,GAAG,4BAA4B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,4BAA4B,CAAC,CAAC,CAAC,CAE7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,CAAC,EACnC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACxB,sBAAsB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAEvD"}
|
package/lib/internalUtils.js
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Object.entries retyped to preserve known keys and their types.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @privateRemarks
|
|
9
|
+
* The is a defect in this utility when a string index appears in the object.
|
|
10
|
+
* In such a case, the only result is `[string, T]`, where `T` is the type
|
|
11
|
+
* of the string index entry.
|
|
9
12
|
*/
|
|
10
13
|
export const objectEntries = Object.entries;
|
|
11
14
|
/**
|
|
@@ -15,14 +18,10 @@ export const objectEntries = Object.entries;
|
|
|
15
18
|
* Given `T` should not contain `undefined` values. If it does, use
|
|
16
19
|
* {@link objectEntries} instead. Without `undefined` values, this
|
|
17
20
|
* typing provides best handling of objects with optional properties.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
21
|
*/
|
|
21
22
|
export const objectEntriesWithoutUndefined = Object.entries;
|
|
22
23
|
/**
|
|
23
24
|
* Object.keys retyped to preserve known keys and their types.
|
|
24
|
-
*
|
|
25
|
-
* @internal
|
|
26
25
|
*/
|
|
27
26
|
export const objectKeys = Object.keys;
|
|
28
27
|
/**
|
|
@@ -44,9 +43,39 @@ export function getOrCreateRecord(record, key, defaultValue) {
|
|
|
44
43
|
return record[key];
|
|
45
44
|
}
|
|
46
45
|
/**
|
|
47
|
-
*
|
|
46
|
+
* No-runtime-effect helper to apply deep immutability to a value's type.
|
|
48
47
|
*/
|
|
49
48
|
export function asDeeplyReadonly(value) {
|
|
50
49
|
return value;
|
|
51
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* No-runtime-effect helper to apply deep immutability to a value's opaque JSON
|
|
53
|
+
* type, revealing the JSON type.
|
|
54
|
+
*/
|
|
55
|
+
export function asDeeplyReadonlyDeserializedJson(value) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* No-runtime-effect helper to reveal the JSON type from a value's opaque JSON
|
|
60
|
+
* types throughout a structure.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* {@link OpaqueJsonDeserialized} instances will be replaced shallowly such
|
|
64
|
+
* that nested instances are retained.
|
|
65
|
+
*/
|
|
66
|
+
export function revealOpaqueJson(value) {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* No-runtime-effect helper to automatically cast JSON type to Opaque JSON type
|
|
71
|
+
* at outermost scope.
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* Types that satisfy {@link JsonSerializable} may also be deserialized. Thus,
|
|
75
|
+
* the return type is both {@link OpaqueJsonSerializable} and
|
|
76
|
+
* {@link OpaqueJsonDeserialized}.
|
|
77
|
+
*/
|
|
78
|
+
export function toOpaqueJson(value) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
52
81
|
//# sourceMappingURL=internalUtils.js.map
|