@fluidframework/presence 2.10.0-307399 → 2.11.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 +41 -2
- package/dist/alpha.d.ts +5 -4
- package/dist/broadcastControls.d.ts +70 -0
- package/dist/broadcastControls.d.ts.map +1 -0
- package/dist/broadcastControls.js +61 -0
- package/dist/broadcastControls.js.map +1 -0
- package/dist/exposedInternalTypes.d.ts +4 -1
- package/dist/exposedInternalTypes.d.ts.map +1 -1
- package/dist/exposedInternalTypes.js.map +1 -1
- package/dist/exposedUtilityTypes.d.ts +5 -5
- package/dist/exposedUtilityTypes.d.ts.map +1 -1
- package/dist/exposedUtilityTypes.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +2 -2
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/latestMapValueManager.d.ts +5 -5
- package/dist/latestMapValueManager.d.ts.map +1 -1
- package/dist/latestMapValueManager.js +11 -15
- package/dist/latestMapValueManager.js.map +1 -1
- package/dist/latestValueManager.d.ts +5 -5
- package/dist/latestValueManager.d.ts.map +1 -1
- package/dist/latestValueManager.js +9 -13
- package/dist/latestValueManager.js.map +1 -1
- package/dist/notificationsManager.d.ts +28 -15
- package/dist/notificationsManager.d.ts.map +1 -1
- package/dist/notificationsManager.js +19 -11
- package/dist/notificationsManager.js.map +1 -1
- package/dist/package.json +0 -1
- package/dist/presence.d.ts +5 -3
- package/dist/presence.d.ts.map +1 -1
- package/dist/presence.js.map +1 -1
- package/dist/presenceDatastoreManager.d.ts +19 -5
- package/dist/presenceDatastoreManager.d.ts.map +1 -1
- package/dist/presenceDatastoreManager.js +100 -22
- package/dist/presenceDatastoreManager.js.map +1 -1
- package/dist/presenceManager.d.ts.map +1 -1
- package/dist/presenceManager.js +4 -4
- package/dist/presenceManager.js.map +1 -1
- package/dist/presenceStates.d.ts +29 -4
- package/dist/presenceStates.d.ts.map +1 -1
- package/dist/presenceStates.js +48 -14
- package/dist/presenceStates.js.map +1 -1
- package/dist/stateDatastore.d.ts +13 -3
- package/dist/stateDatastore.d.ts.map +1 -1
- package/dist/stateDatastore.js.map +1 -1
- package/dist/systemWorkspace.d.ts +1 -1
- package/dist/systemWorkspace.d.ts.map +1 -1
- package/dist/systemWorkspace.js.map +1 -1
- package/dist/timerManager.d.ts +37 -0
- package/dist/timerManager.d.ts.map +1 -0
- package/dist/timerManager.js +65 -0
- package/dist/timerManager.js.map +1 -0
- package/dist/types.d.ts +27 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/lib/alpha.d.ts +5 -4
- package/lib/broadcastControls.d.ts +70 -0
- package/lib/broadcastControls.d.ts.map +1 -0
- package/lib/broadcastControls.js +56 -0
- package/lib/broadcastControls.js.map +1 -0
- package/lib/exposedInternalTypes.d.ts +4 -1
- package/lib/exposedInternalTypes.d.ts.map +1 -1
- package/lib/exposedInternalTypes.js.map +1 -1
- package/lib/exposedUtilityTypes.d.ts +5 -5
- package/lib/exposedUtilityTypes.d.ts.map +1 -1
- package/lib/exposedUtilityTypes.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +2 -2
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/latestMapValueManager.d.ts +5 -5
- package/lib/latestMapValueManager.d.ts.map +1 -1
- package/lib/latestMapValueManager.js +10 -14
- package/lib/latestMapValueManager.js.map +1 -1
- package/lib/latestValueManager.d.ts +5 -5
- package/lib/latestValueManager.d.ts.map +1 -1
- package/lib/latestValueManager.js +8 -12
- package/lib/latestValueManager.js.map +1 -1
- package/lib/notificationsManager.d.ts +28 -15
- package/lib/notificationsManager.d.ts.map +1 -1
- package/lib/notificationsManager.js +18 -10
- package/lib/notificationsManager.js.map +1 -1
- package/lib/presence.d.ts +5 -3
- package/lib/presence.d.ts.map +1 -1
- package/lib/presence.js.map +1 -1
- package/lib/presenceDatastoreManager.d.ts +19 -5
- package/lib/presenceDatastoreManager.d.ts.map +1 -1
- package/lib/presenceDatastoreManager.js +101 -23
- package/lib/presenceDatastoreManager.js.map +1 -1
- package/lib/presenceManager.d.ts.map +1 -1
- package/lib/presenceManager.js +3 -3
- package/lib/presenceManager.js.map +1 -1
- package/lib/presenceStates.d.ts +29 -4
- package/lib/presenceStates.d.ts.map +1 -1
- package/lib/presenceStates.js +47 -14
- package/lib/presenceStates.js.map +1 -1
- package/lib/stateDatastore.d.ts +13 -3
- package/lib/stateDatastore.d.ts.map +1 -1
- package/lib/stateDatastore.js.map +1 -1
- package/lib/systemWorkspace.d.ts +1 -1
- package/lib/systemWorkspace.d.ts.map +1 -1
- package/lib/systemWorkspace.js.map +1 -1
- package/lib/timerManager.d.ts +37 -0
- package/lib/timerManager.d.ts.map +1 -0
- package/lib/timerManager.js +61 -0
- package/lib/timerManager.js.map +1 -0
- package/lib/types.d.ts +27 -5
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +19 -23
- package/dist/events/events.d.ts +0 -198
- package/dist/events/events.d.ts.map +0 -1
- package/dist/events/events.js +0 -157
- package/dist/events/events.js.map +0 -1
- package/dist/latestValueControls.d.ts +0 -44
- package/dist/latestValueControls.d.ts.map +0 -1
- package/dist/latestValueControls.js +0 -28
- package/dist/latestValueControls.js.map +0 -1
- package/lib/events/events.d.ts +0 -198
- package/lib/events/events.d.ts.map +0 -1
- package/lib/events/events.js +0 -152
- package/lib/events/events.js.map +0 -1
- package/lib/latestValueControls.d.ts +0 -44
- package/lib/latestValueControls.d.ts.map +0 -1
- package/lib/latestValueControls.js +0 -24
- package/lib/latestValueControls.js.map +0 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Notifications value managers are special case where no data is retained during a
|
|
|
80
80
|
|
|
81
81
|
## Onboarding
|
|
82
82
|
|
|
83
|
-
While this package is developing
|
|
83
|
+
While this package is developing and other Fluid Framework internals are being updated to accommodate it, a temporary Shared Object must be added within container to gain access.
|
|
84
84
|
|
|
85
85
|
```typescript
|
|
86
86
|
import { acquirePresenceViaDataObject, ExperimentalPresenceManager } from "@fluidframework/presence/alpha";
|
|
@@ -124,10 +124,49 @@ presence.getStates("app:v1states", { myState2: Latest({x: true})});
|
|
|
124
124
|
|
|
125
125
|
### Notifications
|
|
126
126
|
|
|
127
|
-
Notifications API is
|
|
127
|
+
Notifications API is partially implemented. All messages are always broadcast even if `unicast` API is used. Type inferences are not working even with a fully specified `initialSubscriptions` value provided to `Notifications` and schema type must be specified explicitly.
|
|
128
128
|
|
|
129
129
|
Notifications are fundamentally unreliable at this time as there are no built-in acknowledgements nor retained state. To prevent most common loss of notifications, always check for connection before sending.
|
|
130
130
|
|
|
131
|
+
### Throttling/grouping
|
|
132
|
+
|
|
133
|
+
Presence updates are grouped together and throttled to prevent flooding the network with messages when presence values are rapidly updated. This means the presence infrastructure will not immediately broadcast updates but will broadcast them after a configurable delay.
|
|
134
|
+
|
|
135
|
+
The `allowableUpdateLatencyMs` property configures how long a local update may be delayed under normal circumstances, enabling grouping with other updates. The default `allowableUpdateLatencyMs` is **60 milliseconds** but may be (1) specified during configuration of a [States Workspace](#states-workspace) or [Value Manager](#value-managers) and/or (2) updated later using the `controls` member of Workspace or Value Manager. [States Workspace](#states-workspace) configuration applies when a Value Manager does not have its own setting.
|
|
136
|
+
|
|
137
|
+
Notifications are never queued; they effectively always have an `allowableUpdateLatencyMs` of 0. However, they may be grouped with other updates that were already queued.
|
|
138
|
+
|
|
139
|
+
Note that due to throttling, clients receiving updates may not see updates for all values set by another. For example,
|
|
140
|
+
with `Latest*ValueManagers`, the only value sent is the value at the time the outgoing grouped message is sent. Previous
|
|
141
|
+
values set by the client will not be broadcast or seen by other clients.
|
|
142
|
+
|
|
143
|
+
#### Example
|
|
144
|
+
|
|
145
|
+
You can configure the grouping and throttling behavior using the `allowableUpdateLatencyMs` property as in the following example:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
// Configure a states workspace
|
|
149
|
+
const stateWorkspace = presence.getStates("app:v1states",
|
|
150
|
+
{
|
|
151
|
+
// This value manager has an allowable latency of 100ms.
|
|
152
|
+
position: Latest({ x: 0, y: 0 }, { allowableUpdateLatencyMs: 100 }),
|
|
153
|
+
// This value manager uses the workspace default.
|
|
154
|
+
count: Latest({ num: 0 }),
|
|
155
|
+
},
|
|
156
|
+
// Specify the default for all value managers in this workspace to 200ms,
|
|
157
|
+
// overriding the default value of 60ms.
|
|
158
|
+
{ allowableUpdateLatencyMs: 200 }
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
// Temporarily set count updates to send as soon as possible
|
|
162
|
+
const countState = stateWorkspace.props.count;
|
|
163
|
+
countState.controls.allowableUpdateLatencyMs = 0;
|
|
164
|
+
countState.local = { num: 5000 };
|
|
165
|
+
|
|
166
|
+
// Reset the update latency to the workspace default
|
|
167
|
+
countState.controls.allowableUpdateLatencyMs = undefined;
|
|
168
|
+
```
|
|
169
|
+
|
|
131
170
|
<!-- AUTO-GENERATED-CONTENT:START (README_FOOTER) -->
|
|
132
171
|
|
|
133
172
|
<!-- prettier-ignore-start -->
|
package/dist/alpha.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Package for client presence within a connected session.
|
|
13
13
|
*
|
|
14
14
|
* See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.
|
|
15
15
|
*
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
20
|
// @alpha APIs
|
|
21
|
+
BroadcastControlSettings,
|
|
22
|
+
BroadcastControls,
|
|
21
23
|
ClientConnectionId,
|
|
22
24
|
ClientSessionId,
|
|
23
25
|
ExperimentalPresenceDO,
|
|
@@ -32,13 +34,12 @@ export {
|
|
|
32
34
|
LatestMapValueManager,
|
|
33
35
|
LatestMapValueManagerEvents,
|
|
34
36
|
LatestValueClientData,
|
|
35
|
-
LatestValueControls,
|
|
36
37
|
LatestValueData,
|
|
37
38
|
LatestValueManager,
|
|
38
39
|
LatestValueManagerEvents,
|
|
39
40
|
LatestValueMetadata,
|
|
40
41
|
NotificationEmitter,
|
|
41
|
-
|
|
42
|
+
NotificationListenable,
|
|
42
43
|
NotificationSubscriptions,
|
|
43
44
|
Notifications,
|
|
44
45
|
NotificationsManager,
|
|
@@ -48,9 +49,9 @@ export {
|
|
|
48
49
|
PresenceNotificationsSchema,
|
|
49
50
|
PresenceStates,
|
|
50
51
|
PresenceStatesEntries,
|
|
51
|
-
PresenceStatesEntry,
|
|
52
52
|
PresenceStatesSchema,
|
|
53
53
|
PresenceWorkspaceAddress,
|
|
54
|
+
PresenceWorkspaceEntry,
|
|
54
55
|
SessionClientStatus,
|
|
55
56
|
ValueMap,
|
|
56
57
|
acquirePresence,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Common controls for Value Managers.
|
|
7
|
+
*
|
|
8
|
+
* @sealed
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
11
|
+
export interface BroadcastControls {
|
|
12
|
+
/**
|
|
13
|
+
* Maximum time in milliseconds that a local value update is allowed
|
|
14
|
+
* to remain pending before it must be broadcast.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* There is no guarantee of broadcast within time allowed
|
|
18
|
+
* as other conditions such as disconnect or service throttling may
|
|
19
|
+
* cause a delay.
|
|
20
|
+
*
|
|
21
|
+
* Setting to `undefined` will restore to a system default.
|
|
22
|
+
*/
|
|
23
|
+
allowableUpdateLatencyMs: number | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Value set to configure {@link BroadcastControls}.
|
|
27
|
+
*
|
|
28
|
+
* @alpha
|
|
29
|
+
*/
|
|
30
|
+
export interface BroadcastControlSettings {
|
|
31
|
+
/**
|
|
32
|
+
* {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue 60 [milliseconds]
|
|
35
|
+
*/
|
|
36
|
+
readonly allowableUpdateLatencyMs?: number;
|
|
37
|
+
}
|
|
38
|
+
declare class ForcedRefreshControl implements Pick<BroadcastControls & {
|
|
39
|
+
forcedRefreshIntervalMs: number | undefined;
|
|
40
|
+
}, "forcedRefreshIntervalMs"> {
|
|
41
|
+
private _forcedRefreshInterval;
|
|
42
|
+
constructor(settings?: BroadcastControlSettings);
|
|
43
|
+
get forcedRefreshIntervalMs(): number | undefined;
|
|
44
|
+
set forcedRefreshIntervalMs(value: number | undefined);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare class OptionalBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
|
|
50
|
+
allowableUpdateLatencyMs: number | undefined;
|
|
51
|
+
constructor(settings?: BroadcastControlSettings);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Implements {@link BroadcastControls} but always provides defined value for
|
|
55
|
+
* {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.
|
|
56
|
+
*
|
|
57
|
+
* If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
|
|
58
|
+
* is set to `undefined`, the default will be restored.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare class RequiredBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
|
|
63
|
+
private readonly defaultAllowableUpdateLatencyMs;
|
|
64
|
+
private _allowableUpdateLatencyMs;
|
|
65
|
+
constructor(defaultAllowableUpdateLatencyMs: number);
|
|
66
|
+
get allowableUpdateLatencyMs(): number;
|
|
67
|
+
set allowableUpdateLatencyMs(value: number | undefined);
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=broadcastControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcastControls.d.ts","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;CAc7C;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CAS3C;AAED,cAAM,oBACL,YACC,IAAI,CACH,iBAAiB,GAAG;IAAE,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EACnE,yBAAyB,CACzB;IAEF,OAAO,CAAC,sBAAsB,CAAqB;gBAEhC,QAAQ,CAAC,EAAE,wBAAwB;IAItD,IAAW,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAEvD;IACD,IAAW,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAU3D;CACD;AAED;;GAEG;AACH,qBAAa,wBACZ,SAAQ,oBACR,YAAW,iBAAiB;IAErB,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEjC,QAAQ,CAAC,EAAE,wBAAwB;CAItD;AAED;;;;;;;;GAQG;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"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.RequiredBroadcastControl = exports.OptionalBroadcastControl = void 0;
|
|
8
|
+
class ForcedRefreshControl {
|
|
9
|
+
constructor(settings) {
|
|
10
|
+
// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;
|
|
11
|
+
}
|
|
12
|
+
get forcedRefreshIntervalMs() {
|
|
13
|
+
return this._forcedRefreshInterval;
|
|
14
|
+
}
|
|
15
|
+
set forcedRefreshIntervalMs(value) {
|
|
16
|
+
if (value === undefined) {
|
|
17
|
+
this._forcedRefreshInterval = undefined;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this._forcedRefreshInterval = value >= 10 ? value : undefined;
|
|
21
|
+
if (value >= 10) {
|
|
22
|
+
// TODO: enable periodic forced refresh
|
|
23
|
+
throw new Error("Forced Refresh feature is not implemented");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
class OptionalBroadcastControl extends ForcedRefreshControl {
|
|
32
|
+
constructor(settings) {
|
|
33
|
+
super(settings);
|
|
34
|
+
this.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.OptionalBroadcastControl = OptionalBroadcastControl;
|
|
38
|
+
/**
|
|
39
|
+
* Implements {@link BroadcastControls} but always provides defined value for
|
|
40
|
+
* {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.
|
|
41
|
+
*
|
|
42
|
+
* If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
|
|
43
|
+
* is set to `undefined`, the default will be restored.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
class RequiredBroadcastControl extends ForcedRefreshControl {
|
|
48
|
+
constructor(defaultAllowableUpdateLatencyMs) {
|
|
49
|
+
super();
|
|
50
|
+
this.defaultAllowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;
|
|
51
|
+
this._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;
|
|
52
|
+
}
|
|
53
|
+
get allowableUpdateLatencyMs() {
|
|
54
|
+
return this._allowableUpdateLatencyMs;
|
|
55
|
+
}
|
|
56
|
+
set allowableUpdateLatencyMs(value) {
|
|
57
|
+
this._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.RequiredBroadcastControl = RequiredBroadcastControl;
|
|
61
|
+
//# sourceMappingURL=broadcastControls.js.map
|
|
@@ -0,0 +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,EAAE,CAAC;YACzB,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;QACzC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,sBAAsB,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YAC9D,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;gBACjB,uCAAuC;gBACvC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC9D,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAED;;GAEG;AACH,MAAa,wBACZ,SAAQ,oBAAoB;IAK5B,YAAmB,QAAmC;QACrD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,wBAAwB,GAAG,QAAQ,EAAE,wBAAwB,CAAC;IACpE,CAAC;CACD;AAVD,4DAUC;AAED;;;;;;;;GAQG;AACH,MAAa,wBACZ,SAAQ,oBAAoB;IAK5B,YAAoC,+BAAuC;QAC1E,KAAK,EAAE,CAAC;QAD2B,oCAA+B,GAA/B,+BAA+B,CAAQ;QAE1E,IAAI,CAAC,yBAAyB,GAAG,+BAA+B,CAAC;IAClE,CAAC;IAED,IAAW,wBAAwB;QAClC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACvC,CAAC;IACD,IAAW,wBAAwB,CAAC,KAAyB;QAC5D,IAAI,CAAC,yBAAyB,GAAG,KAAK,IAAI,IAAI,CAAC,+BAA+B,CAAC;IAChF,CAAC;CACD;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 Value Managers.\n *\n * @sealed\n * @alpha\n */\nexport interface BroadcastControls {\n\t/**\n\t * Maximum time in milliseconds that a local value update is allowed\n\t * to remain pending before it must be broadcast.\n\t *\n\t * @remarks\n\t * There is no guarantee of broadcast within time allowed\n\t * as other conditions such as disconnect or service throttling may\n\t * cause a delay.\n\t *\n\t * Setting to `undefined` will restore to a system default.\n\t */\n\tallowableUpdateLatencyMs: number | undefined;\n\n\t/**\n\t * Target time in milliseconds between oldest changed local state\n\t * has been broadcast and forced rebroadcast of all local values.\n\t * A value of less than 10 disables forced refresh.\n\t *\n\t * @privateRemarks\n\t * Any time less than 10 milliseconds is likely to generate too\n\t * many signals. Ideally this feature becomes obsolete as\n\t * we understand the system better and account for holes.\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// forcedRefreshIntervalMs: number | undefined;\n}\n\n/**\n * Value set to configure {@link BroadcastControls}.\n *\n * @alpha\n */\nexport interface BroadcastControlSettings {\n\t/**\n\t * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}\n\t *\n\t * @defaultValue 60 [milliseconds]\n\t */\n\treadonly allowableUpdateLatencyMs?: number;\n\n\t/**\n\t * {@inheritdoc BroadcastControls.forcedRefreshIntervalMs}\n\t *\n\t * @defaultValue 0 (disabled)\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// readonly forcedRefreshIntervalMs?: number;\n}\n\nclass ForcedRefreshControl\n\timplements\n\t\tPick<\n\t\t\tBroadcastControls & { forcedRefreshIntervalMs: number | undefined },\n\t\t\t\"forcedRefreshIntervalMs\"\n\t\t>\n{\n\tprivate _forcedRefreshInterval: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\t// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;\n\t}\n\n\tpublic get forcedRefreshIntervalMs(): number | undefined {\n\t\treturn this._forcedRefreshInterval;\n\t}\n\tpublic set forcedRefreshIntervalMs(value: number | undefined) {\n\t\tif (value === undefined) {\n\t\t\tthis._forcedRefreshInterval = undefined;\n\t\t} else {\n\t\t\tthis._forcedRefreshInterval = value >= 10 ? value : undefined;\n\t\t\tif (value >= 10) {\n\t\t\t\t// TODO: enable periodic forced refresh\n\t\t\t\tthrow new Error(\"Forced Refresh feature is not implemented\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @internal\n */\nexport class OptionalBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tpublic allowableUpdateLatencyMs: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\tsuper(settings);\n\t\tthis.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} but always provides defined value for\n * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.\n *\n * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}\n * is set to `undefined`, the default will be restored.\n *\n * @internal\n */\nexport class RequiredBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tprivate _allowableUpdateLatencyMs: number;\n\n\tpublic constructor(private readonly defaultAllowableUpdateLatencyMs: number) {\n\t\tsuper();\n\t\tthis._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;\n\t}\n\n\tpublic get allowableUpdateLatencyMs(): number {\n\t\treturn this._allowableUpdateLatencyMs;\n\t}\n\tpublic set allowableUpdateLatencyMs(value: number | undefined) {\n\t\tthis._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;\n\t}\n}\n"]}
|
|
@@ -86,7 +86,10 @@ export declare namespace InternalTypes {
|
|
|
86
86
|
type ManagerFactory<TKey extends string, TValue extends ValueDirectoryOrState<any>, TManager> = {
|
|
87
87
|
instanceBase: new (...args: any[]) => any;
|
|
88
88
|
} & ((key: TKey, datastoreHandle: StateDatastoreHandle<TKey, TValue>) => {
|
|
89
|
-
|
|
89
|
+
initialData?: {
|
|
90
|
+
value: TValue;
|
|
91
|
+
allowableUpdateLatencyMs: number | undefined;
|
|
92
|
+
};
|
|
90
93
|
manager: StateValue<TManager>;
|
|
91
94
|
});
|
|
92
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedInternalTypes.d.ts","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,mDAAmD,CAAC;AAE3D;;;;;;GAMG;AAEH,yBAAiB,aAAa,CAAC;IAC9B;;OAEG;IACH,UAAiB,kBAAkB;QAClC,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,kBAAkB,CAAC,MAA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Aa;AA2G9B,CAAC,EA3GgB,aAAa,6BAAb,aAAa,QA2G7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/presence/internal/core-interfaces\";\n\n/**\n * Collection of value types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalTypes {\n\t/**\n\t * @system\n\t */\n\texport interface ValueStateMetadata {\n\t\trev: number;\n\t\ttimestamp: number;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueOptionalState<TValue> extends ValueStateMetadata {\n\t\tvalue?: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueRequiredState<TValue> extends ValueStateMetadata {\n\t\tvalue: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueDirectory<T> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name: string | number]: ValueOptionalState<T> | ValueDirectory<T>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport type ValueDirectoryOrState<T> = ValueRequiredState<T> | ValueDirectory<T>;\n\n\t/**\n\t * @system\n\t */\n\texport interface MapValueState<T> {\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>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport declare class StateDatastoreHandle<TKey, TValue extends ValueDirectoryOrState<any>> {\n\t\tprivate readonly StateDatastoreHandle: StateDatastoreHandle<TKey, TValue>;\n\t}\n\n\t/**\n\t * Brand to ensure state values internal type safety without revealing\n\t * internals that are subject to change.\n\t *\n\t * @system\n\t */\n\texport declare class StateValueBrand<T> {\n\t\tprivate readonly StateValue: StateValue<T>;\n\t}\n\n\t/**\n\t * This type provides no additional functionality over the type it wraps.\n\t * It is used to ensure type safety within package.\n\t * Users may find it convenient to just use the type it wraps directly.\n\t *\n\t * @privateRemarks\n\t * Checkout filtering omitting unknown from T (`Omit<T,unknown> &`).\n\t *\n\t * @system\n\t */\n\texport type StateValue<T> = T & StateValueBrand<T>;\n\n\t/**\n\t * Package internal function declaration for value manager instantiation.\n\t *\n\t * @system\n\t */\n\texport type ManagerFactory<\n\t\tTKey extends string,\n\t\tTValue extends ValueDirectoryOrState<any>,\n\t\tTManager,\n\t> = { instanceBase: new (...args: any[]) => any } & ((\n\t\tkey: TKey,\n\t\tdatastoreHandle: StateDatastoreHandle<TKey, TValue>,\n\t) => {\n\t\
|
|
1
|
+
{"version":3,"file":"exposedInternalTypes.js","sourceRoot":"","sources":["../src/exposedInternalTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH;;;;;;GAMG;AACH,2DAA2D;AAC3D,IAAiB,aAAa,CA2G7B;AA3GD,WAAiB,aAAa;AA2G9B,CAAC,EA3GgB,aAAa,6BAAb,aAAa,QA2G7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/presence/internal/core-interfaces\";\n\n/**\n * Collection of value types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalTypes {\n\t/**\n\t * @system\n\t */\n\texport interface ValueStateMetadata {\n\t\trev: number;\n\t\ttimestamp: number;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueOptionalState<TValue> extends ValueStateMetadata {\n\t\tvalue?: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueRequiredState<TValue> extends ValueStateMetadata {\n\t\tvalue: JsonDeserialized<TValue>;\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport interface ValueDirectory<T> {\n\t\trev: number;\n\t\titems: {\n\t\t\t// Caution: any particular item may or may not exist\n\t\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t\t[name: string | number]: ValueOptionalState<T> | ValueDirectory<T>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport type ValueDirectoryOrState<T> = ValueRequiredState<T> | ValueDirectory<T>;\n\n\t/**\n\t * @system\n\t */\n\texport interface MapValueState<T> {\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>;\n\t\t};\n\t}\n\n\t/**\n\t * @system\n\t */\n\texport declare class StateDatastoreHandle<TKey, TValue extends ValueDirectoryOrState<any>> {\n\t\tprivate readonly StateDatastoreHandle: StateDatastoreHandle<TKey, TValue>;\n\t}\n\n\t/**\n\t * Brand to ensure state values internal type safety without revealing\n\t * internals that are subject to change.\n\t *\n\t * @system\n\t */\n\texport declare class StateValueBrand<T> {\n\t\tprivate readonly StateValue: StateValue<T>;\n\t}\n\n\t/**\n\t * This type provides no additional functionality over the type it wraps.\n\t * It is used to ensure type safety within package.\n\t * Users may find it convenient to just use the type it wraps directly.\n\t *\n\t * @privateRemarks\n\t * Checkout filtering omitting unknown from T (`Omit<T,unknown> &`).\n\t *\n\t * @system\n\t */\n\texport type StateValue<T> = T & StateValueBrand<T>;\n\n\t/**\n\t * Package internal function declaration for value manager instantiation.\n\t *\n\t * @system\n\t */\n\texport type ManagerFactory<\n\t\tTKey extends string,\n\t\tTValue extends ValueDirectoryOrState<any>,\n\t\tTManager,\n\t> = { instanceBase: new (...args: any[]) => any } & ((\n\t\tkey: TKey,\n\t\tdatastoreHandle: StateDatastoreHandle<TKey, TValue>,\n\t) => {\n\t\tinitialData?: { value: TValue; allowableUpdateLatencyMs: number | undefined };\n\t\tmanager: StateValue<TManager>;\n\t});\n\n\t/**\n\t * @system\n\t */\n\texport interface NotificationType {\n\t\tname: string;\n\t\targs: (JsonSerializable<unknown> & JsonDeserialized<unknown>)[];\n\t}\n}\n"]}
|
|
@@ -24,13 +24,13 @@ export declare namespace InternalUtilityTypes {
|
|
|
24
24
|
*
|
|
25
25
|
* @system
|
|
26
26
|
*/
|
|
27
|
-
type
|
|
27
|
+
type IsNotificationListener<Event> = Event extends (...args: infer P) => void ? CoreInternalUtilityTypes.IfSameType<P, JsonSerializable<P> & JsonDeserialized<P>, true, false> : false;
|
|
28
28
|
/**
|
|
29
|
-
* Used to specify the kinds of notifications emitted by a {@link
|
|
29
|
+
* Used to specify the kinds of notifications emitted by a {@link NotificationListenable}.
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
32
|
*
|
|
33
|
-
* Any object type is a valid
|
|
33
|
+
* Any object type is a valid NotificationListeners, but only the notification-like
|
|
34
34
|
* properties of that type will be included.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
@@ -44,8 +44,8 @@ export declare namespace InternalUtilityTypes {
|
|
|
44
44
|
*
|
|
45
45
|
* @system
|
|
46
46
|
*/
|
|
47
|
-
type
|
|
48
|
-
[P in string & keyof E as
|
|
47
|
+
type NotificationListeners<E> = {
|
|
48
|
+
[P in string & keyof E as IsNotificationListener<E[P]> extends true ? P : never]: E[P];
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* {@link @fluidframework/core-interfaces#JsonDeserialized} version of the parameters of a function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedUtilityTypes.d.ts","sourceRoot":"","sources":["../src/exposedUtil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,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;KACtF,CAAC;IAEF;;;;OAIG;IACH,KAAY,0BAA0B,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,SAAS,CACnF,GAAG,IAAI,EAAE,MAAM,CAAC,KACZ,GAAG,GACL,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;IAET;;;;OAIG;IACH,KAAY,0BAA0B,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,SAAS,CACnF,GAAG,IAAI,EAAE,MAAM,CAAC,KACZ,GAAG,GACL,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exposedUtilityTypes.js","sourceRoot":"","sources":["../src/exposedUtilityTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tInternalUtilityTypes as CoreInternalUtilityTypes,\n\tJsonDeserialized,\n\tJsonSerializable,\n} from \"@fluidframework/presence/internal/core-interfaces\";\n\n/**\n * Collection of utility types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalUtilityTypes {\n\t/**\n\t * Recursively/deeply makes all properties of a type readonly.\n\t *\n\t * @system\n\t */\n\texport type FullyReadonly<T> = {\n\t\treadonly [K in keyof T]: FullyReadonly<T[K]>;\n\t};\n\n\t/**\n\t * `true` iff the given type is an acceptable shape for a notification.\n\t *\n\t * @system\n\t */\n\texport type
|
|
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/presence/internal/core-interfaces\";\n\n/**\n * Collection of utility types that are not intended to be used/imported\n * directly outside of this package.\n *\n * @alpha\n * @system\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InternalUtilityTypes {\n\t/**\n\t * Recursively/deeply makes all properties of a type readonly.\n\t *\n\t * @system\n\t */\n\texport type FullyReadonly<T> = {\n\t\treadonly [K in keyof T]: FullyReadonly<T[K]>;\n\t};\n\n\t/**\n\t * `true` iff the given type is an acceptable shape for a notification.\n\t *\n\t * @system\n\t */\n\texport type IsNotificationListener<Event> = Event extends (...args: infer P) => void\n\t\t? CoreInternalUtilityTypes.IfSameType<\n\t\t\t\tP,\n\t\t\t\tJsonSerializable<P> & JsonDeserialized<P>,\n\t\t\t\ttrue,\n\t\t\t\tfalse\n\t\t\t>\n\t\t: false;\n\n\t/**\n\t * Used to specify the kinds of notifications emitted by a {@link NotificationListenable}.\n\t *\n\t * @remarks\n\t *\n\t * Any object type is a valid NotificationListeners, but only the notification-like\n\t * properties of that type will be included.\n\t *\n\t * @example\n\t *\n\t * ```typescript\n\t * interface MyNotifications {\n\t * load: (user: string, data: IUserData) => void;\n\t * requestPause: (period: number) => void;\n\t * }\n\t * ```\n\t *\n\t * @system\n\t */\n\texport type NotificationListeners<E> = {\n\t\t[P in string & keyof E as IsNotificationListener<E[P]> extends true ? P : never]: E[P];\n\t};\n\n\t/**\n\t * {@link @fluidframework/core-interfaces#JsonDeserialized} version of the parameters of a function.\n\t *\n\t * @system\n\t */\n\texport type JsonDeserializedParameters<T extends (...args: any) => any> = T extends (\n\t\t...args: infer P\n\t) => any\n\t\t? JsonDeserialized<P>\n\t\t: never;\n\n\t/**\n\t * {@link @fluidframework/core-interfaces#JsonSerializable} version of the parameters of a function.\n\t *\n\t * @system\n\t */\n\texport type JsonSerializableParameters<T extends (...args: any) => any> = T extends (\n\t\t...args: infer P\n\t) => any\n\t\t? JsonSerializable<P>\n\t\t: never;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Package for client presence within a connected session.
|
|
7
7
|
*
|
|
8
8
|
* See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.
|
|
9
9
|
*
|
|
10
10
|
* @packageDocumentation
|
|
11
11
|
*/
|
|
12
12
|
export type { ClientConnectionId } from "./baseTypes.js";
|
|
13
|
-
export type { PresenceNotifications, PresenceNotificationsSchema, PresenceStates, PresenceStatesEntries,
|
|
13
|
+
export type { PresenceNotifications, PresenceNotificationsSchema, PresenceStates, PresenceStatesEntries, PresenceStatesSchema, PresenceWorkspaceAddress, PresenceWorkspaceEntry, } from "./types.js";
|
|
14
14
|
export { type ClientSessionId, type IPresence, type ISessionClient, type PresenceEvents, SessionClientStatus, } from "./presence.js";
|
|
15
|
+
export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControls.js";
|
|
15
16
|
export { acquirePresence } from "./experimentalAccess.js";
|
|
16
17
|
export { acquirePresenceViaDataObject, type ExperimentalPresenceDO, ExperimentalPresenceManager, } from "./datastorePresenceManagerFactory.js";
|
|
17
|
-
export type { LatestValueControls } from "./latestValueControls.js";
|
|
18
18
|
export { LatestMap, type LatestMapItemRemovedClientData, type LatestMapItemValueClientData, type LatestMapValueClientData, type LatestMapValueManager, type LatestMapValueManagerEvents, type ValueMap, } from "./latestMapValueManager.js";
|
|
19
19
|
export { Latest, type LatestValueManager, type LatestValueManagerEvents, } from "./latestValueManager.js";
|
|
20
20
|
export type { LatestValueClientData, LatestValueData, LatestValueMetadata, } from "./latestValueTypes.js";
|
|
21
|
-
export { type NotificationEmitter, type
|
|
21
|
+
export { type NotificationEmitter, type NotificationListenable, type NotificationSubscriptions, Notifications, type NotificationsManager, type NotificationsManagerEvents, } from "./notificationsManager.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AASH,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACX,qBAAqB,EACrB,2BAA2B,EAC3B,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,mBAAmB,GACnB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACN,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,2BAA2B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACN,SAAS,EACT,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,QAAQ,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,MAAM,EACN,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACnB,MAAM,uBAAuB,CAAC;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"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6BH,6CAMuB;AADtB,kHAAA,mBAAmB,OAAA;AAQpB,iEAA0D;AAAjD,wHAAA,eAAe,OAAA;AAExB,2FAI8C;AAH7C,kJAAA,4BAA4B,OAAA;AAE5B,iJAAA,2BAA2B,OAAA;AAG5B,uEAQoC;AAPnC,qHAAA,SAAS,OAAA;AAQV,iEAIiC;AAHhC,+GAAA,MAAM,OAAA;AAUP,qEAOmC;AAHlC,wHAAA,aAAa,OAAA","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\n// If desired these are the \"required\" types from core-interfaces.\n// export type {\n// \tInternalUtilityTypes,\n// \tJsonDeserialized,\n// \tJsonSerializable,\n// } from \"@fluidframework/presence/internal/core-interfaces\";\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tPresenceNotifications,\n\tPresenceNotificationsSchema,\n\tPresenceStates,\n\tPresenceStatesEntries,\n\tPresenceStatesSchema,\n\tPresenceWorkspaceAddress,\n\tPresenceWorkspaceEntry,\n} from \"./types.js\";\n\nexport {\n\ttype ClientSessionId,\n\ttype IPresence,\n\ttype ISessionClient,\n\ttype PresenceEvents,\n\tSessionClientStatus,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControls.js\";\n\nexport { acquirePresence } from \"./experimentalAccess.js\";\n\nexport {\n\tacquirePresenceViaDataObject,\n\ttype ExperimentalPresenceDO,\n\tExperimentalPresenceManager,\n} from \"./datastorePresenceManagerFactory.js\";\n\nexport {\n\tLatestMap,\n\ttype LatestMapItemRemovedClientData,\n\ttype LatestMapItemValueClientData,\n\ttype LatestMapValueClientData,\n\ttype LatestMapValueManager,\n\ttype LatestMapValueManagerEvents,\n\ttype ValueMap,\n} from \"./latestMapValueManager.js\";\nexport {\n\tLatest,\n\ttype LatestValueManager,\n\ttype LatestValueManagerEvents,\n} from \"./latestValueManager.js\";\nexport type {\n\tLatestValueClientData,\n\tLatestValueData,\n\tLatestValueMetadata,\n} from \"./latestValueTypes.js\";\n\nexport {\n\ttype NotificationEmitter,\n\ttype NotificationListenable,\n\ttype NotificationSubscriptions,\n\tNotifications,\n\ttype NotificationsManager,\n\ttype NotificationsManagerEvents,\n} from \"./notificationsManager.js\";\n"]}
|
package/dist/internalTypes.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ import type { IRuntimeInternal } from "@fluidframework/presence/internal/contain
|
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown
|
|
14
|
-
[ClientSessionId: ClientSessionId]:
|
|
13
|
+
export interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {
|
|
14
|
+
[ClientSessionId: ClientSessionId]: TValue;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Object.entries retyped to support branded string-based keys.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalTypes.d.ts","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAi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QAAQ,CAAC,CAAC,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,YAAY,CAC5B,MAAM,EACN,WAAW,SACV,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC;IAG1F,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalTypes.js","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"internalTypes.js","sourceRoot":"","sources":["../src/internalTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBH;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,MAAM,CAAC,OAE9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { ClientSessionId, ISessionClient } from \"./presence.js\";\n\nimport type { IRuntimeInternal } from \"@fluidframework/presence/internal/container-definitions/internal\";\n\n/**\n * @internal\n */\nexport interface ClientRecord<TValue extends InternalTypes.ValueDirectoryOrState<unknown>> {\n\t// Caution: any particular item may or may not exist\n\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t[ClientSessionId: ClientSessionId]: TValue;\n}\n\n/**\n * Object.entries retyped to support branded string-based keys.\n *\n * @internal\n */\nexport const brandedObjectEntries = Object.entries as <K extends string, T>(\n\to: Record<K, T>,\n) => [K, T][];\n\n/**\n * This interface is a subset of (IContainerRuntime & IRuntimeInternal) and\n * (IFluidDataStoreRuntime) that is needed by the Presence States.\n *\n * @privateRemarks\n * Replace with non-DataStore based interface.\n *\n * @internal\n */\nexport type IEphemeralRuntime = Pick<\n\t(IContainerRuntime & IRuntimeInternal) | IFluidDataStoreRuntime,\n\t\"clientId\" | \"connected\" | \"getAudience\" | \"getQuorum\" | \"off\" | \"on\" | \"submitSignal\"\n> &\n\tPartial<Pick<IFluidDataStoreRuntime, \"logger\">>;\n\n/**\n * @internal\n */\nexport interface ValueManager<\n\tTValue,\n\tTValueState extends\n\t\tInternalTypes.ValueDirectoryOrState<TValue> = InternalTypes.ValueDirectoryOrState<TValue>,\n> {\n\t// Most value managers should provide value - implement Required<ValueManager<...>>\n\treadonly value?: TValueState;\n\tupdate(client: ISessionClient, received: number, value: TValueState): void;\n}\n"]}
|
|
@@ -2,11 +2,11 @@
|
|
|
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 { Listenable } from "@fluidframework/core-interfaces";
|
|
6
|
+
import type { BroadcastControls, BroadcastControlSettings } from "./broadcastControls.js";
|
|
6
7
|
import type { LatestValueClientData, LatestValueData, LatestValueMetadata } from "./latestValueTypes.js";
|
|
7
8
|
import type { ClientSessionId, ISessionClient } from "./presence.js";
|
|
8
9
|
import type { JsonDeserialized, JsonSerializable } from "@fluidframework/presence/internal/core-interfaces";
|
|
9
|
-
import type { ISubscribable } from "@fluidframework/presence/internal/events";
|
|
10
10
|
import type { InternalTypes } from "@fluidframework/presence/internal/exposedInternalTypes";
|
|
11
11
|
import type { InternalUtilityTypes } from "@fluidframework/presence/internal/exposedUtilityTypes";
|
|
12
12
|
/**
|
|
@@ -149,11 +149,11 @@ export interface LatestMapValueManager<T, Keys extends string | number = string
|
|
|
149
149
|
/**
|
|
150
150
|
* Events for LatestMap value manager.
|
|
151
151
|
*/
|
|
152
|
-
readonly events:
|
|
152
|
+
readonly events: Listenable<LatestMapValueManagerEvents<T, Keys>>;
|
|
153
153
|
/**
|
|
154
154
|
* Controls for management of sending updates.
|
|
155
155
|
*/
|
|
156
|
-
readonly controls:
|
|
156
|
+
readonly controls: BroadcastControls;
|
|
157
157
|
/**
|
|
158
158
|
* Current value map for this client.
|
|
159
159
|
*/
|
|
@@ -178,5 +178,5 @@ export interface LatestMapValueManager<T, Keys extends string | number = string
|
|
|
178
178
|
*/
|
|
179
179
|
export declare function LatestMap<T extends object, Keys extends string | number = string | number, RegistrationKey extends string = string>(initialValues?: {
|
|
180
180
|
[K in Keys]: JsonSerializable<T> & JsonDeserialized<T>;
|
|
181
|
-
}, controls?:
|
|
181
|
+
}, controls?: BroadcastControlSettings): InternalTypes.ManagerFactory<RegistrationKey, InternalTypes.MapValueState<T>, LatestMapValueManager<T, Keys>>;
|
|
182
182
|
//# sourceMappingURL=latestMapValueManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latestMapValueManager.d.ts","sourceRoot":"","sources":["../src/latestMapValueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"latestMapValueManager.d.ts","sourceRoot":"","sources":["../src/latestMapValueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,KAAK,EACX,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAyB,MAAM,eAAe,CAAC;AAI5F,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,KAAK,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AC,CAAC;IAClC;;OAEG;IACH,YAAY,IAAI,gBAAgB,CAAC,wBAAwB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACpE;;OAEG;IACH,OAAO,IAAI,cAAc,EAAE,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3E;AAoID;;;;GAIG;AACH,wBAAgB,SAAS,CACxB,CAAC,SAAS,MAAM,EAChB,IAAI,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAC9C,eAAe,SAAS,MAAM,GAAG,MAAM,EAEvC,aAAa,CAAC,EAAE;KACd,CAAC,IAAI,IAAI,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;CACtD,EACD,QAAQ,CAAC,EAAE,wBAAwB,GACjC,aAAa,CAAC,cAAc,CAC9B,eAAe,EACf,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,EAC9B,qBAAqB,CAAC,CAAC,EAAE,IAAI,CAAC,CAC9B,CAkCA"}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LatestMap = void 0;
|
|
8
|
-
const
|
|
8
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
|
+
const broadcastControls_js_1 = require("./broadcastControls.js");
|
|
9
10
|
const stateDatastore_js_1 = require("./stateDatastore.js");
|
|
10
11
|
const valueManager_js_1 = require("./valueManager.js");
|
|
11
|
-
const events_1 = require("@fluidframework/presence/internal/events");
|
|
12
12
|
class ValueMapImpl {
|
|
13
13
|
constructor(value, localUpdate) {
|
|
14
14
|
this.value = value;
|
|
@@ -29,7 +29,7 @@ class ValueMapImpl {
|
|
|
29
29
|
item.value = value;
|
|
30
30
|
}
|
|
31
31
|
const update = { rev: this.value.rev, items: { [key]: item } };
|
|
32
|
-
this.localUpdate(update
|
|
32
|
+
this.localUpdate(update);
|
|
33
33
|
}
|
|
34
34
|
clear() {
|
|
35
35
|
throw new Error("Method not implemented.");
|
|
@@ -83,10 +83,12 @@ class LatestMapValueManagerImpl {
|
|
|
83
83
|
this.key = key;
|
|
84
84
|
this.datastore = datastore;
|
|
85
85
|
this.value = value;
|
|
86
|
-
this.events = (0,
|
|
87
|
-
this.controls = new
|
|
88
|
-
this.local = new ValueMapImpl(value, (updates
|
|
89
|
-
datastore.localUpdate(key, updates,
|
|
86
|
+
this.events = (0, client_utils_1.createEmitter)();
|
|
87
|
+
this.controls = new broadcastControls_js_1.OptionalBroadcastControl(controlSettings);
|
|
88
|
+
this.local = new ValueMapImpl(value, (updates) => {
|
|
89
|
+
datastore.localUpdate(key, updates, {
|
|
90
|
+
allowableUpdateLatencyMs: this.controls.allowableUpdateLatencyMs,
|
|
91
|
+
});
|
|
90
92
|
});
|
|
91
93
|
}
|
|
92
94
|
*clientValues() {
|
|
@@ -190,15 +192,9 @@ function LatestMap(initialValues, controls) {
|
|
|
190
192
|
value.items[key] = { rev: 0, timestamp, value: initialValues[key] };
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
|
-
const controlSettings = controls
|
|
194
|
-
? { ...controls }
|
|
195
|
-
: {
|
|
196
|
-
allowableUpdateLatency: 60,
|
|
197
|
-
forcedRefreshInterval: 0,
|
|
198
|
-
};
|
|
199
195
|
const factory = (key, datastoreHandle) => ({
|
|
200
|
-
value,
|
|
201
|
-
manager: (0, valueManager_js_1.brandIVM)(new LatestMapValueManagerImpl(key, (0, stateDatastore_js_1.datastoreFromHandle)(datastoreHandle), value,
|
|
196
|
+
initialData: { value, allowableUpdateLatencyMs: controls?.allowableUpdateLatencyMs },
|
|
197
|
+
manager: (0, valueManager_js_1.brandIVM)(new LatestMapValueManagerImpl(key, (0, stateDatastore_js_1.datastoreFromHandle)(datastoreHandle), value, controls)),
|
|
202
198
|
});
|
|
203
199
|
return Object.assign(factory, { instanceBase: LatestMapValueManagerImpl });
|
|
204
200
|
}
|