@fluidframework/presence 2.41.0 → 2.43.0-343119
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/dist/broadcastControls.d.ts +2 -3
- 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.map +1 -1
- package/dist/datastorePresenceManagerFactory.js +1 -0
- 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/exposedInternalTypes.d.ts +22 -4
- package/dist/exposedInternalTypes.d.ts.map +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/internalTypes.d.ts +11 -9
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/internalUtils.d.ts +26 -8
- package/dist/internalUtils.d.ts.map +1 -1
- package/dist/internalUtils.js +35 -8
- package/dist/internalUtils.js.map +1 -1
- package/dist/latestMapValueManager.d.ts +28 -7
- package/dist/latestMapValueManager.d.ts.map +1 -1
- package/dist/latestMapValueManager.js +10 -9
- package/dist/latestMapValueManager.js.map +1 -1
- package/dist/latestValueManager.d.ts +17 -3
- package/dist/latestValueManager.d.ts.map +1 -1
- package/dist/latestValueManager.js +20 -9
- package/dist/latestValueManager.js.map +1 -1
- package/dist/latestValueTypes.d.ts +11 -1
- package/dist/latestValueTypes.d.ts.map +1 -1
- package/dist/latestValueTypes.js.map +1 -1
- package/dist/notificationsManager.d.ts +2 -2
- package/dist/notificationsManager.d.ts.map +1 -1
- package/dist/notificationsManager.js +14 -7
- package/dist/notificationsManager.js.map +1 -1
- package/dist/presence.d.ts +7 -5
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js.map +1 -1
- package/dist/presenceDatastoreManager.d.ts +5 -6
- package/dist/presenceDatastoreManager.d.ts.map +1 -1
- package/dist/presenceDatastoreManager.js +19 -7
- package/dist/presenceDatastoreManager.js.map +1 -1
- package/dist/presenceManager.d.ts +0 -4
- package/dist/presenceManager.d.ts.map +1 -1
- package/dist/presenceManager.js +1 -3
- 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 +37 -12
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +7 -3
- package/dist/protocol.js.map +1 -1
- 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/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 +3 -2
- 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/broadcastControls.d.ts +2 -3
- 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.map +1 -1
- package/lib/datastorePresenceManagerFactory.js +1 -0
- 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/exposedInternalTypes.d.ts +22 -4
- package/lib/exposedInternalTypes.d.ts.map +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/internalTypes.d.ts +11 -9
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/internalUtils.d.ts +26 -8
- package/lib/internalUtils.d.ts.map +1 -1
- package/lib/internalUtils.js +31 -7
- package/lib/internalUtils.js.map +1 -1
- package/lib/latestMapValueManager.d.ts +28 -7
- package/lib/latestMapValueManager.d.ts.map +1 -1
- package/lib/latestMapValueManager.js +11 -10
- package/lib/latestMapValueManager.js.map +1 -1
- package/lib/latestValueManager.d.ts +17 -3
- package/lib/latestValueManager.d.ts.map +1 -1
- package/lib/latestValueManager.js +19 -9
- package/lib/latestValueManager.js.map +1 -1
- package/lib/latestValueTypes.d.ts +11 -1
- package/lib/latestValueTypes.d.ts.map +1 -1
- package/lib/latestValueTypes.js.map +1 -1
- package/lib/notificationsManager.d.ts +2 -2
- 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 +7 -5
- package/lib/presence.d.ts.map +1 -1
- package/lib/presence.js.map +1 -1
- package/lib/presenceDatastoreManager.d.ts +5 -6
- package/lib/presenceDatastoreManager.d.ts.map +1 -1
- package/lib/presenceDatastoreManager.js +20 -8
- package/lib/presenceDatastoreManager.js.map +1 -1
- package/lib/presenceManager.d.ts +0 -4
- package/lib/presenceManager.d.ts.map +1 -1
- package/lib/presenceManager.js +1 -3
- 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 +37 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +6 -2
- package/lib/protocol.js.map +1 -1
- 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/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 +3 -2
- 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 +17 -17
|
@@ -44,7 +44,8 @@ declare class ForcedRefreshControl implements Pick<BroadcastControls & {
|
|
|
44
44
|
set forcedRefreshIntervalMs(value: number | undefined);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* @
|
|
47
|
+
* Implements {@link BroadcastControls} for States Managers
|
|
48
|
+
* where returning `undefined` settings are allowed.
|
|
48
49
|
*/
|
|
49
50
|
export declare class OptionalBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
|
|
50
51
|
allowableUpdateLatencyMs: number | undefined;
|
|
@@ -56,8 +57,6 @@ export declare class OptionalBroadcastControl extends ForcedRefreshControl imple
|
|
|
56
57
|
*
|
|
57
58
|
* If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
|
|
58
59
|
* is set to `undefined`, the default will be restored.
|
|
59
|
-
*
|
|
60
|
-
* @internal
|
|
61
60
|
*/
|
|
62
61
|
export declare class RequiredBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
|
|
63
62
|
private readonly defaultAllowableUpdateLatencyMs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcastControls.d.ts","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;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BAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEjC,QAAQ,CAAC,EAAE,wBAAwB;CAItD;AAED;;;;;;GAMG;AACH,qBAAa,wBACZ,SAAQ,oBACR,YAAW,iBAAiB;IAIT,OAAO,CAAC,QAAQ,CAAC,+BAA+B;IAFnE,OAAO,CAAC,yBAAyB,CAAS;gBAEN,+BAA+B,EAAE,MAAM;IAK3E,IAAW,wBAAwB,IAAI,MAAM,CAE5C;IACD,IAAW,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAE5D;CACD"}
|
|
@@ -26,7 +26,8 @@ class ForcedRefreshControl {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* @
|
|
29
|
+
* Implements {@link BroadcastControls} for States Managers
|
|
30
|
+
* where returning `undefined` settings are allowed.
|
|
30
31
|
*/
|
|
31
32
|
class OptionalBroadcastControl extends ForcedRefreshControl {
|
|
32
33
|
constructor(settings) {
|
|
@@ -41,8 +42,6 @@ exports.OptionalBroadcastControl = OptionalBroadcastControl;
|
|
|
41
42
|
*
|
|
42
43
|
* If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
|
|
43
44
|
* is set to `undefined`, the default will be restored.
|
|
44
|
-
*
|
|
45
|
-
* @internal
|
|
46
45
|
*/
|
|
47
46
|
class RequiredBroadcastControl extends ForcedRefreshControl {
|
|
48
47
|
constructor(defaultAllowableUpdateLatencyMs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcastControls.js","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0DH,MAAM,oBAAoB;IASzB,YAAmB,QAAmC;QACrD,mEAAmE;IACpE,CAAC;IAED,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IACD,IAAW,uBAAuB,CAAC,KAAyB;QAC3D,IAAI,KAAK,KAAK,SAAS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oC,+BAAuC;QAC1E,KAAK,EAAE,CAAC;QAD2B,oCAA+B,GAA/B,+BAA+B,CAAQ;QAE1E,IAAI,CAAC,yBAAyB,GAAG,+BAA+B,CAAC;IAClE,CAAC;IAED,IAAW,wBAAwB;QAClC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACvC,CAAC;IACD,IAAW,wBAAwB,CAAC,KAAyB;QAC5D,IAAI,CAAC,yBAAyB,GAAG,KAAK,IAAI,IAAI,CAAC,+BAA+B,CAAC;IAChF,CAAC;CACD;AAjBD,4DAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Common controls for States objects.\n *\n * @sealed\n * @beta\n */\nexport interface BroadcastControls {\n\t/**\n\t * Maximum time in milliseconds that a local value update is allowed\n\t * to remain pending before it must be broadcast.\n\t *\n\t * @remarks\n\t * There is no guarantee of broadcast within time allowed\n\t * as other conditions such as disconnect or service throttling may\n\t * cause a delay.\n\t *\n\t * Setting to `undefined` will restore to a system default.\n\t */\n\tallowableUpdateLatencyMs: number | undefined;\n\n\t/**\n\t * Target time in milliseconds between oldest changed local state\n\t * has been broadcast and forced rebroadcast of all local values.\n\t * A value of less than 10 disables forced refresh.\n\t *\n\t * @privateRemarks\n\t * Any time less than 10 milliseconds is likely to generate too\n\t * many signals. Ideally this feature becomes obsolete as\n\t * we understand the system better and account for holes.\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// forcedRefreshIntervalMs: number | undefined;\n}\n\n/**\n * Value set to configure {@link BroadcastControls}.\n *\n * @beta\n */\nexport interface BroadcastControlSettings {\n\t/**\n\t * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}\n\t *\n\t * @defaultValue 60 [milliseconds]\n\t */\n\treadonly allowableUpdateLatencyMs?: number;\n\n\t/**\n\t * {@inheritdoc BroadcastControls.forcedRefreshIntervalMs}\n\t *\n\t * @defaultValue 0 (disabled)\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// readonly forcedRefreshIntervalMs?: number;\n}\n\nclass ForcedRefreshControl\n\timplements\n\t\tPick<\n\t\t\tBroadcastControls & { forcedRefreshIntervalMs: number | undefined },\n\t\t\t\"forcedRefreshIntervalMs\"\n\t\t>\n{\n\tprivate _forcedRefreshInterval: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\t// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;\n\t}\n\n\tpublic get forcedRefreshIntervalMs(): number | undefined {\n\t\treturn this._forcedRefreshInterval;\n\t}\n\tpublic set forcedRefreshIntervalMs(value: number | undefined) {\n\t\tif (value === undefined) {\n\t\t\tthis._forcedRefreshInterval = undefined;\n\t\t} else {\n\t\t\tthis._forcedRefreshInterval = value >= 10 ? value : undefined;\n\t\t\tif (value >= 10) {\n\t\t\t\t// TODO: enable periodic forced refresh\n\t\t\t\tthrow new Error(\"Forced Refresh feature is not implemented\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} for States Managers\n * where returning `undefined` settings are allowed.\n */\nexport class OptionalBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tpublic allowableUpdateLatencyMs: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\tsuper(settings);\n\t\tthis.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} but always provides defined value for\n * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.\n *\n * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}\n * is set to `undefined`, the default will be restored.\n */\nexport class RequiredBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tprivate _allowableUpdateLatencyMs: number;\n\n\tpublic constructor(private readonly defaultAllowableUpdateLatencyMs: number) {\n\t\tsuper();\n\t\tthis._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;\n\t}\n\n\tpublic get allowableUpdateLatencyMs(): number {\n\t\treturn this._allowableUpdateLatencyMs;\n\t}\n\tpublic set allowableUpdateLatencyMs(value: number | undefined) {\n\t\tthis._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastorePresenceManagerFactory.d.ts","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,KAAK,EAAE,yBAAyB,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"datastorePresenceManagerFactory.d.ts","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,KAAK,EAAE,yBAAyB,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAmE3E;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;CAC/C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,2DAGtC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,sBAAsB,GAAG,QAAQ,CAMxF"}
|
|
@@ -39,6 +39,7 @@ class PresenceManagerDataObject extends datastoreSupport_js_1.LoadableFluidObjec
|
|
|
39
39
|
getQuorum: runtime.getQuorum.bind(runtime),
|
|
40
40
|
getAudience: runtime.getAudience.bind(runtime),
|
|
41
41
|
submitSignal: (message) => runtime.submitSignal(message.type, message.content, message.targetClientId),
|
|
42
|
+
supportedFeatures: new Set() /* We do not implement feature detection here since this is a deprecated path */,
|
|
42
43
|
});
|
|
43
44
|
this.runtime.on("signal", (message, local) => {
|
|
44
45
|
assertSignalMessageIsValid(message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastorePresenceManagerFactory.js","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,+DAA6D;AAM7D,kEAA6D;AAI7D,+DAAmF;AAEnF,6DAA6D;
|
|
1
|
+
{"version":3,"file":"datastorePresenceManagerFactory.js","sourceRoot":"","sources":["../src/datastorePresenceManagerFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,+DAA6D;AAM7D,kEAA6D;AAI7D,+DAAmF;AAEnF,6DAA6D;AAG7D;;GAEG;AACH,SAAS,0BAA0B,CAClC,OAA2E;IAE3E,IAAA,iBAAM,EAAC,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5E,8DAA8D;IAC9D,gFAAgF;AACjF,CAAC;AAED;;GAEG;AACH,MAAM,yBAA0B,SAAQ,yCAAmB;IAKnD,eAAe;QACrB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,+EAA+E;YAC/E,8EAA8E;YAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAA,4BAAa,GAAuB,CAAC;YACpD,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAA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;GAoBG;AACH,SAAgB,wBAAwB,CAAC,aAAqC;IAC7E,IAAI,aAAa,YAAY,yBAAyB,EAAE,CAAC;QACxD,OAAO,aAAa,CAAC,eAAe,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;AACxF,CAAC;AAND,4DAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/*\n * Hacky support for internal datastore based usages.\n */\n\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tExtensionHostEvents,\n\tRawInboundExtensionMessage,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IInboundSignalMessage } from \"@fluidframework/runtime-definitions/internal\";\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\n\nimport { BasicDataStoreFactory, LoadableFluidObject } from \"./datastoreSupport.js\";\nimport type { PresenceWithNotifications as Presence } from \"./presence.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\nimport type { OutboundPresenceMessage, SignalMessages } from \"./protocol.js\";\n\n/**\n * This provides faux validation of the signal message.\n */\nfunction assertSignalMessageIsValid(\n\tmessage: IInboundSignalMessage | RawInboundExtensionMessage<SignalMessages>,\n): asserts message is RawInboundExtensionMessage<SignalMessages> {\n\tassert(message.clientId !== null, 0xa58 /* Signal must have a client ID */);\n\t// The other difference between messages is that `content` for\n\t// RawInboundExtensionMessage is JsonDeserialized and we are fine assuming that.\n}\n\n/**\n * Simple FluidObject holding Presence Manager.\n */\nclass PresenceManagerDataObject extends LoadableFluidObject {\n\t// Creation of presence manager is deferred until first acquisition to avoid\n\t// instantiations and stand-up by Summarizer that has no actual use.\n\tprivate _presenceManager: Presence | undefined;\n\n\tpublic presenceManager(): Presence {\n\t\tif (!this._presenceManager) {\n\t\t\t// TODO: investigate if ContainerExtensionStore (path-based address routing for\n\t\t\t// Signals) is readily detectable here and use that presence manager directly.\n\t\t\tconst runtime = this.runtime;\n\t\t\tconst events = createEmitter<ExtensionHostEvents>();\n\t\t\truntime.on(\"connected\", (clientId) => events.emit(\"connected\", clientId));\n\t\t\truntime.on(\"disconnected\", () => events.emit(\"disconnected\"));\n\n\t\t\tconst manager = createPresenceManager({\n\t\t\t\tisConnected: () => runtime.connected,\n\t\t\t\tgetClientId: () => runtime.clientId,\n\t\t\t\tevents,\n\t\t\t\tgetQuorum: runtime.getQuorum.bind(runtime),\n\t\t\t\tgetAudience: runtime.getAudience.bind(runtime),\n\t\t\t\tsubmitSignal: (message: OutboundPresenceMessage) =>\n\t\t\t\t\truntime.submitSignal(message.type, message.content, message.targetClientId),\n\t\t\t\tsupportedFeatures:\n\t\t\t\t\tnew Set() /* We do not implement feature detection here since this is a deprecated path */,\n\t\t\t});\n\t\t\tthis.runtime.on(\"signal\", (message: IInboundSignalMessage, local: boolean) => {\n\t\t\t\tassertSignalMessageIsValid(message);\n\t\t\t\tmanager.processSignal([], message, local);\n\t\t\t});\n\t\t\tthis._presenceManager = manager;\n\t\t}\n\t\treturn this._presenceManager;\n\t}\n}\n\n/**\n * Factory class to create {@link Presence} in own data store.\n */\nclass PresenceManagerFactory {\n\tpublic is(value: IFluidLoadable | ExperimentalPresenceDO): value is ExperimentalPresenceDO {\n\t\treturn value instanceof PresenceManagerDataObject;\n\t}\n\n\tpublic readonly factory = new BasicDataStoreFactory(\n\t\t\"@fluidframework/presence\",\n\t\tPresenceManagerDataObject,\n\t);\n}\n\n/**\n * Brand for Experimental Presence Data Object.\n *\n * @remarks\n * See {@link getPresenceViaDataObject} for example usage.\n *\n * @deprecated Use {@link getPresence} instead.\n * @sealed\n * @alpha\n */\nexport declare class ExperimentalPresenceDO {\n\tprivate readonly _self: ExperimentalPresenceDO;\n}\n\n/**\n * DataStore based Presence Manager that is used as fallback for preferred Container\n * Extension based version requires registration. Export SharedObjectKind for registration.\n *\n * @deprecated Use {@link getPresence} instead.\n * @alpha\n */\nexport const ExperimentalPresenceManager =\n\tnew PresenceManagerFactory() as unknown as SharedObjectKind<\n\t\tIFluidLoadable & ExperimentalPresenceDO\n\t>;\n\n/**\n * Acquire Presence from a DataStore based Presence Manager\n *\n * @example\n * ```typescript\n * const containerSchema = {\n * \tinitialObjects: {\n * \t\texperimentalPresence: ExperimentalPresenceDO,\n * \t},\n * } satisfies ContainerSchema;\n * ```\n * then\n * ```typescript\n * const presence = getPresenceViaDataObject(\n * \tcontainer.initialObjects.experimentalPresence,\n * \t);\n * ```\n *\n * @deprecated Use {@link getPresence} instead.\n * @alpha\n */\nexport function getPresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): Presence {\n\tif (fluidLoadable instanceof PresenceManagerDataObject) {\n\t\treturn fluidLoadable.presenceManager();\n\t}\n\n\tthrow new Error(\"Incompatible loadable; make sure to use ExperimentalPresenceManager\");\n}\n"]}
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* This module provided collection of minimal (slim) helpers to support
|
|
7
|
+
* DataObject creation for temporary {@link ExperimentalPresenceManager}.
|
|
8
|
+
*/
|
|
5
9
|
import type { FluidObject, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
10
|
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
7
11
|
import { FluidDataStoreRuntime } from "@fluidframework/datastore/internal";
|
|
8
12
|
import type { IFluidDataStoreContext, IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/internal";
|
|
9
13
|
/**
|
|
10
|
-
* @
|
|
14
|
+
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
11
15
|
*/
|
|
12
16
|
export declare class BasicDataStoreFactory<Type extends string> implements IFluidDataStoreFactory {
|
|
13
17
|
readonly type: Type;
|
|
@@ -17,7 +21,8 @@ export declare class BasicDataStoreFactory<Type extends string> implements IFlui
|
|
|
17
21
|
instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
20
|
-
* @
|
|
24
|
+
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
25
|
+
* and {@link IFluidLoadable} requirements.
|
|
21
26
|
*/
|
|
22
27
|
export declare abstract class LoadableFluidObject implements FluidObject, IFluidLoadable {
|
|
23
28
|
protected readonly runtime: FluidDataStoreRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastoreSupport.d.ts","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,cAAc,EAGd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACX,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"datastoreSupport.d.ts","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,KAAK,EACX,WAAW,EACX,cAAc,EAGd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACX,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,8CAA8C,CAAC;AAgCtD;;GAEG;AACH,qBAAa,qBAAqB,CAAC,IAAI,SAAS,MAAM,CAAE,YAAW,sBAAsB;aAMvE,IAAI,EAAE,IAAI;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAN9B,IAAW,sBAAsB,IAAI,sBAAsB,CAE1D;gBAGgB,IAAI,EAAE,IAAI,EACT,YAAY,EAAE,KAAK,OAAO,EAAE,qBAAqB,KAAK,mBAAmB;IAG9E,oBAAoB,CAChC,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,qBAAqB,CAAC;CAiBjC;AAED;;;GAGG;AACH,8BAAsB,mBAAoB,YAAW,WAAW,EAAE,cAAc;IAC5D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,qBAAqB;gBAA9B,OAAO,EAAE,qBAAqB;IAEpE,IAAW,cAAc,IAAI,IAAI,CAEhC;IAED;;OAEG;IACH,IAAW,MAAM,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAMrD;CACD"}
|
package/dist/datastoreSupport.js
CHANGED
|
@@ -9,8 +9,9 @@ const internal_1 = require("@fluidframework/core-utils/internal");
|
|
|
9
9
|
const internal_2 = require("@fluidframework/datastore/internal");
|
|
10
10
|
const internal_3 = require("@fluidframework/runtime-utils/internal");
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* the entrypoint Fluid object that is expected to be a
|
|
12
|
+
* `BasicFluidDataStoreRuntime` extends the FluidDataStoreRuntime to provide a request
|
|
13
|
+
* method that routes requests to the entrypoint Fluid object that is expected to be a
|
|
14
|
+
* {@link LoadableFluidObject}.
|
|
14
15
|
*/
|
|
15
16
|
class BasicFluidDataStoreRuntime extends internal_2.FluidDataStoreRuntime {
|
|
16
17
|
async request(request) {
|
|
@@ -33,7 +34,7 @@ class BasicFluidDataStoreRuntime extends internal_2.FluidDataStoreRuntime {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
* @
|
|
37
|
+
* `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.
|
|
37
38
|
*/
|
|
38
39
|
class BasicDataStoreFactory {
|
|
39
40
|
get IFluidDataStoreFactory() {
|
|
@@ -58,7 +59,8 @@ class BasicDataStoreFactory {
|
|
|
58
59
|
}
|
|
59
60
|
exports.BasicDataStoreFactory = BasicDataStoreFactory;
|
|
60
61
|
/**
|
|
61
|
-
* @
|
|
62
|
+
* `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}
|
|
63
|
+
* and {@link IFluidLoadable} requirements.
|
|
62
64
|
*/
|
|
63
65
|
class LoadableFluidObject {
|
|
64
66
|
constructor(runtime) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastoreSupport.js","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"datastoreSupport.js","sourceRoot":"","sources":["../src/datastoreSupport.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,kEAA6D;AAC7D,iEAA2E;AAK3E,qEAA2E;AAE3E;;;;GAIG;AACH,MAAM,0BAA2B,SAAQ,gCAAqB;IAC7C,KAAK,CAAC,OAAO,CAAC,OAAiB;QAC9C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC7B,OAAO,QAAQ,CAAC;QACjB,CAAC;QACD,4DAA4D;QAC5D,4CAA4C;QAC5C,gCAAgC;QAChC,gCAAgC;QAChC,IAAI,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/E,qEAAqE;YACrE,mDAAmD;YACnD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;YAC/C,IAAA,iBAAM,EACL,UAAU,YAAY,mBAAmB,EACzC,KAAK,CAAC,wDAAwD,CAC9D,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AU,CAAC;IAChC,CAAC;CACD;AAjBD,kDAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This module provided collection of minimal (slim) helpers to support\n * DataObject creation for temporary {@link ExperimentalPresenceManager}.\n */\n\nimport type {\n\tFluidObject,\n\tIFluidLoadable,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type { IFluidHandleInternal } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { FluidDataStoreRuntime } from \"@fluidframework/datastore/internal\";\nimport type {\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n/**\n * `BasicFluidDataStoreRuntime` extends the FluidDataStoreRuntime to provide a request\n * method that routes requests to the entrypoint Fluid object that is expected to be a\n * {@link LoadableFluidObject}.\n */\nclass BasicFluidDataStoreRuntime extends FluidDataStoreRuntime {\n\tpublic override async request(request: IRequest): Promise<IResponse> {\n\t\tconst response = await super.request(request);\n\t\tif (response.status !== 404) {\n\t\t\treturn response;\n\t\t}\n\t\t// Return entrypoint object if someone requests it directly.\n\t\t// Direct requests exist from two scenarios:\n\t\t// 1. the request url is a \"/\"\n\t\t// 2. the request url is empty\n\t\tif (request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")) {\n\t\t\t// The provideEntryPoint callback below always returns an instance of\n\t\t\t// LoadableFluidObject. Make sure that is the case.\n\t\t\tconst dataObject = await this.entryPoint.get();\n\t\t\tassert(\n\t\t\t\tdataObject instanceof LoadableFluidObject,\n\t\t\t\t0xa36 /* Data store runtime entryPoint is not expected type */,\n\t\t\t);\n\t\t\treturn { mimeType: \"fluid/object\", status: 200, value: dataObject };\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * `BasicDataStoreFactory` is the factory for creating a {@link BasicFluidDataStoreRuntime}.\n */\nexport class BasicDataStoreFactory<Type extends string> implements IFluidDataStoreFactory {\n\tpublic get IFluidDataStoreFactory(): IFluidDataStoreFactory {\n\t\treturn this;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly type: Type,\n\t\tprivate readonly instanceCtor: new (runtime: FluidDataStoreRuntime) => LoadableFluidObject,\n\t) {}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<FluidDataStoreRuntime> {\n\t\t// Create a new runtime for our data store.\n\t\t// The runtime is what Fluid uses to route to our data store.\n\t\tconst runtime: FluidDataStoreRuntime = new BasicFluidDataStoreRuntime(\n\t\t\tcontext,\n\t\t\t/* ISharedObjectRegistry */ new Map(),\n\t\t\texisting,\n\t\t\t/* provideEntryPoint */ async () => {\n\t\t\t\tassert(instance !== undefined, 0xa37 /* Intended entryPoint is undefined */);\n\t\t\t\treturn instance;\n\t\t\t},\n\t\t);\n\n\t\tconst instance = new this.instanceCtor(runtime);\n\n\t\treturn runtime;\n\t}\n}\n\n/**\n * `LoadableFluidObject` is helper to build a DataObject handling the {@link FluidObject}\n * and {@link IFluidLoadable} requirements.\n */\nexport abstract class LoadableFluidObject implements FluidObject, IFluidLoadable {\n\tpublic constructor(protected readonly runtime: FluidDataStoreRuntime) {}\n\n\tpublic get IFluidLoadable(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Handle to the this Fluid object.\n\t */\n\tpublic get handle(): IFluidHandleInternal<FluidObject> {\n\t\t// BasicDataStoreFactory provides an entryPoint initialization function\n\t\t// to the data store runtime; so, this object should always have access to a\n\t\t// non-null entryPoint.\n\t\tassert(this.runtime.entryPoint !== undefined, 0xa38 /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint;\n\t}\n}\n"]}
|
|
@@ -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 {
|
|
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.
|
|
@@ -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,IAAiB,aAAa,CA6H7B;AA7HD,WAAiB,aAAa;AA6H9B,CAAC,EA7HgB,aAAa,6BAAb,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/dist/internalTypes.d.ts
CHANGED
|
@@ -5,21 +5,22 @@
|
|
|
5
5
|
import type { ExtensionHost as ContainerExtensionHost } from "@fluidframework/container-runtime-definitions/internal";
|
|
6
6
|
import type { InternalTypes } from "./exposedInternalTypes.js";
|
|
7
7
|
import type { AttendeeId, Attendee } from "./presence.js";
|
|
8
|
-
import type { OutboundClientJoinMessage, OutboundDatastoreUpdateMessage, SignalMessages } from "./protocol.js";
|
|
8
|
+
import type { OutboundAcknowledgementMessage, OutboundClientJoinMessage, OutboundDatastoreUpdateMessage, SignalMessages } from "./protocol.js";
|
|
9
9
|
/**
|
|
10
10
|
* Presence {@link ContainerExtension} version of {@link @fluidframework/container-runtime-definitions#ExtensionRuntimeProperties}
|
|
11
|
-
* @internal
|
|
12
11
|
*/
|
|
13
12
|
export interface ExtensionRuntimeProperties {
|
|
14
13
|
SignalMessages: SignalMessages;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
16
|
* Presence specific ExtensionHost
|
|
18
|
-
* @internal
|
|
19
17
|
*/
|
|
20
18
|
export type ExtensionHost = ContainerExtensionHost<ExtensionRuntimeProperties>;
|
|
21
19
|
/**
|
|
22
|
-
* @
|
|
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.
|
|
23
24
|
*/
|
|
24
25
|
export interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {
|
|
25
26
|
[AttendeeId: AttendeeId]: TValue;
|
|
@@ -30,8 +31,6 @@ export interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState
|
|
|
30
31
|
*
|
|
31
32
|
* @privateRemarks
|
|
32
33
|
* Replace with non-DataStore based interface.
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
34
|
*/
|
|
36
35
|
export type IEphemeralRuntime = Omit<ExtensionHost, "logger" | "submitAddressedSignal"> & Partial<Pick<ExtensionHost, "logger">> & {
|
|
37
36
|
/**
|
|
@@ -40,17 +39,20 @@ export type IEphemeralRuntime = Omit<ExtensionHost, "logger" | "submitAddressedS
|
|
|
40
39
|
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
41
40
|
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
42
41
|
*/
|
|
43
|
-
submitSignal: (message: OutboundClientJoinMessage | OutboundDatastoreUpdateMessage) => void;
|
|
42
|
+
submitSignal: (message: OutboundAcknowledgementMessage | OutboundClientJoinMessage | OutboundDatastoreUpdateMessage) => void;
|
|
44
43
|
};
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
45
|
+
* Contract for State Managers as used by a States Workspace (`PresenceStatesImpl`)
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* See uses of `unbrandIVM`.
|
|
47
49
|
*/
|
|
48
50
|
export interface ValueManager<TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue> = InternalTypes.ValueDirectoryOrState<TValue>> {
|
|
49
51
|
readonly value?: TValueState;
|
|
50
52
|
update(attendee: Attendee, received: number, value: TValueState): PostUpdateAction[];
|
|
51
53
|
}
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
55
|
+
* A function to be called at the end of an update frame
|
|
54
56
|
*/
|
|
55
57
|
export type PostUpdateAction = () => void;
|
|
56
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,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,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,MAAM,eAAe,CAAC;AAEvB
|
|
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"}
|
|
@@ -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 { 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\tOutboundClientJoinMessage,\n\tOutboundDatastoreUpdateMessage,\n\tSignalMessages,\n} from \"./protocol.js\";\n\n/**\n * Presence {@link ContainerExtension} version of {@link @fluidframework/container-runtime-definitions#ExtensionRuntimeProperties}\n
|
|
1
|
+
{"version":3,"file":"internalTypes.js","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { 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/dist/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
|
*/
|
|
@@ -23,8 +23,6 @@ type RequiredAndNotUndefined<T> = {
|
|
|
23
23
|
* The is a defect in this utility when a string index appears in the object.
|
|
24
24
|
* In such a case, the only result is `[string, T]`, where `T` is the type
|
|
25
25
|
* of the string index entry.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
26
|
*/
|
|
29
27
|
export declare const objectEntries: <const T>(o: T) => KeyValuePairs<T>;
|
|
30
28
|
/**
|
|
@@ -34,14 +32,10 @@ export declare const objectEntries: <const T>(o: T) => KeyValuePairs<T>;
|
|
|
34
32
|
* Given `T` should not contain `undefined` values. If it does, use
|
|
35
33
|
* {@link objectEntries} instead. Without `undefined` values, this
|
|
36
34
|
* typing provides best handling of objects with optional properties.
|
|
37
|
-
*
|
|
38
|
-
* @internal
|
|
39
35
|
*/
|
|
40
36
|
export declare const objectEntriesWithoutUndefined: <const T>(o: T) => KeyValuePairs<RequiredAndNotUndefined<T>>;
|
|
41
37
|
/**
|
|
42
38
|
* Object.keys retyped to preserve known keys and their types.
|
|
43
|
-
*
|
|
44
|
-
* @internal
|
|
45
39
|
*/
|
|
46
40
|
export declare const objectKeys: <const T>(o: T) => (keyof MapNumberIndicesToStrings<T>)[];
|
|
47
41
|
/**
|
|
@@ -58,8 +52,32 @@ export declare const objectKeys: <const T>(o: T) => (keyof MapNumberIndicesToStr
|
|
|
58
52
|
*/
|
|
59
53
|
export declare function getOrCreateRecord<const K extends string | number | symbol, const V>(record: Record<K, V>, key: K, defaultValue: (key: K) => V): V;
|
|
60
54
|
/**
|
|
61
|
-
*
|
|
55
|
+
* No-runtime-effect helper to apply deep immutability to a value's type.
|
|
62
56
|
*/
|
|
63
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>;
|
|
64
82
|
export {};
|
|
65
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,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