@fluid-internal/presence-runtime 2.93.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/LICENSE +21 -0
- package/README.md +72 -0
- package/dist/package.json +4 -0
- package/dist/packageVersion.d.ts +9 -0
- package/dist/packageVersion.d.ts.map +1 -0
- package/dist/packageVersion.js +12 -0
- package/dist/packageVersion.js.map +1 -0
- package/dist/runtime/extension/containerPresence.d.ts +53 -0
- package/dist/runtime/extension/containerPresence.d.ts.map +1 -0
- package/dist/runtime/extension/containerPresence.js +90 -0
- package/dist/runtime/extension/containerPresence.js.map +1 -0
- package/dist/runtime/extension/index.d.ts +6 -0
- package/dist/runtime/extension/index.d.ts.map +1 -0
- package/dist/runtime/extension/index.js +11 -0
- package/dist/runtime/extension/index.js.map +1 -0
- package/dist/runtime/presenceDatastoreManager.d.ts +146 -0
- package/dist/runtime/presenceDatastoreManager.d.ts.map +1 -0
- package/dist/runtime/presenceDatastoreManager.js +666 -0
- package/dist/runtime/presenceDatastoreManager.js.map +1 -0
- package/dist/runtime/presenceManager.d.ts +16 -0
- package/dist/runtime/presenceManager.d.ts.map +1 -0
- package/dist/runtime/presenceManager.js +140 -0
- package/dist/runtime/presenceManager.js.map +1 -0
- package/dist/runtime/protocol.d.ts +126 -0
- package/dist/runtime/protocol.d.ts.map +1 -0
- package/dist/runtime/protocol.js +20 -0
- package/dist/runtime/protocol.js.map +1 -0
- package/dist/runtime/runtimeTypes.d.ts +26 -0
- package/dist/runtime/runtimeTypes.d.ts.map +1 -0
- package/dist/runtime/runtimeTypes.js +7 -0
- package/dist/runtime/runtimeTypes.js.map +1 -0
- package/dist/runtime/systemWorkspace.d.ts +39 -0
- package/dist/runtime/systemWorkspace.d.ts.map +1 -0
- package/dist/runtime/systemWorkspace.js +264 -0
- package/dist/runtime/systemWorkspace.js.map +1 -0
- package/dist/runtime/test/presenceDatastoreManager.spec.js +618 -0
- package/dist/runtime/test/presenceDatastoreManager.spec.js.map +1 -0
- package/dist/runtime/test/presenceManager.spec.js +651 -0
- package/dist/runtime/test/presenceManager.spec.js.map +1 -0
- package/dist/runtime/test.d.ts +12 -0
- package/dist/runtime/test.d.ts.map +1 -0
- package/dist/runtime/test.js +15 -0
- package/dist/runtime/test.js.map +1 -0
- package/dist/states/index.d.ts +7 -0
- package/dist/states/index.d.ts.map +1 -0
- package/dist/states/index.js +12 -0
- package/dist/states/index.js.map +1 -0
- package/dist/states/latestMapValueManager.d.ts +10 -0
- package/dist/states/latestMapValueManager.d.ts.map +1 -0
- package/dist/states/latestMapValueManager.js +248 -0
- package/dist/states/latestMapValueManager.js.map +1 -0
- package/dist/states/latestValueManager.d.ts +10 -0
- package/dist/states/latestValueManager.d.ts.map +1 -0
- package/dist/states/latestValueManager.js +115 -0
- package/dist/states/latestValueManager.js.map +1 -0
- package/dist/states/notificationsManager.d.ts +26 -0
- package/dist/states/notificationsManager.d.ts.map +1 -0
- package/dist/states/notificationsManager.js +97 -0
- package/dist/states/notificationsManager.js.map +1 -0
- package/dist/states/presence.d.ts +11 -0
- package/dist/states/presence.d.ts.map +1 -0
- package/dist/states/presence.js +7 -0
- package/dist/states/presence.js.map +1 -0
- package/dist/states/stateFactory.d.ts +18 -0
- package/dist/states/stateFactory.d.ts.map +1 -0
- package/dist/states/stateFactory.js +23 -0
- package/dist/states/stateFactory.js.map +1 -0
- package/dist/states/test/batching.spec.js +843 -0
- package/dist/states/test/batching.spec.js.map +1 -0
- package/dist/states/test/broadcastControlsTests.js +60 -0
- package/dist/states/test/broadcastControlsTests.js.map +1 -0
- package/dist/states/test/eventing.spec.js +576 -0
- package/dist/states/test/eventing.spec.js.map +1 -0
- package/dist/states/test/latestMapValueManager.spec.js +210 -0
- package/dist/states/test/latestMapValueManager.spec.js.map +1 -0
- package/dist/states/test/latestValueManager.spec.js +193 -0
- package/dist/states/test/latestValueManager.spec.js.map +1 -0
- package/dist/states/test/mockEphemeralRuntime.js +11 -0
- package/dist/states/test/mockEphemeralRuntime.js.map +1 -0
- package/dist/states/test/notificationsManager.spec.js +460 -0
- package/dist/states/test/notificationsManager.spec.js.map +1 -0
- package/dist/states/test/presenceStates.spec.js +73 -0
- package/dist/states/test/presenceStates.spec.js.map +1 -0
- package/dist/states/test/schemaValidation/protocol.spec.js +246 -0
- package/dist/states/test/schemaValidation/protocol.spec.js.map +1 -0
- package/dist/states/test/schemaValidation/valueManagers.spec.js +784 -0
- package/dist/states/test/schemaValidation/valueManagers.spec.js.map +1 -0
- package/dist/states/test/testUtils.js +21 -0
- package/dist/states/test/testUtils.js.map +1 -0
- package/dist/states/validatedGetter.d.ts +18 -0
- package/dist/states/validatedGetter.d.ts.map +1 -0
- package/dist/states/validatedGetter.js +43 -0
- package/dist/states/validatedGetter.js.map +1 -0
- package/dist/test/mockEphemeralRuntime.js +175 -0
- package/dist/test/mockEphemeralRuntime.js.map +1 -0
- package/dist/test/testUtils.js +262 -0
- package/dist/test/testUtils.js.map +1 -0
- package/dist/test/utils/index.js +27 -0
- package/dist/test/utils/index.js.map +1 -0
- package/dist/utils/broadcastControls.d.ts +37 -0
- package/dist/utils/broadcastControls.d.ts.map +1 -0
- package/dist/utils/broadcastControls.js +60 -0
- package/dist/utils/broadcastControls.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +26 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/internalUtils.d.ts +125 -0
- package/dist/utils/internalUtils.d.ts.map +1 -0
- package/dist/utils/internalUtils.js +99 -0
- package/dist/utils/internalUtils.js.map +1 -0
- package/dist/utils/test/timerManager.spec.js +93 -0
- package/dist/utils/test/timerManager.spec.js.map +1 -0
- package/dist/utils/timerManager.d.ts +37 -0
- package/dist/utils/timerManager.d.ts.map +1 -0
- package/dist/utils/timerManager.js +65 -0
- package/dist/utils/timerManager.js.map +1 -0
- package/dist/utils/valueManager.d.ts +14 -0
- package/dist/utils/valueManager.d.ts.map +1 -0
- package/dist/utils/valueManager.js +22 -0
- package/dist/utils/valueManager.js.map +1 -0
- package/dist/workspace/index.d.ts +7 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +14 -0
- package/dist/workspace/index.js.map +1 -0
- package/dist/workspace/presenceStates.d.ts +61 -0
- package/dist/workspace/presenceStates.d.ts.map +1 -0
- package/dist/workspace/presenceStates.js +235 -0
- package/dist/workspace/presenceStates.js.map +1 -0
- package/dist/workspace/stateDatastore.d.ts +17 -0
- package/dist/workspace/stateDatastore.d.ts.map +1 -0
- package/dist/workspace/stateDatastore.js +24 -0
- package/dist/workspace/stateDatastore.js.map +1 -0
- package/lib/packageVersion.d.ts +9 -0
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/packageVersion.js +9 -0
- package/lib/packageVersion.js.map +1 -0
- package/lib/runtime/extension/containerPresence.d.ts +53 -0
- package/lib/runtime/extension/containerPresence.d.ts.map +1 -0
- package/lib/runtime/extension/containerPresence.js +87 -0
- package/lib/runtime/extension/containerPresence.js.map +1 -0
- package/lib/runtime/extension/index.d.ts +6 -0
- package/lib/runtime/extension/index.d.ts.map +1 -0
- package/lib/runtime/extension/index.js +6 -0
- package/lib/runtime/extension/index.js.map +1 -0
- package/lib/runtime/presenceDatastoreManager.d.ts +146 -0
- package/lib/runtime/presenceDatastoreManager.d.ts.map +1 -0
- package/lib/runtime/presenceDatastoreManager.js +662 -0
- package/lib/runtime/presenceDatastoreManager.js.map +1 -0
- package/lib/runtime/presenceManager.d.ts +16 -0
- package/lib/runtime/presenceManager.d.ts.map +1 -0
- package/lib/runtime/presenceManager.js +136 -0
- package/lib/runtime/presenceManager.js.map +1 -0
- package/lib/runtime/protocol.d.ts +126 -0
- package/lib/runtime/protocol.d.ts.map +1 -0
- package/lib/runtime/protocol.js +17 -0
- package/lib/runtime/protocol.js.map +1 -0
- package/lib/runtime/runtimeTypes.d.ts +26 -0
- package/lib/runtime/runtimeTypes.d.ts.map +1 -0
- package/lib/runtime/runtimeTypes.js +6 -0
- package/lib/runtime/runtimeTypes.js.map +1 -0
- package/lib/runtime/systemWorkspace.d.ts +39 -0
- package/lib/runtime/systemWorkspace.d.ts.map +1 -0
- package/lib/runtime/systemWorkspace.js +260 -0
- package/lib/runtime/systemWorkspace.js.map +1 -0
- package/lib/runtime/test/presenceDatastoreManager.spec.js +616 -0
- package/lib/runtime/test/presenceDatastoreManager.spec.js.map +1 -0
- package/lib/runtime/test/presenceManager.spec.js +649 -0
- package/lib/runtime/test/presenceManager.spec.js.map +1 -0
- package/lib/runtime/test.d.ts +12 -0
- package/lib/runtime/test.d.ts.map +1 -0
- package/lib/runtime/test.js +10 -0
- package/lib/runtime/test.js.map +1 -0
- package/lib/states/index.d.ts +7 -0
- package/lib/states/index.d.ts.map +1 -0
- package/lib/states/index.js +7 -0
- package/lib/states/index.js.map +1 -0
- package/lib/states/latestMapValueManager.d.ts +10 -0
- package/lib/states/latestMapValueManager.d.ts.map +1 -0
- package/lib/states/latestMapValueManager.js +244 -0
- package/lib/states/latestMapValueManager.js.map +1 -0
- package/lib/states/latestValueManager.d.ts +10 -0
- package/lib/states/latestValueManager.d.ts.map +1 -0
- package/lib/states/latestValueManager.js +111 -0
- package/lib/states/latestValueManager.js.map +1 -0
- package/lib/states/notificationsManager.d.ts +26 -0
- package/lib/states/notificationsManager.d.ts.map +1 -0
- package/lib/states/notificationsManager.js +93 -0
- package/lib/states/notificationsManager.js.map +1 -0
- package/lib/states/presence.d.ts +11 -0
- package/lib/states/presence.d.ts.map +1 -0
- package/lib/states/presence.js +6 -0
- package/lib/states/presence.js.map +1 -0
- package/lib/states/stateFactory.d.ts +18 -0
- package/lib/states/stateFactory.d.ts.map +1 -0
- package/lib/states/stateFactory.js +20 -0
- package/lib/states/stateFactory.js.map +1 -0
- package/lib/states/test/batching.spec.js +841 -0
- package/lib/states/test/batching.spec.js.map +1 -0
- package/lib/states/test/broadcastControlsTests.js +56 -0
- package/lib/states/test/broadcastControlsTests.js.map +1 -0
- package/lib/states/test/eventing.spec.js +574 -0
- package/lib/states/test/eventing.spec.js.map +1 -0
- package/lib/states/test/latestMapValueManager.spec.js +206 -0
- package/lib/states/test/latestMapValueManager.spec.js.map +1 -0
- package/lib/states/test/latestValueManager.spec.js +189 -0
- package/lib/states/test/latestValueManager.spec.js.map +1 -0
- package/lib/states/test/mockEphemeralRuntime.js +6 -0
- package/lib/states/test/mockEphemeralRuntime.js.map +1 -0
- package/lib/states/test/notificationsManager.spec.js +456 -0
- package/lib/states/test/notificationsManager.spec.js.map +1 -0
- package/lib/states/test/presenceStates.spec.js +69 -0
- package/lib/states/test/presenceStates.spec.js.map +1 -0
- package/lib/states/test/schemaValidation/protocol.spec.js +244 -0
- package/lib/states/test/schemaValidation/protocol.spec.js.map +1 -0
- package/lib/states/test/schemaValidation/valueManagers.spec.js +782 -0
- package/lib/states/test/schemaValidation/valueManagers.spec.js.map +1 -0
- package/lib/states/test/testUtils.js +6 -0
- package/lib/states/test/testUtils.js.map +1 -0
- package/lib/states/validatedGetter.d.ts +18 -0
- package/lib/states/validatedGetter.d.ts.map +1 -0
- package/lib/states/validatedGetter.js +39 -0
- package/lib/states/validatedGetter.js.map +1 -0
- package/lib/test/mockEphemeralRuntime.js +171 -0
- package/lib/test/mockEphemeralRuntime.js.map +1 -0
- package/lib/test/testUtils.js +251 -0
- package/lib/test/testUtils.js.map +1 -0
- package/lib/test/utils/index.js +8 -0
- package/lib/test/utils/index.js.map +1 -0
- package/lib/utils/broadcastControls.d.ts +37 -0
- package/lib/utils/broadcastControls.d.ts.map +1 -0
- package/lib/utils/broadcastControls.js +55 -0
- package/lib/utils/broadcastControls.js.map +1 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +9 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/internalUtils.d.ts +125 -0
- package/lib/utils/internalUtils.d.ts.map +1 -0
- package/lib/utils/internalUtils.js +90 -0
- package/lib/utils/internalUtils.js.map +1 -0
- package/lib/utils/test/timerManager.spec.js +91 -0
- package/lib/utils/test/timerManager.spec.js.map +1 -0
- package/lib/utils/timerManager.d.ts +37 -0
- package/lib/utils/timerManager.d.ts.map +1 -0
- package/lib/utils/timerManager.js +61 -0
- package/lib/utils/timerManager.js.map +1 -0
- package/lib/utils/valueManager.d.ts +14 -0
- package/lib/utils/valueManager.d.ts.map +1 -0
- package/lib/utils/valueManager.js +17 -0
- package/lib/utils/valueManager.js.map +1 -0
- package/lib/workspace/index.d.ts +7 -0
- package/lib/workspace/index.d.ts.map +1 -0
- package/lib/workspace/index.js +7 -0
- package/lib/workspace/index.js.map +1 -0
- package/lib/workspace/presenceStates.d.ts +61 -0
- package/lib/workspace/presenceStates.d.ts.map +1 -0
- package/lib/workspace/presenceStates.js +229 -0
- package/lib/workspace/presenceStates.js.map +1 -0
- package/lib/workspace/stateDatastore.d.ts +17 -0
- package/lib/workspace/stateDatastore.d.ts.map +1 -0
- package/lib/workspace/stateDatastore.js +19 -0
- package/lib/workspace/stateDatastore.js.map +1 -0
- package/package.json +158 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Object.entries retyped to preserve known keys and their types.
|
|
7
|
+
*
|
|
8
|
+
* @privateRemarks
|
|
9
|
+
* The is a defect in this utility when a string index appears in the object.
|
|
10
|
+
* In such a case, the only result is `[string, T]`, where `T` is the type
|
|
11
|
+
* of the string index entry.
|
|
12
|
+
*/
|
|
13
|
+
export const objectEntries = Object.entries;
|
|
14
|
+
/**
|
|
15
|
+
* Object.entries retyped to preserve known keys and their types.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Given `T` should not contain `undefined` values. If it does, use
|
|
19
|
+
* {@link objectEntries} instead. Without `undefined` values, this
|
|
20
|
+
* typing provides best handling of objects with optional properties.
|
|
21
|
+
*/
|
|
22
|
+
export const objectEntriesWithoutUndefined = Object.entries;
|
|
23
|
+
/**
|
|
24
|
+
* Object.keys retyped to preserve known keys and their types.
|
|
25
|
+
*/
|
|
26
|
+
export const objectKeys = Object.keys;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a value from a record with the given key, or create a new entry if
|
|
29
|
+
* the key is not in the record.
|
|
30
|
+
*
|
|
31
|
+
* @param record - The record to index/update
|
|
32
|
+
* @param key - The key to lookup in the record
|
|
33
|
+
* @param defaultValue - a function which returns a default value. This is
|
|
34
|
+
* called and used to set an initial value for the given key in the record if
|
|
35
|
+
* none exists.
|
|
36
|
+
* @returns either the existing value for the given key, or the newly-created
|
|
37
|
+
* value (the result of `defaultValue`)
|
|
38
|
+
*/
|
|
39
|
+
export function getOrCreateRecord(record, key, defaultValue) {
|
|
40
|
+
if (!(key in record)) {
|
|
41
|
+
record[key] = defaultValue(key);
|
|
42
|
+
}
|
|
43
|
+
return record[key];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* No-runtime-effect helper to apply deep immutability to a value's type.
|
|
47
|
+
*/
|
|
48
|
+
export function asDeeplyReadonly(value) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* No-runtime-effect helper to apply deep immutability to a value's opaque JSON
|
|
53
|
+
* type, revealing the JSON type.
|
|
54
|
+
*/
|
|
55
|
+
export function asDeeplyReadonlyDeserializedJson(value) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* No-runtime-effect helper to reveal the JSON type from a value's opaque JSON
|
|
60
|
+
* types throughout a structure.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* {@link OpaqueJsonDeserialized} instances will be replaced shallowly such
|
|
64
|
+
* that nested instances are retained.
|
|
65
|
+
*/
|
|
66
|
+
export function revealOpaqueJson(value) {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* No-runtime-effect helper to automatically cast JSON type to Opaque JSON type
|
|
71
|
+
* at outermost scope.
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* Types that satisfy {@link JsonSerializable} may also be deserialized. Thus,
|
|
75
|
+
* the return type is both {@link OpaqueJsonSerializable} and
|
|
76
|
+
* {@link OpaqueJsonDeserialized}.
|
|
77
|
+
*/
|
|
78
|
+
export function toOpaqueJson(value) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Type guard to check if a state is a required state (has a value).
|
|
83
|
+
*
|
|
84
|
+
* @param state - The state to check
|
|
85
|
+
* @returns True if the state has a value and is therefore a {@link ValidatableRequiredState}
|
|
86
|
+
*/
|
|
87
|
+
export function isValueRequiredState(state) {
|
|
88
|
+
return state.value !== undefined;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=internalUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalUtils.js","sourceRoot":"","sources":["../../src/utils/internalUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgCH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,OAA8C,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAEN,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAEU,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAoB,EACpB,GAAM,EACN,YAA2B;IAE3B,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAI,KAAQ;IAC3C,OAAO,KAAwB,CAAC;AACjC,CAAC;AASD;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAC/C,KAA4C;IAE5C,OAAO,KAAsD,CAAC;AAC/D,CAAC;AAWD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAI,KAAQ;IAC3C,OAAO,KAAwC,CAAC;AACjD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAC3B,KAA0B;IAE1B,OAAO,KAA8D,CAAC;AACvE,CAAC;AA+CD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CACnC,KAAgE;IAEhE,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;AAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tValidatableOptionalState,\n\tValidatableRequiredState,\n} from \"@fluid-internal/presence-definitions/internal\";\nimport type {\n\tDeepReadonly,\n\tInternalCoreInterfacesUtilityTypes,\n\tJsonDeserialized,\n\tJsonSerializable,\n\tOpaqueJsonDeserialized,\n\tOpaqueJsonSerializable,\n} from \"@fluidframework/core-interfaces/internal\";\n\n/**\n * Returns union of types of values in a record.\n */\nexport type RecordEntryTypes<T> = T[keyof T];\n\ntype MapNumberIndicesToStrings<T> = {\n\t[K in keyof T as K extends number ? `${K}` : K]: T[K];\n};\n\ntype KeyValuePairs<T> = {\n\t[K in keyof MapNumberIndicesToStrings<Required<T>>]: [K, Required<T>[K]];\n}[keyof MapNumberIndicesToStrings<Required<T>>][];\n\ntype RequiredAndNotUndefined<T> = {\n\t[K in keyof T]-?: Exclude<T[K], undefined>;\n};\n\n/**\n * Object.entries retyped to preserve known keys and their types.\n *\n * @privateRemarks\n * The is a defect in this utility when a string index appears in the object.\n * In such a case, the only result is `[string, T]`, where `T` is the type\n * of the string index entry.\n */\nexport const objectEntries = Object.entries as <const T>(o: T) => KeyValuePairs<T>;\n\n/**\n * Object.entries retyped to preserve known keys and their types.\n *\n * @remarks\n * Given `T` should not contain `undefined` values. If it does, use\n * {@link objectEntries} instead. Without `undefined` values, this\n * typing provides best handling of objects with optional properties.\n */\nexport const objectEntriesWithoutUndefined = Object.entries as <const T>(\n\to: T,\n) => KeyValuePairs<RequiredAndNotUndefined<T>>;\n\n/**\n * Object.keys retyped to preserve known keys and their types.\n */\nexport const objectKeys = Object.keys as <const T>(\n\to: T,\n) => (keyof MapNumberIndicesToStrings<T>)[];\n\n/**\n * Retrieve a value from a record with the given key, or create a new entry if\n * the key is not in the record.\n *\n * @param record - The record to index/update\n * @param key - The key to lookup in the record\n * @param defaultValue - a function which returns a default value. This is\n * called and used to set an initial value for the given key in the record if\n * none exists.\n * @returns either the existing value for the given key, or the newly-created\n * value (the result of `defaultValue`)\n */\nexport function getOrCreateRecord<const K extends string | number | symbol, const V>(\n\trecord: Record<K, V>,\n\tkey: K,\n\tdefaultValue: (key: K) => V,\n): V {\n\tif (!(key in record)) {\n\t\trecord[key] = defaultValue(key);\n\t}\n\treturn record[key];\n}\n\n/**\n * No-runtime-effect helper to apply deep immutability to a value's type.\n */\nexport function asDeeplyReadonly<T>(value: T): DeepReadonly<T> {\n\treturn value as DeepReadonly<T>;\n}\n\n// function overloads\nexport function asDeeplyReadonlyDeserializedJson<T>(\n\tvalue: OpaqueJsonDeserialized<T>,\n): DeepReadonly<JsonDeserialized<T>>;\nexport function asDeeplyReadonlyDeserializedJson<T>(\n\tvalue: OpaqueJsonDeserialized<T> | undefined,\n): DeepReadonly<JsonDeserialized<T>> | undefined;\n/**\n * No-runtime-effect helper to apply deep immutability to a value's opaque JSON\n * type, revealing the JSON type.\n */\nexport function asDeeplyReadonlyDeserializedJson<T>(\n\tvalue: OpaqueJsonDeserialized<T> | undefined,\n): DeepReadonly<JsonDeserialized<T>> | undefined {\n\treturn value as DeepReadonly<JsonDeserialized<T>> | undefined;\n}\n\n/**\n * Conditional type that reveals the underlying JSON type of an opaque JSON value. If `T` is an object, the key values\n * will be revealed.\n */\ntype RevealOpaqueJsonDeserialized<T> =\n\tT extends OpaqueJsonDeserialized<infer U>\n\t\t? JsonDeserialized<U>\n\t\t: { [Key in keyof T]: RevealOpaqueJsonDeserialized<T[Key]> };\n\n/**\n * No-runtime-effect helper to reveal the JSON type from a value's opaque JSON\n * types throughout a structure.\n *\n * @remarks\n * {@link OpaqueJsonDeserialized} instances will be replaced shallowly such\n * that nested instances are retained.\n */\nexport function revealOpaqueJson<T>(value: T): RevealOpaqueJsonDeserialized<T> {\n\treturn value as RevealOpaqueJsonDeserialized<T>;\n}\n\n/**\n * No-runtime-effect helper to automatically cast JSON type to Opaque JSON type\n * at outermost scope.\n *\n * @remarks\n * Types that satisfy {@link JsonSerializable} may also be deserialized. Thus,\n * the return type is both {@link OpaqueJsonSerializable} and\n * {@link OpaqueJsonDeserialized}.\n */\nexport function toOpaqueJson<const T>(\n\tvalue: JsonSerializable<T>,\n): OpaqueJsonSerializable<T> & OpaqueJsonDeserialized<T> {\n\treturn value as OpaqueJsonSerializable<T> & OpaqueJsonDeserialized<T>;\n}\n\n/**\n * Convert a union of types to an intersection of those types.\n *\n * @privateRemarks\n * First an always true extends clause is used (T extends T) to distribute T\n * into to a union of types contravariant over each member of the T union.\n * Then the constraint on the type parameter in this new context is inferred,\n * giving the intersection.\n *\n * Future: This definition is identical to one in `packages/dds/tree/src/util/typeUtils.ts`\n * and should be consolidated.\n */\ntype UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) extends (\n\tk: infer U,\n) => unknown\n\t? U\n\t: never;\n\n/**\n * Generates a union of types that are the remainder from a simple\n * Pick combination (that is the set of common properties).\n */\ntype PickRemainder<T> =\n\tPick<T, keyof T> extends infer Common\n\t\t? T extends unknown\n\t\t\t? Omit<T, keyof Common>\n\t\t\t: never\n\t\t: never;\n\n/**\n * Combines union of structure into a single structure where common properties\n * are unions of their respective types and optional properties are defined for\n * properties that are not common to each union member.\n *\n * @remarks\n * If a property is common to multiple, but not all union member and the\n * types are incompatible, the resulting type will be `never` for that\n * property. (This can be fixed, but might be best addressed by changing\n * T to be a tuple of types to be combined.)\n */\nexport type FlattenUnionWithOptionals<T> =\n\tInternalCoreInterfacesUtilityTypes.FlattenIntersection<\n\t\tPick<T, keyof T> & UnionToIntersection<Partial<PickRemainder<T>>>\n\t>;\n\n/**\n * Type guard to check if a state is a required state (has a value).\n *\n * @param state - The state to check\n * @returns True if the state has a value and is therefore a {@link ValidatableRequiredState}\n */\nexport function isValueRequiredState<T>(\n\tstate: ValidatableRequiredState<T> | ValidatableOptionalState<T>,\n): state is ValidatableRequiredState<T> {\n\treturn state.value !== undefined;\n}\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { strict as assert } from "node:assert";
|
|
6
|
+
import { describe, it, after, afterEach, before, beforeEach } from "mocha";
|
|
7
|
+
import { useFakeTimers, spy } from "sinon";
|
|
8
|
+
import { TimerManager } from "../index.js";
|
|
9
|
+
// TODO: separate Presence/Utils from TimerManager after file move is merged.
|
|
10
|
+
describe("Presence/Utils:TimerManager", () => {
|
|
11
|
+
const initialTime = 1000;
|
|
12
|
+
let clock;
|
|
13
|
+
before(async () => {
|
|
14
|
+
clock = useFakeTimers();
|
|
15
|
+
});
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
clock.setSystemTime(initialTime);
|
|
18
|
+
});
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
clock.reset();
|
|
21
|
+
});
|
|
22
|
+
after(() => {
|
|
23
|
+
clock.restore();
|
|
24
|
+
});
|
|
25
|
+
it("fires on time", () => {
|
|
26
|
+
const timer = new TimerManager();
|
|
27
|
+
const handler = spy(() => assert.strictEqual(Date.now(), 1100));
|
|
28
|
+
timer.setTimeout(handler, 100);
|
|
29
|
+
clock.tick(50);
|
|
30
|
+
assert.strictEqual(handler.callCount, 0);
|
|
31
|
+
assert.strictEqual(timer.hasExpired(), false);
|
|
32
|
+
clock.tick(100);
|
|
33
|
+
assert.strictEqual(handler.callCount, 1);
|
|
34
|
+
assert.strictEqual(timer.hasExpired(), true);
|
|
35
|
+
});
|
|
36
|
+
it("expire time is based on timeout", () => {
|
|
37
|
+
const timer = new TimerManager();
|
|
38
|
+
const handler = spy(() => undefined);
|
|
39
|
+
timer.setTimeout(handler, 50);
|
|
40
|
+
assert.strictEqual(timer.expireTime, 1050);
|
|
41
|
+
assert.strictEqual(timer.hasExpired(), false);
|
|
42
|
+
});
|
|
43
|
+
it("does not fire if cleared before timeout", () => {
|
|
44
|
+
const timer = new TimerManager();
|
|
45
|
+
const handler = spy(() => undefined);
|
|
46
|
+
timer.setTimeout(handler, 100);
|
|
47
|
+
clock.tick(50);
|
|
48
|
+
timer.clearTimeout();
|
|
49
|
+
assert.strictEqual(handler.callCount, 0);
|
|
50
|
+
assert.strictEqual(timer.hasExpired(), true);
|
|
51
|
+
});
|
|
52
|
+
it("does not fire on old timeout when new timeout set", () => {
|
|
53
|
+
const timer = new TimerManager();
|
|
54
|
+
const handler = spy(() => assert.strictEqual(Date.now(), 1150));
|
|
55
|
+
timer.setTimeout(handler, 100);
|
|
56
|
+
assert.strictEqual(timer.expireTime, 1100);
|
|
57
|
+
clock.tick(50);
|
|
58
|
+
timer.setTimeout(handler, 100);
|
|
59
|
+
assert.strictEqual(timer.expireTime, 1150);
|
|
60
|
+
// advance to time 1120 - after the original timer should have fired, but before the new one.
|
|
61
|
+
clock.tick(70);
|
|
62
|
+
assert.strictEqual(handler.callCount, 0);
|
|
63
|
+
// Advance past timeout
|
|
64
|
+
clock.tick(50);
|
|
65
|
+
assert.strictEqual(timer.hasExpired(), true);
|
|
66
|
+
assert.strictEqual(handler.callCount, 1);
|
|
67
|
+
});
|
|
68
|
+
it("fires correctly on reuse", () => {
|
|
69
|
+
const timer = new TimerManager();
|
|
70
|
+
const handler = spy(() => assert(Date.now() === 1100));
|
|
71
|
+
timer.setTimeout(handler, 100);
|
|
72
|
+
clock.tick(200);
|
|
73
|
+
const handler2 = spy(() => assert.strictEqual(Date.now(), 1300));
|
|
74
|
+
timer.setTimeout(handler2, 100);
|
|
75
|
+
clock.tick(200);
|
|
76
|
+
assert.strictEqual(handler.callCount, 1);
|
|
77
|
+
assert.strictEqual(handler2.callCount, 1);
|
|
78
|
+
});
|
|
79
|
+
it("multiple timers", () => {
|
|
80
|
+
const timer = new TimerManager();
|
|
81
|
+
const timer2 = new TimerManager();
|
|
82
|
+
const handler = spy(() => { });
|
|
83
|
+
const handler2 = spy(() => { });
|
|
84
|
+
timer.setTimeout(handler, 100);
|
|
85
|
+
timer2.setTimeout(handler2, 50);
|
|
86
|
+
clock.tick(200);
|
|
87
|
+
assert.strictEqual(handler.callCount, 1);
|
|
88
|
+
assert.strictEqual(handler2.callCount, 1);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=timerManager.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timerManager.spec.js","sourceRoot":"","sources":["../../../src/utils/test/timerManager.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAwB,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,6EAA6E;AAC7E,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC;IACzB,IAAI,KAAsB,CAAC;IAE3B,MAAM,CAAC,KAAK,IAAI,EAAE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MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC9B,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAE/B,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEhB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"node:assert\";\n\nimport { describe, it, after, afterEach, before, beforeEach } from \"mocha\";\nimport { useFakeTimers, type SinonFakeTimers, spy } from \"sinon\";\n\nimport { TimerManager } from \"../index.js\";\n\n// TODO: separate Presence/Utils from TimerManager after file move is merged.\ndescribe(\"Presence/Utils:TimerManager\", () => {\n\tconst initialTime = 1000;\n\tlet clock: SinonFakeTimers;\n\n\tbefore(async () => {\n\t\tclock = useFakeTimers();\n\t});\n\n\tbeforeEach(() => {\n\t\tclock.setSystemTime(initialTime);\n\t});\n\n\tafterEach(() => {\n\t\tclock.reset();\n\t});\n\n\tafter(() => {\n\t\tclock.restore();\n\t});\n\n\tit(\"fires on time\", () => {\n\t\tconst timer = new TimerManager();\n\t\tconst handler = spy(() => assert.strictEqual(Date.now(), 1100));\n\t\ttimer.setTimeout(handler, 100);\n\n\t\tclock.tick(50);\n\t\tassert.strictEqual(handler.callCount, 0);\n\t\tassert.strictEqual(timer.hasExpired(), false);\n\n\t\tclock.tick(100);\n\t\tassert.strictEqual(handler.callCount, 1);\n\t\tassert.strictEqual(timer.hasExpired(), true);\n\t});\n\n\tit(\"expire time is based on timeout\", () => {\n\t\tconst timer = new TimerManager();\n\t\tconst handler = spy(() => undefined);\n\t\ttimer.setTimeout(handler, 50);\n\n\t\tassert.strictEqual(timer.expireTime, 1050);\n\t\tassert.strictEqual(timer.hasExpired(), false);\n\t});\n\n\tit(\"does not fire if cleared before timeout\", () => {\n\t\tconst timer = new TimerManager();\n\t\tconst handler = spy(() => undefined);\n\t\ttimer.setTimeout(handler, 100);\n\n\t\tclock.tick(50);\n\t\ttimer.clearTimeout();\n\n\t\tassert.strictEqual(handler.callCount, 0);\n\t\tassert.strictEqual(timer.hasExpired(), true);\n\t});\n\n\tit(\"does not fire on old timeout when new timeout set\", () => {\n\t\tconst timer = new TimerManager();\n\t\tconst handler = spy(() => assert.strictEqual(Date.now(), 1150));\n\t\ttimer.setTimeout(handler, 100);\n\t\tassert.strictEqual(timer.expireTime, 1100);\n\n\t\tclock.tick(50);\n\t\ttimer.setTimeout(handler, 100);\n\t\tassert.strictEqual(timer.expireTime, 1150);\n\n\t\t// advance to time 1120 - after the original timer should have fired, but before the new one.\n\t\tclock.tick(70);\n\t\tassert.strictEqual(handler.callCount, 0);\n\n\t\t// Advance past timeout\n\t\tclock.tick(50);\n\n\t\tassert.strictEqual(timer.hasExpired(), true);\n\t\tassert.strictEqual(handler.callCount, 1);\n\t});\n\n\tit(\"fires correctly on reuse\", () => {\n\t\tconst timer = new TimerManager();\n\t\tconst handler = spy(() => assert(Date.now() === 1100));\n\t\ttimer.setTimeout(handler, 100);\n\n\t\tclock.tick(200);\n\t\tconst handler2 = spy(() => assert.strictEqual(Date.now(), 1300));\n\t\ttimer.setTimeout(handler2, 100);\n\n\t\tclock.tick(200);\n\t\tassert.strictEqual(handler.callCount, 1);\n\t\tassert.strictEqual(handler2.callCount, 1);\n\t});\n\n\tit(\"multiple timers\", () => {\n\t\tconst timer = new TimerManager();\n\t\tconst timer2 = new TimerManager();\n\t\tconst handler = spy(() => {});\n\t\tconst handler2 = spy(() => {});\n\n\t\ttimer.setTimeout(handler, 100);\n\t\ttimer2.setTimeout(handler2, 50);\n\t\tclock.tick(200);\n\n\t\tassert.strictEqual(handler.callCount, 1);\n\t\tassert.strictEqual(handler2.callCount, 1);\n\t});\n});\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Wrapper around setTimeout to track whether the timeout has expired or not.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TimerManager {
|
|
9
|
+
private _timeoutId;
|
|
10
|
+
private _startTime;
|
|
11
|
+
get startTime(): number;
|
|
12
|
+
private _delay;
|
|
13
|
+
get delay(): number;
|
|
14
|
+
private _expired;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the timer has expired or not.
|
|
17
|
+
*
|
|
18
|
+
* @returns True if the timer has expired; false otherwise.
|
|
19
|
+
*/
|
|
20
|
+
hasExpired(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Schedules a callback to be triggered after a delay.
|
|
23
|
+
*
|
|
24
|
+
* @param callback - A callback to execute after a delay.
|
|
25
|
+
* @param delay - The time to wait before executing the callback, in milliseconds.
|
|
26
|
+
*/
|
|
27
|
+
setTimeout(callback: () => void, delay: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Clear any pending timer. Also marks the timer as expired.
|
|
30
|
+
*/
|
|
31
|
+
clearTimeout(): void;
|
|
32
|
+
/**
|
|
33
|
+
* The time when this timer will expire/trigger. If the timer has expired, returns 0.
|
|
34
|
+
*/
|
|
35
|
+
get expireTime(): number;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=timerManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timerManager.d.ts","sourceRoot":"","sources":["../../src/utils/timerManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,UAAU,CAAK;IAEvB,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,OAAO,CAAC,MAAM,CAAa;IAE3B,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,OAAO,CAAC,QAAQ,CAAiB;IAEjC;;;;OAIG;IACI,UAAU,IAAI,OAAO;IAI5B;;;;;OAKG;IACI,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAW5D;;OAEG;IACI,YAAY,IAAI,IAAI;IAQ3B;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;CACD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Wrapper around setTimeout to track whether the timeout has expired or not.
|
|
7
|
+
*/
|
|
8
|
+
export class TimerManager {
|
|
9
|
+
constructor() {
|
|
10
|
+
this._startTime = 0;
|
|
11
|
+
this._delay = 0;
|
|
12
|
+
this._expired = true;
|
|
13
|
+
}
|
|
14
|
+
get startTime() {
|
|
15
|
+
return this._startTime;
|
|
16
|
+
}
|
|
17
|
+
get delay() {
|
|
18
|
+
return this._delay;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Whether the timer has expired or not.
|
|
22
|
+
*
|
|
23
|
+
* @returns True if the timer has expired; false otherwise.
|
|
24
|
+
*/
|
|
25
|
+
hasExpired() {
|
|
26
|
+
return this._expired;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Schedules a callback to be triggered after a delay.
|
|
30
|
+
*
|
|
31
|
+
* @param callback - A callback to execute after a delay.
|
|
32
|
+
* @param delay - The time to wait before executing the callback, in milliseconds.
|
|
33
|
+
*/
|
|
34
|
+
setTimeout(callback, delay) {
|
|
35
|
+
this.clearTimeout(); // Clear any existing timeout
|
|
36
|
+
this._startTime = Date.now();
|
|
37
|
+
this._delay = delay;
|
|
38
|
+
this._expired = false;
|
|
39
|
+
this._timeoutId = setTimeout(() => {
|
|
40
|
+
this._expired = true;
|
|
41
|
+
callback();
|
|
42
|
+
}, delay);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Clear any pending timer. Also marks the timer as expired.
|
|
46
|
+
*/
|
|
47
|
+
clearTimeout() {
|
|
48
|
+
if (this._timeoutId !== undefined) {
|
|
49
|
+
clearTimeout(this._timeoutId);
|
|
50
|
+
this._timeoutId = undefined;
|
|
51
|
+
this._expired = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The time when this timer will expire/trigger. If the timer has expired, returns 0.
|
|
56
|
+
*/
|
|
57
|
+
get expireTime() {
|
|
58
|
+
return this.hasExpired() ? 0 : this.startTime + this.delay;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=timerManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timerManager.js","sourceRoot":"","sources":["../../src/utils/timerManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QAES,eAAU,GAAG,CAAC,CAAC;QAMf,WAAM,GAAW,CAAC,CAAC;QAMnB,aAAQ,GAAY,IAAI,CAAC;IA6ClC,CAAC;IAvDA,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAID,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAID;;;;OAIG;IACI,UAAU;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,QAAoB,EAAE,KAAa;QACpD,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,6BAA6B;QAClD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,EAAE;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,QAAQ,EAAE,CAAC;QACZ,CAAC,EAAE,KAAK,CAAC,CAAC;IACX,CAAC;IAED;;OAEG;IACI,YAAY;QAClB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACnC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACtB,CAAC;IACF,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Wrapper around setTimeout to track whether the timeout has expired or not.\n */\nexport class TimerManager {\n\tprivate _timeoutId: number | undefined;\n\tprivate _startTime = 0;\n\n\tpublic get startTime(): number {\n\t\treturn this._startTime;\n\t}\n\n\tprivate _delay: number = 0;\n\n\tpublic get delay(): number {\n\t\treturn this._delay;\n\t}\n\n\tprivate _expired: boolean = true;\n\n\t/**\n\t * Whether the timer has expired or not.\n\t *\n\t * @returns True if the timer has expired; false otherwise.\n\t */\n\tpublic hasExpired(): boolean {\n\t\treturn this._expired;\n\t}\n\n\t/**\n\t * Schedules a callback to be triggered after a delay.\n\t *\n\t * @param callback - A callback to execute after a delay.\n\t * @param delay - The time to wait before executing the callback, in milliseconds.\n\t */\n\tpublic setTimeout(callback: () => void, delay: number): void {\n\t\tthis.clearTimeout(); // Clear any existing timeout\n\t\tthis._startTime = Date.now();\n\t\tthis._delay = delay;\n\t\tthis._expired = false;\n\t\tthis._timeoutId = setTimeout(() => {\n\t\t\tthis._expired = true;\n\t\t\tcallback();\n\t\t}, delay);\n\t}\n\n\t/**\n\t * Clear any pending timer. Also marks the timer as expired.\n\t */\n\tpublic clearTimeout(): void {\n\t\tif (this._timeoutId !== undefined) {\n\t\t\tclearTimeout(this._timeoutId);\n\t\t\tthis._timeoutId = undefined;\n\t\t\tthis._expired = true;\n\t\t}\n\t}\n\n\t/**\n\t * The time when this timer will expire/trigger. If the timer has expired, returns 0.\n\t */\n\tpublic get expireTime(): number {\n\t\treturn this.hasExpired() ? 0 : this.startTime + this.delay;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { InternalTypes, ValueManager } from "@fluid-internal/presence-definitions/internal";
|
|
6
|
+
/**
|
|
7
|
+
* Given a value manager, return opaque InternalTypes.StateValue.
|
|
8
|
+
*/
|
|
9
|
+
export declare function brandIVM<TManagerInterface, TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue>>(manager: TManagerInterface & ValueManager<TValue, TValueState>): InternalTypes.StateValue<TManagerInterface>;
|
|
10
|
+
/**
|
|
11
|
+
* Extract the value manager from an opaque InternalTypes.StateValue.
|
|
12
|
+
*/
|
|
13
|
+
export declare function unbrandIVM<TManagerInterface, TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue>>(branded: InternalTypes.StateValue<TManagerInterface>): ValueManager<TValue, TValueState>;
|
|
14
|
+
//# sourceMappingURL=valueManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueManager.d.ts","sourceRoot":"","sources":["../../src/utils/valueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,MAAM,+CAA+C,CAAC;AAEvD;;GAEG;AACH,wBAAgB,QAAQ,CACvB,iBAAiB,EACjB,MAAM,EACN,WAAW,SAAS,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAE/D,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,GAC5D,aAAa,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAE7C;AAED;;GAEG;AACH,wBAAgB,UAAU,CACzB,iBAAiB,EACjB,MAAM,EACN,WAAW,SAAS,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAC9D,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAEzF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Given a value manager, return opaque InternalTypes.StateValue.
|
|
7
|
+
*/
|
|
8
|
+
export function brandIVM(manager) {
|
|
9
|
+
return manager;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Extract the value manager from an opaque InternalTypes.StateValue.
|
|
13
|
+
*/
|
|
14
|
+
export function unbrandIVM(branded) {
|
|
15
|
+
return branded;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=valueManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueManager.js","sourceRoot":"","sources":["../../src/utils/valueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,MAAM,UAAU,QAAQ,CAKvB,OAA8D;IAE9D,OAAO,OAA2E,CAAC;AACpF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAIxB,OAAoD;IACrD,OAAO,OAAuD,CAAC;AAChE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tInternalTypes,\n\tValueManager,\n} from \"@fluid-internal/presence-definitions/internal\";\n\n/**\n * Given a value manager, return opaque InternalTypes.StateValue.\n */\nexport function brandIVM<\n\tTManagerInterface,\n\tTValue,\n\tTValueState extends InternalTypes.ValueDirectoryOrState<TValue>,\n>(\n\tmanager: TManagerInterface & ValueManager<TValue, TValueState>,\n): InternalTypes.StateValue<TManagerInterface> {\n\treturn manager as TManagerInterface as InternalTypes.StateValue<TManagerInterface>;\n}\n\n/**\n * Extract the value manager from an opaque InternalTypes.StateValue.\n */\nexport function unbrandIVM<\n\tTManagerInterface,\n\tTValue,\n\tTValueState extends InternalTypes.ValueDirectoryOrState<TValue>,\n>(branded: InternalTypes.StateValue<TManagerInterface>): ValueManager<TValue, TValueState> {\n\treturn branded as unknown as ValueManager<TValue, TValueState>;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { createPresenceStates, mergeUntrackedDatastore, mergeValueDirectory, } from "./presenceStates.js";
|
|
6
|
+
export { datastoreFromHandle } from "./stateDatastore.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { createPresenceStates, mergeUntrackedDatastore, mergeValueDirectory, } from "./presenceStates.js";
|
|
6
|
+
export { datastoreFromHandle } from "./stateDatastore.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreatePresenceStates,\n\tmergeUntrackedDatastore,\n\tmergeValueDirectory,\n} from \"./presenceStates.js\";\n\nexport { datastoreFromHandle } from \"./stateDatastore.js\";\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { AttendeeId, BroadcastControlSettings, PresenceWithNotifications as Presence, StatesWorkspaceSchema } from "@fluid-internal/presence-definitions";
|
|
6
|
+
import type { AnyWorkspace, InternalTypes, ValidatableOptionalState, ValidatableRequiredState, ValidatableValueDirectory } from "@fluid-internal/presence-definitions/internal";
|
|
7
|
+
import type { ClientUpdateEntry, PresenceStatesInternal, RuntimeLocalUpdateOptions, ValueElementMap, ValueUpdateRecord } from "@fluid-internal/presence-definitions/internal/workspace-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Contract for `PresenceDatastoreManager` as required by States Workspaces ({@link PresenceStatesImpl}).
|
|
10
|
+
*/
|
|
11
|
+
interface PresenceRuntime {
|
|
12
|
+
readonly presence: Presence;
|
|
13
|
+
readonly attendeeId: AttendeeId;
|
|
14
|
+
localUpdate(states: {
|
|
15
|
+
[key: string]: ClientUpdateEntry;
|
|
16
|
+
}, options: RuntimeLocalUpdateOptions): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Non-validatable types
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function mergeValueDirectory<T, TValueState extends InternalTypes.ValueRequiredState<T> | InternalTypes.ValueOptionalState<T>>(base: TValueState | InternalTypes.ValueDirectory<T> | undefined, update: TValueState | InternalTypes.ValueDirectory<T>, timeDelta: number): TValueState | InternalTypes.ValueDirectory<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Validatable base type with non-validatable update types
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function mergeValueDirectory<T, TBaseState extends ValidatableRequiredState<T> | ValidatableOptionalState<T>, TUpdateState extends InternalTypes.ValueRequiredState<T> | InternalTypes.ValueOptionalState<T>>(base: TBaseState | ValidatableValueDirectory<T> | undefined, update: TUpdateState | InternalTypes.ValueDirectory<T>, timeDelta: number): TBaseState | ValidatableValueDirectory<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Fully validatable types
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function mergeValueDirectory<T, TValueState extends ValidatableRequiredState<T> | ValidatableOptionalState<T>>(base: TValueState | ValidatableValueDirectory<T> | undefined, update: TValueState | ValidatableValueDirectory<T>, timeDelta: number): TValueState | ValidatableValueDirectory<T>;
|
|
36
|
+
/**
|
|
37
|
+
* Updates remote state into the local [untracked] datastore.
|
|
38
|
+
*
|
|
39
|
+
* @param key - The key of the datastore to merge the untracked data into.
|
|
40
|
+
* @param remoteAllKnownState - The remote state to merge into the datastore.
|
|
41
|
+
* @param datastore - The datastore to merge the untracked data into.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* In the case of ignored unmonitored data, the client entries are not stored,
|
|
45
|
+
* though the value keys will be populated and often remain empty.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function mergeUntrackedDatastore(key: string, remoteAllKnownState: ValueUpdateRecord[string], datastore: ValueElementMap<StatesWorkspaceSchema>, timeModifier: number): void;
|
|
50
|
+
/**
|
|
51
|
+
* Create a new Workspace using the DataStoreRuntime provided.
|
|
52
|
+
* @param initialContent - The initial State objects to register.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function createPresenceStates<TSchema extends StatesWorkspaceSchema>(runtime: PresenceRuntime, datastore: ValueElementMap<StatesWorkspaceSchema>, initialContent: TSchema, controls: BroadcastControlSettings | undefined): {
|
|
57
|
+
public: AnyWorkspace<TSchema>;
|
|
58
|
+
internal: PresenceStatesInternal;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=presenceStates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presenceStates.d.ts","sourceRoot":"","sources":["../../src/workspace/presenceStates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,wBAAwB,EACxB,yBAAyB,IAAI,QAAQ,EAErC,qBAAqB,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACX,YAAY,EACZ,aAAa,EAEb,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EAGzB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,KAAK,EACX,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB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