@microsoft/live-share-react 2.0.0-internal.18 → 2.0.0-internal.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin/esm/live-hooks/useLiveCanvas.js +29 -30
- package/bin/esm/live-hooks/useLiveCanvas.js.map +1 -1
- package/bin/esm/live-hooks/useLiveEvent.js +6 -15
- package/bin/esm/live-hooks/useLiveEvent.js.map +1 -1
- package/bin/esm/live-hooks/useLiveFollowMode.js +25 -34
- package/bin/esm/live-hooks/useLiveFollowMode.js.map +1 -1
- package/bin/esm/live-hooks/useLivePresence.js +5 -14
- package/bin/esm/live-hooks/useLivePresence.js.map +1 -1
- package/bin/esm/live-hooks/useLiveState.js +4 -13
- package/bin/esm/live-hooks/useLiveState.js.map +1 -1
- package/bin/esm/live-hooks/useLiveTimer.js +22 -31
- package/bin/esm/live-hooks/useLiveTimer.js.map +1 -1
- package/bin/esm/live-hooks/useMediaSynchronizer.js +24 -33
- package/bin/esm/live-hooks/useMediaSynchronizer.js.map +1 -1
- package/bin/esm/providers/AzureProvider.js +22 -27
- package/bin/esm/providers/AzureProvider.js.map +1 -1
- package/bin/esm/providers/LiveShareProvider.js +20 -21
- package/bin/esm/providers/LiveShareProvider.js.map +1 -1
- package/bin/esm/shared-hooks/internals/tree-node-types.js +1 -1
- package/bin/esm/shared-hooks/internals/tree-node-types.js.map +1 -1
- package/bin/esm/shared-hooks/internals/tree-node-utils.js +2 -4
- package/bin/esm/shared-hooks/internals/tree-node-utils.js.map +1 -1
- package/bin/esm/shared-hooks/useDynamicDDS.js +3 -12
- package/bin/esm/shared-hooks/useDynamicDDS.js.map +1 -1
- package/bin/esm/shared-hooks/useSharedMap.js +1 -1
- package/bin/esm/shared-hooks/useSharedMap.js.map +1 -1
- package/bin/esm/shared-hooks/useSharedStateRegistry.js +13 -10
- package/bin/esm/shared-hooks/useSharedStateRegistry.js.map +1 -1
- package/bin/esm/shared-hooks/useSharedTree.js +4 -4
- package/bin/esm/shared-hooks/useSharedTree.js.map +1 -1
- package/bin/esm/types/FluidMap.d.ts +151 -0
- package/bin/esm/types/FluidMap.d.ts.map +1 -0
- package/bin/esm/types/FluidMap.js +24 -0
- package/bin/esm/types/FluidMap.js.map +1 -0
- package/bin/esm/types/ResultTypes.d.ts +15 -1
- package/bin/esm/types/ResultTypes.d.ts.map +1 -1
- package/bin/esm/utils/type-check.js +1 -1
- package/bin/esm/utils/type-check.js.map +1 -1
- package/package.json +11 -21
- package/src/types/FluidMap.ts +169 -0
- package/src/types/ResultTypes.ts +18 -1
- package/tsconfig.json +3 -4
- package/bin/cjs/index.d.ts +0 -7
- package/bin/cjs/index.d.ts.map +0 -1
- package/bin/cjs/index.js +0 -23
- package/bin/cjs/index.js.map +0 -1
- package/bin/cjs/interfaces/LiveInterfaceExtensions.d.ts +0 -26
- package/bin/cjs/interfaces/LiveInterfaceExtensions.d.ts.map +0 -1
- package/bin/cjs/interfaces/LiveInterfaceExtensions.js +0 -7
- package/bin/cjs/interfaces/LiveInterfaceExtensions.js.map +0 -1
- package/bin/cjs/interfaces/index.d.ts +0 -2
- package/bin/cjs/interfaces/index.d.ts.map +0 -1
- package/bin/cjs/interfaces/index.js +0 -18
- package/bin/cjs/interfaces/index.js.map +0 -1
- package/bin/cjs/internal/errors.d.ts +0 -41
- package/bin/cjs/internal/errors.d.ts.map +0 -1
- package/bin/cjs/internal/errors.js +0 -48
- package/bin/cjs/internal/errors.js.map +0 -1
- package/bin/cjs/internal/index.d.ts +0 -3
- package/bin/cjs/internal/index.d.ts.map +0 -1
- package/bin/cjs/internal/index.js +0 -19
- package/bin/cjs/internal/index.js.map +0 -1
- package/bin/cjs/internal/type-guards.d.ts +0 -11
- package/bin/cjs/internal/type-guards.d.ts.map +0 -1
- package/bin/cjs/internal/type-guards.js +0 -24
- package/bin/cjs/internal/type-guards.js.map +0 -1
- package/bin/cjs/live-hooks/index.d.ts +0 -8
- package/bin/cjs/live-hooks/index.d.ts.map +0 -1
- package/bin/cjs/live-hooks/index.js +0 -24
- package/bin/cjs/live-hooks/index.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveCanvas.d.ts +0 -80
- package/bin/cjs/live-hooks/useLiveCanvas.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveCanvas.js +0 -244
- package/bin/cjs/live-hooks/useLiveCanvas.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveEvent.d.ts +0 -59
- package/bin/cjs/live-hooks/useLiveEvent.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveEvent.js +0 -150
- package/bin/cjs/live-hooks/useLiveEvent.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveFollowMode.d.ts +0 -163
- package/bin/cjs/live-hooks/useLiveFollowMode.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveFollowMode.js +0 -360
- package/bin/cjs/live-hooks/useLiveFollowMode.js.map +0 -1
- package/bin/cjs/live-hooks/useLivePresence.d.ts +0 -76
- package/bin/cjs/live-hooks/useLivePresence.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLivePresence.js +0 -170
- package/bin/cjs/live-hooks/useLivePresence.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveState.d.ts +0 -66
- package/bin/cjs/live-hooks/useLiveState.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveState.js +0 -134
- package/bin/cjs/live-hooks/useLiveState.js.map +0 -1
- package/bin/cjs/live-hooks/useLiveTimer.d.ts +0 -80
- package/bin/cjs/live-hooks/useLiveTimer.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useLiveTimer.js +0 -233
- package/bin/cjs/live-hooks/useLiveTimer.js.map +0 -1
- package/bin/cjs/live-hooks/useMediaSynchronizer.d.ts +0 -86
- package/bin/cjs/live-hooks/useMediaSynchronizer.d.ts.map +0 -1
- package/bin/cjs/live-hooks/useMediaSynchronizer.js +0 -301
- package/bin/cjs/live-hooks/useMediaSynchronizer.js.map +0 -1
- package/bin/cjs/package.json +0 -1
- package/bin/cjs/providers/AzureProvider.d.ts +0 -113
- package/bin/cjs/providers/AzureProvider.d.ts.map +0 -1
- package/bin/cjs/providers/AzureProvider.js +0 -127
- package/bin/cjs/providers/AzureProvider.js.map +0 -1
- package/bin/cjs/providers/LiveShareProvider.d.ts +0 -193
- package/bin/cjs/providers/LiveShareProvider.d.ts.map +0 -1
- package/bin/cjs/providers/LiveShareProvider.js +0 -205
- package/bin/cjs/providers/LiveShareProvider.js.map +0 -1
- package/bin/cjs/providers/index.d.ts +0 -3
- package/bin/cjs/providers/index.d.ts.map +0 -1
- package/bin/cjs/providers/index.js +0 -19
- package/bin/cjs/providers/index.js.map +0 -1
- package/bin/cjs/shared-hooks/index.d.ts +0 -7
- package/bin/cjs/shared-hooks/index.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/index.js +0 -23
- package/bin/cjs/shared-hooks/index.js.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-constants.d.ts +0 -3
- package/bin/cjs/shared-hooks/internals/tree-node-constants.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-constants.js +0 -6
- package/bin/cjs/shared-hooks/internals/tree-node-constants.js.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-types.d.ts +0 -10
- package/bin/cjs/shared-hooks/internals/tree-node-types.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-types.js +0 -23
- package/bin/cjs/shared-hooks/internals/tree-node-types.js.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-utils.d.ts +0 -33
- package/bin/cjs/shared-hooks/internals/tree-node-utils.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/internals/tree-node-utils.js +0 -193
- package/bin/cjs/shared-hooks/internals/tree-node-utils.js.map +0 -1
- package/bin/cjs/shared-hooks/useDynamicDDS.d.ts +0 -23
- package/bin/cjs/shared-hooks/useDynamicDDS.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useDynamicDDS.js +0 -87
- package/bin/cjs/shared-hooks/useDynamicDDS.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedMap.d.ts +0 -25
- package/bin/cjs/shared-hooks/useSharedMap.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedMap.js +0 -134
- package/bin/cjs/shared-hooks/useSharedMap.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedState.d.ts +0 -22
- package/bin/cjs/shared-hooks/useSharedState.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedState.js +0 -80
- package/bin/cjs/shared-hooks/useSharedState.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedStateRegistry.d.ts +0 -37
- package/bin/cjs/shared-hooks/useSharedStateRegistry.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedStateRegistry.js +0 -120
- package/bin/cjs/shared-hooks/useSharedStateRegistry.js.map +0 -1
- package/bin/cjs/shared-hooks/useSharedTree.d.ts +0 -57
- package/bin/cjs/shared-hooks/useSharedTree.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useSharedTree.js +0 -123
- package/bin/cjs/shared-hooks/useSharedTree.js.map +0 -1
- package/bin/cjs/shared-hooks/useTreeNode.d.ts +0 -96
- package/bin/cjs/shared-hooks/useTreeNode.d.ts.map +0 -1
- package/bin/cjs/shared-hooks/useTreeNode.js +0 -135
- package/bin/cjs/shared-hooks/useTreeNode.js.map +0 -1
- package/bin/cjs/types/ActionTypes.d.ts +0 -112
- package/bin/cjs/types/ActionTypes.d.ts.map +0 -1
- package/bin/cjs/types/ActionTypes.js +0 -7
- package/bin/cjs/types/ActionTypes.js.map +0 -1
- package/bin/cjs/types/PropTypes.d.ts +0 -56
- package/bin/cjs/types/PropTypes.d.ts.map +0 -1
- package/bin/cjs/types/PropTypes.js +0 -7
- package/bin/cjs/types/PropTypes.js.map +0 -1
- package/bin/cjs/types/ResultTypes.d.ts +0 -334
- package/bin/cjs/types/ResultTypes.d.ts.map +0 -1
- package/bin/cjs/types/ResultTypes.js +0 -7
- package/bin/cjs/types/ResultTypes.js.map +0 -1
- package/bin/cjs/types/index.d.ts +0 -4
- package/bin/cjs/types/index.d.ts.map +0 -1
- package/bin/cjs/types/index.js +0 -20
- package/bin/cjs/types/index.js.map +0 -1
- package/bin/cjs/utils/index.d.ts +0 -2
- package/bin/cjs/utils/index.d.ts.map +0 -1
- package/bin/cjs/utils/index.js +0 -18
- package/bin/cjs/utils/index.js.map +0 -1
- package/bin/cjs/utils/type-check.d.ts +0 -15
- package/bin/cjs/utils/type-check.d.ts.map +0 -1
- package/bin/cjs/utils/type-check.js +0 -62
- package/bin/cjs/utils/type-check.js.map +0 -1
- package/bin/index.d.ts +0 -7
- package/bin/index.d.ts.map +0 -1
- package/bin/index.js +0 -7
- package/bin/index.js.map +0 -1
- package/bin/interfaces/LiveInterfaceExtensions.d.ts +0 -26
- package/bin/interfaces/LiveInterfaceExtensions.d.ts.map +0 -1
- package/bin/interfaces/LiveInterfaceExtensions.js +0 -6
- package/bin/interfaces/LiveInterfaceExtensions.js.map +0 -1
- package/bin/interfaces/index.d.ts +0 -2
- package/bin/interfaces/index.d.ts.map +0 -1
- package/bin/interfaces/index.js +0 -2
- package/bin/interfaces/index.js.map +0 -1
- package/bin/internal/errors.d.ts +0 -41
- package/bin/internal/errors.d.ts.map +0 -1
- package/bin/internal/errors.js +0 -42
- package/bin/internal/errors.js.map +0 -1
- package/bin/internal/index.d.ts +0 -3
- package/bin/internal/index.d.ts.map +0 -1
- package/bin/internal/index.js +0 -3
- package/bin/internal/index.js.map +0 -1
- package/bin/internal/type-guards.d.ts +0 -11
- package/bin/internal/type-guards.d.ts.map +0 -1
- package/bin/internal/type-guards.js +0 -20
- package/bin/internal/type-guards.js.map +0 -1
- package/bin/live-hooks/index.d.ts +0 -8
- package/bin/live-hooks/index.d.ts.map +0 -1
- package/bin/live-hooks/index.js +0 -8
- package/bin/live-hooks/index.js.map +0 -1
- package/bin/live-hooks/useLiveCanvas.d.ts +0 -29
- package/bin/live-hooks/useLiveCanvas.d.ts.map +0 -1
- package/bin/live-hooks/useLiveCanvas.js +0 -160
- package/bin/live-hooks/useLiveCanvas.js.map +0 -1
- package/bin/live-hooks/useLiveEvent.d.ts +0 -23
- package/bin/live-hooks/useLiveEvent.d.ts.map +0 -1
- package/bin/live-hooks/useLiveEvent.js +0 -108
- package/bin/live-hooks/useLiveEvent.js.map +0 -1
- package/bin/live-hooks/useLiveFollowMode.d.ts +0 -24
- package/bin/live-hooks/useLiveFollowMode.d.ts.map +0 -1
- package/bin/live-hooks/useLiveFollowMode.js +0 -211
- package/bin/live-hooks/useLiveFollowMode.js.map +0 -1
- package/bin/live-hooks/useLivePresence.d.ts +0 -26
- package/bin/live-hooks/useLivePresence.d.ts.map +0 -1
- package/bin/live-hooks/useLivePresence.js +0 -106
- package/bin/live-hooks/useLivePresence.js.map +0 -1
- package/bin/live-hooks/useLiveState.d.ts +0 -21
- package/bin/live-hooks/useLiveState.d.ts.map +0 -1
- package/bin/live-hooks/useLiveState.js +0 -83
- package/bin/live-hooks/useLiveState.js.map +0 -1
- package/bin/live-hooks/useLiveTimer.d.ts +0 -25
- package/bin/live-hooks/useLiveTimer.d.ts.map +0 -1
- package/bin/live-hooks/useLiveTimer.js +0 -172
- package/bin/live-hooks/useLiveTimer.js.map +0 -1
- package/bin/live-hooks/useMediaSynchronizer.d.ts +0 -25
- package/bin/live-hooks/useMediaSynchronizer.d.ts.map +0 -1
- package/bin/live-hooks/useMediaSynchronizer.js +0 -234
- package/bin/live-hooks/useMediaSynchronizer.js.map +0 -1
- package/bin/providers/AzureProvider.d.ts +0 -113
- package/bin/providers/AzureProvider.d.ts.map +0 -1
- package/bin/providers/AzureProvider.js +0 -119
- package/bin/providers/AzureProvider.js.map +0 -1
- package/bin/providers/LiveShareProvider.d.ts +0 -91
- package/bin/providers/LiveShareProvider.d.ts.map +0 -1
- package/bin/providers/LiveShareProvider.js +0 -95
- package/bin/providers/LiveShareProvider.js.map +0 -1
- package/bin/providers/index.d.ts +0 -3
- package/bin/providers/index.d.ts.map +0 -1
- package/bin/providers/index.js +0 -3
- package/bin/providers/index.js.map +0 -1
- package/bin/shared-hooks/index.d.ts +0 -5
- package/bin/shared-hooks/index.d.ts.map +0 -1
- package/bin/shared-hooks/index.js +0 -5
- package/bin/shared-hooks/index.js.map +0 -1
- package/bin/shared-hooks/useDynamicDDS.d.ts +0 -23
- package/bin/shared-hooks/useDynamicDDS.d.ts.map +0 -1
- package/bin/shared-hooks/useDynamicDDS.js +0 -72
- package/bin/shared-hooks/useDynamicDDS.js.map +0 -1
- package/bin/shared-hooks/useSharedMap.d.ts +0 -23
- package/bin/shared-hooks/useSharedMap.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedMap.js +0 -114
- package/bin/shared-hooks/useSharedMap.js.map +0 -1
- package/bin/shared-hooks/useSharedState.d.ts +0 -22
- package/bin/shared-hooks/useSharedState.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedState.js +0 -74
- package/bin/shared-hooks/useSharedState.js.map +0 -1
- package/bin/shared-hooks/useSharedStateRegistry.d.ts +0 -37
- package/bin/shared-hooks/useSharedStateRegistry.d.ts.map +0 -1
- package/bin/shared-hooks/useSharedStateRegistry.js +0 -105
- package/bin/shared-hooks/useSharedStateRegistry.js.map +0 -1
- package/bin/types/ActionTypes.d.ts +0 -112
- package/bin/types/ActionTypes.d.ts.map +0 -1
- package/bin/types/ActionTypes.js +0 -6
- package/bin/types/ActionTypes.js.map +0 -1
- package/bin/types/PropTypes.d.ts +0 -8
- package/bin/types/PropTypes.d.ts.map +0 -1
- package/bin/types/PropTypes.js +0 -6
- package/bin/types/PropTypes.js.map +0 -1
- package/bin/types/ResultTypes.d.ts +0 -302
- package/bin/types/ResultTypes.d.ts.map +0 -1
- package/bin/types/ResultTypes.js +0 -6
- package/bin/types/ResultTypes.js.map +0 -1
- package/bin/types/index.d.ts +0 -4
- package/bin/types/index.d.ts.map +0 -1
- package/bin/types/index.js +0 -4
- package/bin/types/index.js.map +0 -1
- package/bin/utils/index.d.ts +0 -2
- package/bin/utils/index.d.ts.map +0 -1
- package/bin/utils/index.js +0 -2
- package/bin/utils/index.js.map +0 -1
- package/bin/utils/type-check.d.ts +0 -15
- package/bin/utils/type-check.d.ts.map +0 -1
- package/bin/utils/type-check.js +0 -54
- package/bin/utils/type-check.js.map +0 -1
- package/tsconfig.cjs.json +0 -14
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
// Copied from https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/src/fluidMap.ts
|
|
25
|
+
// Fluid 2.x does not export these types. Keep this copy out of the package barrel.
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Like TypeScript's built-in `Iterable` type.
|
|
29
|
+
*
|
|
30
|
+
* @privateRemarks
|
|
31
|
+
* This exists to be unaffected by TypeScript's version and configuration options.
|
|
32
|
+
*
|
|
33
|
+
* @sealed @public
|
|
34
|
+
*/
|
|
35
|
+
export interface FluidIterable<T> {
|
|
36
|
+
/**
|
|
37
|
+
* Returns an iterator over the elements in this iterable.
|
|
38
|
+
*
|
|
39
|
+
* @remarks Works like the built-in {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator | \[Symbol.iterator\]} protocol.
|
|
40
|
+
*/
|
|
41
|
+
[Symbol.iterator](): FluidIterableIterator<T>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Like TypeScript's built-in iterable iterator type.
|
|
46
|
+
*
|
|
47
|
+
* @privateRemarks
|
|
48
|
+
* The done branch uses `any` rather than `undefined` to match TypeScript's built-in IteratorReturnResult, which defaults to any for the same reason.
|
|
49
|
+
* Using `undefined` causes TypeScript to include it in type inference at call sites like `Array.from` which would infer `T | undefined` instead of `T`.
|
|
50
|
+
* The done value is rarely meaningful to callers since values are mainly consumed when done is false.
|
|
51
|
+
* Thus `any` is not particularly harmful here, and the unsafety is worth it as
|
|
52
|
+
* it interacts better with the existing TypeScript `IteratorResult` interfaces where `TReturn` defaults to any.
|
|
53
|
+
*
|
|
54
|
+
* @sealed @public
|
|
55
|
+
*/
|
|
56
|
+
export interface FluidIterableIterator<T> extends FluidIterable<T> {
|
|
57
|
+
/**
|
|
58
|
+
* Returns the next element in the iteration sequence.
|
|
59
|
+
*
|
|
60
|
+
* @remarks Works like the built-in {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol | Iterator.next} method.
|
|
61
|
+
* When there are remaining elements, returns `\{ value: T; done?: false \}`.
|
|
62
|
+
* When the iteration is complete, returns `\{ value: any; done: true \}`.
|
|
63
|
+
*/
|
|
64
|
+
next(): { value: T; done?: false } | { value: any; done: true };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Like TypeScript's built in `ReadonlyMap` type.
|
|
69
|
+
* Unlike the built in `ReadonlyMap`, this interface includes Symbol.toStringTag.
|
|
70
|
+
*
|
|
71
|
+
* @privateRemarks
|
|
72
|
+
* This exists so that Fluid has a `ReadonlyMap` type which is unaffected by TypeScript's version and configuration options,
|
|
73
|
+
* and safe to implement without being broken by changes to TypeScript's default ReadonlyMap type.
|
|
74
|
+
* All behavior exposed through this interface should be compatible with the corresponding behavior of built in ReadonlyMaps,
|
|
75
|
+
* but it may lack some of the newer APIs,
|
|
76
|
+
* and might express the type slightly different from how TypeScript does in its `ReadonlyMap` type.
|
|
77
|
+
*
|
|
78
|
+
* @sealed @public
|
|
79
|
+
*/
|
|
80
|
+
export interface FluidReadonlyMap<K, V> {
|
|
81
|
+
/**
|
|
82
|
+
* Returns an iterable of entries in the map.
|
|
83
|
+
*/
|
|
84
|
+
[Symbol.iterator](): FluidIterableIterator<[K, V]>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The number of entries in the map.
|
|
88
|
+
*/
|
|
89
|
+
readonly size: number;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Returns an iterable of key, value pairs for every entry in the map.
|
|
93
|
+
*/
|
|
94
|
+
entries(): FluidIterableIterator<[K, V]>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Executes the provided function once per each key/value pair in the map.
|
|
98
|
+
*/
|
|
99
|
+
forEach(
|
|
100
|
+
callbackfn: (value: V, key: K, map: FluidReadonlyMap<K, V>) => void,
|
|
101
|
+
// Typing inherited from ReadonlyMap.
|
|
102
|
+
thisArg?: any
|
|
103
|
+
): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns the value associated to the specified key, or undefined if there is none.
|
|
107
|
+
*/
|
|
108
|
+
get(key: K): V | undefined;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Returns a boolean indicating whether an element with the specified key exists or not.
|
|
112
|
+
*/
|
|
113
|
+
has(key: K): boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Returns an iterable of keys in the map.
|
|
117
|
+
*/
|
|
118
|
+
keys(): FluidIterableIterator<K>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Returns an iterable of values in the map.
|
|
122
|
+
*/
|
|
123
|
+
values(): FluidIterableIterator<V>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag | Symbol.toStringTag}
|
|
127
|
+
*/
|
|
128
|
+
readonly [Symbol.toStringTag]: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Like TypeScript's built in `Map` type.
|
|
133
|
+
*
|
|
134
|
+
* @privateRemarks
|
|
135
|
+
* This exists so that Fluid has a `Map` type which is unaffected by TypeScript's version and configuration options,
|
|
136
|
+
* and safe to implement without being broken by changes to TypeScript's default Map type.
|
|
137
|
+
* All behavior exposed through this interface should be compatible with the corresponding behavior of JavaScript Maps,
|
|
138
|
+
* but it may lack some of the newer APIs,
|
|
139
|
+
* and might express the type slightly different from how TypeScript does in its `Map` type.
|
|
140
|
+
*
|
|
141
|
+
* @sealed @public
|
|
142
|
+
*/
|
|
143
|
+
export interface FluidMap<K, V> extends FluidReadonlyMap<K, V> {
|
|
144
|
+
/**
|
|
145
|
+
* Removes the specified element from the map by its key.
|
|
146
|
+
*
|
|
147
|
+
* @remarks
|
|
148
|
+
* Unlike the built-in `Map.delete`, this returns `void` instead of a boolean.
|
|
149
|
+
* This is intentional: in a distributed system, the caller often cannot reliably know
|
|
150
|
+
* whether the element existed at the time of deletion.
|
|
151
|
+
* Subtypes may override this to return a boolean if appropriate.
|
|
152
|
+
*/
|
|
153
|
+
delete(key: K): void;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Executes the provided function once per each key/value pair in the map.
|
|
157
|
+
*/
|
|
158
|
+
forEach(
|
|
159
|
+
callbackfn: (value: V, key: K, map: FluidMap<K, V>) => void,
|
|
160
|
+
// Typing inherited from Map.
|
|
161
|
+
thisArg?: any
|
|
162
|
+
): void;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Adds a new element with a specified key and value to the map.
|
|
166
|
+
* If an element with the same key already exists, the element will be updated.
|
|
167
|
+
*/
|
|
168
|
+
set(key: K, value: V): void;
|
|
169
|
+
}
|
package/src/types/ResultTypes.ts
CHANGED
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
OnUpdateLivePresenceAction,
|
|
51
51
|
SendLiveEventAction,
|
|
52
52
|
} from "./ActionTypes.js";
|
|
53
|
+
import type { FluidMap } from "./FluidMap.js";
|
|
53
54
|
|
|
54
55
|
export interface IAzureContainerResults {
|
|
55
56
|
/**
|
|
@@ -69,6 +70,16 @@ export interface ILiveShareContainerResults extends IAzureContainerResults {
|
|
|
69
70
|
created: boolean;
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
/**
|
|
74
|
+
* A value-typed SharedMap compatible with Fluid 2.x and 3.x.
|
|
75
|
+
* Uses SharedMap's mutators without changing FluidMap's forEach callback type.
|
|
76
|
+
*/
|
|
77
|
+
export type TypedSharedMap<TData> = Omit<
|
|
78
|
+
FluidMap<string, TData>,
|
|
79
|
+
"delete" | "set"
|
|
80
|
+
> &
|
|
81
|
+
SharedMap;
|
|
82
|
+
|
|
72
83
|
/**
|
|
73
84
|
* @deprecated use {@link useSharedTree} instead.
|
|
74
85
|
*
|
|
@@ -77,8 +88,14 @@ export interface ILiveShareContainerResults extends IAzureContainerResults {
|
|
|
77
88
|
export interface IUseSharedMapResults<TData> {
|
|
78
89
|
/**
|
|
79
90
|
* The Fluid `SharedMap` object.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* Uses a local FluidMap type for value-typed get, forEach, values, and entries across Fluid 2.x and 3.x,
|
|
94
|
+
* while preserving ISharedMap's boolean delete result and chainable set method.
|
|
95
|
+
* Fluid 3.x maps are not assignable to the built-in Map type; use new Map(sharedMap)
|
|
96
|
+
* when a built-in Map is required.
|
|
80
97
|
*/
|
|
81
|
-
sharedMap:
|
|
98
|
+
sharedMap: TypedSharedMap<TData> | undefined;
|
|
82
99
|
/**
|
|
83
100
|
* Callback method to get entries in the `SharedMap`.
|
|
84
101
|
*/
|
package/tsconfig.json
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
4
|
/* Basic Options */
|
|
5
5
|
// "incremental": true, /* Enable incremental compilation */
|
|
6
|
-
"target": "
|
|
7
|
-
"module": "Node16" /* Specify module code generation
|
|
8
|
-
"moduleResolution": "Node16",
|
|
6
|
+
"target": "ES2022" /* Specify ECMAScript target version. */,
|
|
7
|
+
"module": "Node16" /* Specify module code generation. */,
|
|
9
8
|
"lib": [
|
|
10
|
-
"
|
|
9
|
+
"ES2022",
|
|
11
10
|
"DOM"
|
|
12
11
|
] /* Specify library files to be included in the compilation. */,
|
|
13
12
|
"allowJs": false /* Allow javascript files to be compiled. */,
|
package/bin/cjs/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./providers/index.js";
|
|
2
|
-
export * from "./shared-hooks/index.js";
|
|
3
|
-
export * from "./live-hooks/index.js";
|
|
4
|
-
export * from "./types/index.js";
|
|
5
|
-
export * from "./providers/index.js";
|
|
6
|
-
export * from "./interfaces/index.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/bin/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
package/bin/cjs/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./providers/index.js"), exports);
|
|
18
|
-
__exportStar(require("./shared-hooks/index.js"), exports);
|
|
19
|
-
__exportStar(require("./live-hooks/index.js"), exports);
|
|
20
|
-
__exportStar(require("./types/index.js"), exports);
|
|
21
|
-
__exportStar(require("./providers/index.js"), exports);
|
|
22
|
-
__exportStar(require("./interfaces/index.js"), exports);
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/bin/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,0DAAwC;AACxC,wDAAsC;AACtC,mDAAiC;AACjC,uDAAqC;AACrC,wDAAsC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Object response for a received event
|
|
7
|
-
*/
|
|
8
|
-
export interface IReceiveLiveEvent<TEvent = any> {
|
|
9
|
-
/**
|
|
10
|
-
* The value of the event that was sent
|
|
11
|
-
*/
|
|
12
|
-
value: TEvent;
|
|
13
|
-
/**
|
|
14
|
-
* True if the local client was the one to send this event
|
|
15
|
-
*/
|
|
16
|
-
local: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Client ID of the user that sent the event
|
|
19
|
-
*/
|
|
20
|
-
clientId: string;
|
|
21
|
-
/**
|
|
22
|
-
* Server timestamp at which the event was sent
|
|
23
|
-
*/
|
|
24
|
-
timestamp: number;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=LiveInterfaceExtensions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LiveInterfaceExtensions.d.ts","sourceRoot":"","sources":["../../../src/interfaces/LiveInterfaceExtensions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM,GAAG,GAAG;IAC3C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LiveInterfaceExtensions.js","sourceRoot":"","sources":["../../../src/interfaces/LiveInterfaceExtensions.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./LiveInterfaceExtensions.js"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
*/
|
|
4
|
-
declare class UseLiveDataObjectActionError extends Error {
|
|
5
|
-
constructor(ddsName: string, functionName: string, message: string);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export declare class ActionContainerNotJoinedError extends UseLiveDataObjectActionError {
|
|
11
|
-
constructor(ddsName: string, functionName: string);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export declare class ActionLiveDataObjectUndefinedError extends UseLiveDataObjectActionError {
|
|
17
|
-
constructor(ddsName: string, functionName: string);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @hidden
|
|
21
|
-
*/
|
|
22
|
-
export declare class ActionLiveDataObjectInitializedError extends UseLiveDataObjectActionError {
|
|
23
|
-
constructor(ddsName: string, functionName: string);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @hidden
|
|
27
|
-
*/
|
|
28
|
-
export interface ITeamsJsSdkError {
|
|
29
|
-
/**
|
|
30
|
-
* error code
|
|
31
|
-
*/
|
|
32
|
-
errorCode: number;
|
|
33
|
-
/**
|
|
34
|
-
* Optional description for the error. This may contain useful information for web-app developers.
|
|
35
|
-
* This string will not be localized and is not for end-user consumption.
|
|
36
|
-
* App should not depend on the string content. The exact value may change. This is only for debugging purposes.
|
|
37
|
-
*/
|
|
38
|
-
message?: string;
|
|
39
|
-
}
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/internal/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAM,4BAA6B,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIrE;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,4BAA4B;gBAC/D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAOpD;AAED;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,4BAA4B;gBACpE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAQpD;AAED;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,4BAA4B;gBACtE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAQpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionLiveDataObjectInitializedError = exports.ActionLiveDataObjectUndefinedError = exports.ActionContainerNotJoinedError = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
class UseLiveDataObjectActionError extends Error {
|
|
8
|
-
constructor(ddsName, functionName, message) {
|
|
9
|
-
const hookName = `use${toFirstLetterUppercase(ddsName)}`;
|
|
10
|
-
super(`${hookName} ${functionName}: ${message}`);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
class ActionContainerNotJoinedError extends UseLiveDataObjectActionError {
|
|
17
|
-
constructor(ddsName, functionName) {
|
|
18
|
-
super(ddsName, functionName, "container has not yet been joined.\nTo fix this error, ensure `container` from `useFluidObjectsContext()` is defined before calling this function.\nIf using `<LiveShareProvider>`, you can instead check the `joined` response is true from `useLiveShareContext()` before calling this function.");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.ActionContainerNotJoinedError = ActionContainerNotJoinedError;
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
25
|
-
class ActionLiveDataObjectUndefinedError extends UseLiveDataObjectActionError {
|
|
26
|
-
constructor(ddsName, functionName) {
|
|
27
|
-
const hookName = `use${toFirstLetterUppercase(ddsName)}`;
|
|
28
|
-
super(ddsName, functionName, `${ddsName} is undefined, which means it is still being dynamically created.\nTo fix this error, ensure that \`${ddsName}\` (found in the response of \`${hookName}\`) is defined before calling this function.`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ActionLiveDataObjectUndefinedError = ActionLiveDataObjectUndefinedError;
|
|
32
|
-
/**
|
|
33
|
-
* @hidden
|
|
34
|
-
*/
|
|
35
|
-
class ActionLiveDataObjectInitializedError extends UseLiveDataObjectActionError {
|
|
36
|
-
constructor(ddsName, functionName) {
|
|
37
|
-
const hookName = `use${toFirstLetterUppercase(ddsName)}`;
|
|
38
|
-
super(ddsName, functionName, `${ddsName} is not yet initialized.\nTo fix this error, ensure that \`${ddsName}?.isInitialized\` is true (found in the response of \`${hookName}\`) before calling this function.`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.ActionLiveDataObjectInitializedError = ActionLiveDataObjectInitializedError;
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
function toFirstLetterUppercase(word) {
|
|
46
|
-
return word[0].toUpperCase() + word.substring(1);
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/internal/errors.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,4BAA6B,SAAQ,KAAK;IAC5C,YAAY,OAAe,EAAE,YAAoB,EAAE,OAAe;QAC9D,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,KAAK,CAAC,GAAG,QAAQ,IAAI,YAAY,KAAK,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;CACJ;AAED;;GAEG;AACH,MAAa,6BAA8B,SAAQ,4BAA4B;IAC3E,YAAY,OAAe,EAAE,YAAoB;QAC7C,KAAK,CACD,OAAO,EACP,YAAY,EACZ,oSAAoS,CACvS,CAAC;IACN,CAAC;CACJ;AARD,sEAQC;AAED;;GAEG;AACH,MAAa,kCAAmC,SAAQ,4BAA4B;IAChF,YAAY,OAAe,EAAE,YAAoB;QAC7C,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,KAAK,CACD,OAAO,EACP,YAAY,EACZ,GAAG,OAAO,uGAAuG,OAAO,kCAAkC,QAAQ,8CAA8C,CACnN,CAAC;IACN,CAAC;CACJ;AATD,gFASC;AAED;;GAEG;AACH,MAAa,oCAAqC,SAAQ,4BAA4B;IAClF,YAAY,OAAe,EAAE,YAAoB;QAC7C,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,KAAK,CACD,OAAO,EACP,YAAY,EACZ,GAAG,OAAO,8DAA8D,OAAO,yDAAyD,QAAQ,mCAAmC,CACtL,CAAC;IACN,CAAC;CACJ;AATD,oFASC;AAkBD;;GAEG;AACH,SAAS,sBAAsB,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./errors.js"), exports);
|
|
18
|
-
__exportStar(require("./type-guards.js"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,mDAAiC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ITeamsJsSdkError } from "./errors.js";
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* Used for useLiveState and useSharedState for checking if a value is a prevState callback
|
|
5
|
-
*/
|
|
6
|
-
export declare function isPrevStateCallback<TState>(value: any): value is (value: TState) => TState;
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export declare function isITeamsJsSdkError(value: any): value is ITeamsJsSdkError;
|
|
11
|
-
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../../src/internal/type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EACtC,KAAK,EAAE,GAAG,GACX,KAAK,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAEpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAKxE"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPrevStateCallback = isPrevStateCallback;
|
|
4
|
-
exports.isITeamsJsSdkError = isITeamsJsSdkError;
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Used for useLiveState and useSharedState for checking if a value is a prevState callback
|
|
8
|
-
*/
|
|
9
|
-
function isPrevStateCallback(value) {
|
|
10
|
-
return typeof value === "function";
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
function isITeamsJsSdkError(value) {
|
|
16
|
-
if (!value)
|
|
17
|
-
return false;
|
|
18
|
-
if (typeof value.errorCode !== "number")
|
|
19
|
-
return false;
|
|
20
|
-
if (value.message === undefined)
|
|
21
|
-
return true;
|
|
22
|
-
return typeof value.message === "string";
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=type-guards.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../../../src/internal/type-guards.ts"],"names":[],"mappings":";;AAMA,kDAIC;AAKD,gDAKC;AAlBD;;;GAGG;AACH,SAAgB,mBAAmB,CAC/B,KAAU;IAEV,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAU;IACzC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC7C,OAAO,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC;AAC7C,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./useLivePresence.js";
|
|
2
|
-
export * from "./useLiveFollowMode.js";
|
|
3
|
-
export * from "./useLiveState.js";
|
|
4
|
-
export * from "./useMediaSynchronizer.js";
|
|
5
|
-
export * from "./useLiveEvent.js";
|
|
6
|
-
export * from "./useLiveCanvas.js";
|
|
7
|
-
export * from "./useLiveTimer.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/live-hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useLivePresence.js"), exports);
|
|
18
|
-
__exportStar(require("./useLiveFollowMode.js"), exports);
|
|
19
|
-
__exportStar(require("./useLiveState.js"), exports);
|
|
20
|
-
__exportStar(require("./useMediaSynchronizer.js"), exports);
|
|
21
|
-
__exportStar(require("./useLiveEvent.js"), exports);
|
|
22
|
-
__exportStar(require("./useLiveCanvas.js"), exports);
|
|
23
|
-
__exportStar(require("./useLiveTimer.js"), exports);
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/live-hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,yDAAuC;AACvC,oDAAkC;AAClC,4DAA0C;AAC1C,oDAAkC;AAClC,qDAAmC;AACnC,oDAAkC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the Microsoft Live Share SDK License.
|
|
4
|
-
*/
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { IUseLiveCanvasOptionalProps, IUseLiveCanvasResults } from "../types/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* React hook for using a Live Share Canvas `LiveCanvas` and `InkingManager`.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Use this hook to set up an `LiveCanvas` object, which is used for collaborative inking. It takes several input parameters, including a unique key,
|
|
12
|
-
* a reference to a canvas element, and various settings for the inking tool, brush, and canvas offset and scale.
|
|
13
|
-
* This hook can only be used in a child component of `<LiveShareProvider>` or `<AzureProvider>`.
|
|
14
|
-
*
|
|
15
|
-
* @param uniqueKey the unique key for the `LiveCanvas`. If one does not yet exist, a new one.
|
|
16
|
-
* @param canvasElementRef the HTML div element ref or document ID that `InkingManager` will use for canvas-based collaboration.
|
|
17
|
-
* @param props Optional. Other optional props.
|
|
18
|
-
* @param props.active Optional. Stateful boolean that will activate/de-activate `InkingManager` accordingly.
|
|
19
|
-
* @param props.tool Optional. Stateful enum for what tool to use in the `InkingManager`.
|
|
20
|
-
* @param props.lineBrush Optional. Stateful lineBrush object for the selected lineBrush options to use in `InkingManager`.
|
|
21
|
-
* @param props.offset Optional. Stateful offset point to use in the `InkingManager`. Gets the viewport offset. Defaults to 0,0.
|
|
22
|
-
* @param props.scale Optional. Stateful scale number to use in the `InkingManager`. Defaults to 1 and must be greater than 0.
|
|
23
|
-
* @param props.referencePoint Optional. Stateful reference point enum to use in the `InkingManger`. Defaults to "center".
|
|
24
|
-
* @param props.isCursorShared Optional. Stateful boolean flag for whether cursor should be shared in `LiveCanvas`. Defaults to false.
|
|
25
|
-
* @param props.localUserPictureUrl Optional. url string for the local user to display alongside their cursor. Defaults to undefined.
|
|
26
|
-
* @param props.node Optional. A Fluid `LiveCanvasTree` `TreeNode` instance to swap out the underlying storage solution for strokes.
|
|
27
|
-
* To learn more, look at Fluid's [SharedTree](https://fluidframework.com/docs/data-structures/tree/) documentation.
|
|
28
|
-
* @param allowedRoles Optional. The user roles that are allowed to start/stop/pause the timer.
|
|
29
|
-
*
|
|
30
|
-
* @returns `IUseLiveCanvasResults` object that contains the `liveCanvas` data object and `inkingManager`.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
```jsx
|
|
34
|
-
import { useLiveCanvas } from "@microsoft/live-share-react";
|
|
35
|
-
import { InkingTool } from "@microsoft/live-share-canvas";
|
|
36
|
-
import { useRef } from "react";
|
|
37
|
-
|
|
38
|
-
// Unique identifier that distinguishes this useLiveCanvas from others in your app
|
|
39
|
-
const UNIQUE_KEY = "CUSTOM-LIVE-CANVAS";
|
|
40
|
-
|
|
41
|
-
// Example component
|
|
42
|
-
export function ExampleLiveCanvas() {
|
|
43
|
-
const liveCanvasRef = useRef(null);
|
|
44
|
-
const { liveCanvas, inkingManager } = useLiveCanvas(
|
|
45
|
-
"CUSTOM-LIVE-CANVAS",
|
|
46
|
-
liveCanvasRef,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div style={{ position: "absolute"}}>
|
|
51
|
-
<div
|
|
52
|
-
ref={liveCanvasRef}
|
|
53
|
-
// Best practice is to not define inline styles
|
|
54
|
-
style={{ width: "556px", height: "224px" }}
|
|
55
|
-
/>
|
|
56
|
-
{!!liveCanvas && (
|
|
57
|
-
<div>
|
|
58
|
-
<button
|
|
59
|
-
onClick={() => {
|
|
60
|
-
inkingManager.tool = InkingTool.pen;
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
{"Pen"}
|
|
64
|
-
</button>
|
|
65
|
-
<button
|
|
66
|
-
onClick={() => {
|
|
67
|
-
inkingManager.tool = InkingTool.laserPointer;
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{"Laser pointer"}
|
|
71
|
-
</button>
|
|
72
|
-
</div>
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
```
|
|
78
|
-
*/
|
|
79
|
-
export declare function useLiveCanvas(uniqueKey: string, canvasElementRef: React.RefObject<HTMLElement | null> | string, props?: IUseLiveCanvasOptionalProps): IUseLiveCanvasResults;
|
|
80
|
-
//# sourceMappingURL=useLiveCanvas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveCanvas.d.ts","sourceRoot":"","sources":["../../../src/live-hooks/useLiveCanvas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACH,2BAA2B,EAC3B,qBAAqB,EACxB,MAAM,mBAAmB,CAAC;AAK3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,MAAM,EAC9D,KAAK,CAAC,EAAE,2BAA2B,GACpC,qBAAqB,CA0KvB"}
|