@microsoft/live-share-react 1.0.0-preview.5
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/.nycrc.json +10 -0
- package/LICENSE +87 -0
- package/README.md +543 -0
- package/bin/index.d.ts +7 -0
- package/bin/index.d.ts.map +1 -0
- package/bin/index.js +7 -0
- package/bin/index.js.map +1 -0
- package/bin/interfaces/LiveInterfaceExtensions.d.ts +9 -0
- package/bin/interfaces/LiveInterfaceExtensions.d.ts.map +1 -0
- package/bin/interfaces/LiveInterfaceExtensions.js +6 -0
- package/bin/interfaces/LiveInterfaceExtensions.js.map +1 -0
- package/bin/interfaces/index.d.ts +2 -0
- package/bin/interfaces/index.d.ts.map +1 -0
- package/bin/interfaces/index.js +2 -0
- package/bin/interfaces/index.js.map +1 -0
- package/bin/internal-hooks/index.d.ts +2 -0
- package/bin/internal-hooks/index.d.ts.map +1 -0
- package/bin/internal-hooks/index.js +2 -0
- package/bin/internal-hooks/index.js.map +1 -0
- package/bin/internal-hooks/useDynamicDDSRegistry.d.ts +14 -0
- package/bin/internal-hooks/useDynamicDDSRegistry.d.ts.map +1 -0
- package/bin/internal-hooks/useDynamicDDSRegistry.js +142 -0
- package/bin/internal-hooks/useDynamicDDSRegistry.js.map +1 -0
- package/bin/internal-hooks/useSharedStateRegistry.d.ts +31 -0
- package/bin/internal-hooks/useSharedStateRegistry.d.ts.map +1 -0
- package/bin/internal-hooks/useSharedStateRegistry.js +100 -0
- package/bin/internal-hooks/useSharedStateRegistry.js.map +1 -0
- package/bin/internal-hooks/useStateRef.d.ts +7 -0
- package/bin/internal-hooks/useStateRef.d.ts.map +1 -0
- package/bin/internal-hooks/useStateRef.js +15 -0
- package/bin/internal-hooks/useStateRef.js.map +1 -0
- package/bin/live-hooks/index.d.ts +7 -0
- package/bin/live-hooks/index.d.ts.map +1 -0
- package/bin/live-hooks/index.js +7 -0
- package/bin/live-hooks/index.js.map +1 -0
- package/bin/live-hooks/useLiveAICompletion.d.ts +29 -0
- package/bin/live-hooks/useLiveAICompletion.d.ts.map +1 -0
- package/bin/live-hooks/useLiveAICompletion.js +186 -0
- package/bin/live-hooks/useLiveAICompletion.js.map +1 -0
- package/bin/live-hooks/useLiveCanvas.d.ts +28 -0
- package/bin/live-hooks/useLiveCanvas.d.ts.map +1 -0
- package/bin/live-hooks/useLiveCanvas.js +167 -0
- package/bin/live-hooks/useLiveCanvas.js.map +1 -0
- package/bin/live-hooks/useLiveCoPilot.d.ts +28 -0
- package/bin/live-hooks/useLiveCoPilot.d.ts.map +1 -0
- package/bin/live-hooks/useLiveCoPilot.js +178 -0
- package/bin/live-hooks/useLiveCoPilot.js.map +1 -0
- package/bin/live-hooks/useLiveEvent.d.ts +22 -0
- package/bin/live-hooks/useLiveEvent.d.ts.map +1 -0
- package/bin/live-hooks/useLiveEvent.js +86 -0
- package/bin/live-hooks/useLiveEvent.js.map +1 -0
- package/bin/live-hooks/useLivePresence.d.ts +26 -0
- package/bin/live-hooks/useLivePresence.d.ts.map +1 -0
- package/bin/live-hooks/useLivePresence.js +93 -0
- package/bin/live-hooks/useLivePresence.js.map +1 -0
- package/bin/live-hooks/useLiveState.d.ts +20 -0
- package/bin/live-hooks/useLiveState.d.ts.map +1 -0
- package/bin/live-hooks/useLiveState.js +71 -0
- package/bin/live-hooks/useLiveState.js.map +1 -0
- package/bin/live-hooks/useLiveTimer.d.ts +8 -0
- package/bin/live-hooks/useLiveTimer.d.ts.map +1 -0
- package/bin/live-hooks/useLiveTimer.js +132 -0
- package/bin/live-hooks/useLiveTimer.js.map +1 -0
- package/bin/live-hooks/useMediaSynchronizer.d.ts +23 -0
- package/bin/live-hooks/useMediaSynchronizer.d.ts.map +1 -0
- package/bin/live-hooks/useMediaSynchronizer.js +162 -0
- package/bin/live-hooks/useMediaSynchronizer.js.map +1 -0
- package/bin/live-share-turbo/AzureTurboClient.d.ts +39 -0
- package/bin/live-share-turbo/AzureTurboClient.d.ts.map +1 -0
- package/bin/live-share-turbo/AzureTurboClient.js +56 -0
- package/bin/live-share-turbo/AzureTurboClient.js.map +1 -0
- package/bin/live-share-turbo/LiveShareTurboClient.d.ts +53 -0
- package/bin/live-share-turbo/LiveShareTurboClient.d.ts.map +1 -0
- package/bin/live-share-turbo/LiveShareTurboClient.js +69 -0
- package/bin/live-share-turbo/LiveShareTurboClient.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboDataObject.d.ts +31 -0
- package/bin/live-share-turbo/dds-objects/TurboDataObject.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboDataObject.js +75 -0
- package/bin/live-share-turbo/dds-objects/TurboDataObject.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.d.ts +48 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.js +104 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveCanvas.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveEvent.d.ts +28 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveEvent.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveEvent.js +68 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveEvent.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.d.ts +60 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.js +111 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveMediaSession.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLivePresence.d.ts +77 -0
- package/bin/live-share-turbo/dds-objects/TurboLivePresence.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLivePresence.js +137 -0
- package/bin/live-share-turbo/dds-objects/TurboLivePresence.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveState.d.ts +30 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveState.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveState.js +74 -0
- package/bin/live-share-turbo/dds-objects/TurboLiveState.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboSharedMap.d.ts +61 -0
- package/bin/live-share-turbo/dds-objects/TurboSharedMap.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/TurboSharedMap.js +108 -0
- package/bin/live-share-turbo/dds-objects/TurboSharedMap.js.map +1 -0
- package/bin/live-share-turbo/dds-objects/index.d.ts +8 -0
- package/bin/live-share-turbo/dds-objects/index.d.ts.map +1 -0
- package/bin/live-share-turbo/dds-objects/index.js +8 -0
- package/bin/live-share-turbo/dds-objects/index.js.map +1 -0
- package/bin/live-share-turbo/index.d.ts +5 -0
- package/bin/live-share-turbo/index.d.ts.map +1 -0
- package/bin/live-share-turbo/index.js +5 -0
- package/bin/live-share-turbo/index.js.map +1 -0
- package/bin/live-share-turbo/interfaces/IFluidTurboClient.d.ts +15 -0
- package/bin/live-share-turbo/interfaces/IFluidTurboClient.d.ts.map +1 -0
- package/bin/live-share-turbo/interfaces/IFluidTurboClient.js +2 -0
- package/bin/live-share-turbo/interfaces/IFluidTurboClient.js.map +1 -0
- package/bin/live-share-turbo/interfaces/index.d.ts +3 -0
- package/bin/live-share-turbo/interfaces/index.d.ts.map +1 -0
- package/bin/live-share-turbo/interfaces/index.js +3 -0
- package/bin/live-share-turbo/interfaces/index.js.map +1 -0
- package/bin/live-share-turbo/internals/FluidTurboClient.d.ts +39 -0
- package/bin/live-share-turbo/internals/FluidTurboClient.d.ts.map +1 -0
- package/bin/live-share-turbo/internals/FluidTurboClient.js +121 -0
- package/bin/live-share-turbo/internals/FluidTurboClient.js.map +1 -0
- package/bin/live-share-turbo/internals/index.d.ts +2 -0
- package/bin/live-share-turbo/internals/index.d.ts.map +1 -0
- package/bin/live-share-turbo/internals/index.js +2 -0
- package/bin/live-share-turbo/internals/index.js.map +1 -0
- package/bin/live-share-turbo/internals/types.d.ts +4 -0
- package/bin/live-share-turbo/internals/types.d.ts.map +1 -0
- package/bin/live-share-turbo/internals/types.js +2 -0
- package/bin/live-share-turbo/internals/types.js.map +1 -0
- package/bin/providers/AzureProvider.d.ts +34 -0
- package/bin/providers/AzureProvider.d.ts.map +1 -0
- package/bin/providers/AzureProvider.js +102 -0
- package/bin/providers/AzureProvider.js.map +1 -0
- package/bin/providers/FluidContextProvider.d.ts +34 -0
- package/bin/providers/FluidContextProvider.d.ts.map +1 -0
- package/bin/providers/FluidContextProvider.js +99 -0
- package/bin/providers/FluidContextProvider.js.map +1 -0
- package/bin/providers/LiveShareContextProvider.d.ts +42 -0
- package/bin/providers/LiveShareContextProvider.d.ts.map +1 -0
- package/bin/providers/LiveShareContextProvider.js +63 -0
- package/bin/providers/LiveShareContextProvider.js.map +1 -0
- package/bin/providers/LiveShareProvider.d.ts +42 -0
- package/bin/providers/LiveShareProvider.d.ts.map +1 -0
- package/bin/providers/LiveShareProvider.js +66 -0
- package/bin/providers/LiveShareProvider.js.map +1 -0
- package/bin/providers/index.d.ts +3 -0
- package/bin/providers/index.d.ts.map +1 -0
- package/bin/providers/index.js +3 -0
- package/bin/providers/index.js.map +1 -0
- package/bin/shared-hooks/index.d.ts +5 -0
- package/bin/shared-hooks/index.d.ts.map +1 -0
- package/bin/shared-hooks/index.js +5 -0
- package/bin/shared-hooks/index.js.map +1 -0
- package/bin/shared-hooks/useDynamicDDS.d.ts +19 -0
- package/bin/shared-hooks/useDynamicDDS.d.ts.map +1 -0
- package/bin/shared-hooks/useDynamicDDS.js +68 -0
- package/bin/shared-hooks/useDynamicDDS.js.map +1 -0
- package/bin/shared-hooks/useLockedTask.d.ts +11 -0
- package/bin/shared-hooks/useLockedTask.d.ts.map +1 -0
- package/bin/shared-hooks/useLockedTask.js +82 -0
- package/bin/shared-hooks/useLockedTask.js.map +1 -0
- package/bin/shared-hooks/useSharedMap.d.ts +22 -0
- package/bin/shared-hooks/useSharedMap.d.ts.map +1 -0
- package/bin/shared-hooks/useSharedMap.js +106 -0
- package/bin/shared-hooks/useSharedMap.js.map +1 -0
- package/bin/shared-hooks/useSharedState.d.ts +21 -0
- package/bin/shared-hooks/useSharedState.d.ts.map +1 -0
- package/bin/shared-hooks/useSharedState.js +63 -0
- package/bin/shared-hooks/useSharedState.js.map +1 -0
- package/bin/shared-hooks/useTaskManager.d.ts +13 -0
- package/bin/shared-hooks/useTaskManager.d.ts.map +1 -0
- package/bin/shared-hooks/useTaskManager.js +86 -0
- package/bin/shared-hooks/useTaskManager.js.map +1 -0
- package/bin/types/ActionTypes.d.ts +30 -0
- package/bin/types/ActionTypes.d.ts.map +1 -0
- package/bin/types/ActionTypes.js +6 -0
- package/bin/types/ActionTypes.js.map +1 -0
- package/bin/types/PropTypes.d.ts +8 -0
- package/bin/types/PropTypes.d.ts.map +1 -0
- package/bin/types/PropTypes.js +6 -0
- package/bin/types/PropTypes.js.map +1 -0
- package/bin/types/ResultTypes.d.ts +163 -0
- package/bin/types/ResultTypes.d.ts.map +1 -0
- package/bin/types/ResultTypes.js +6 -0
- package/bin/types/ResultTypes.js.map +1 -0
- package/bin/types/index.d.ts +4 -0
- package/bin/types/index.d.ts.map +1 -0
- package/bin/types/index.js +4 -0
- package/bin/types/index.js.map +1 -0
- package/bin/utils/getContainerSchema.d.ts +8 -0
- package/bin/utils/getContainerSchema.d.ts.map +1 -0
- package/bin/utils/getContainerSchema.js +41 -0
- package/bin/utils/getContainerSchema.js.map +1 -0
- package/bin/utils/index.d.ts +2 -0
- package/bin/utils/index.d.ts.map +1 -0
- package/bin/utils/index.js +2 -0
- package/bin/utils/index.js.map +1 -0
- package/bin/utils/type-check.d.ts +15 -0
- package/bin/utils/type-check.d.ts.map +1 -0
- package/bin/utils/type-check.js +54 -0
- package/bin/utils/type-check.js.map +1 -0
- package/package.json +47 -0
- package/src/index.ts +6 -0
- package/src/interfaces/LiveInterfaceExtensions.ts +9 -0
- package/src/interfaces/index.ts +1 -0
- package/src/internal-hooks/index.ts +1 -0
- package/src/internal-hooks/useSharedStateRegistry.ts +163 -0
- package/src/live-hooks/index.ts +6 -0
- package/src/live-hooks/useLiveCanvas.ts +198 -0
- package/src/live-hooks/useLiveEvent.ts +117 -0
- package/src/live-hooks/useLivePresence.ts +124 -0
- package/src/live-hooks/useLiveState.ts +108 -0
- package/src/live-hooks/useLiveTimer.ts +184 -0
- package/src/live-hooks/useMediaSynchronizer.ts +200 -0
- package/src/providers/AzureProvider.tsx +177 -0
- package/src/providers/LiveShareProvider.tsx +140 -0
- package/src/providers/index.ts +2 -0
- package/src/shared-hooks/index.ts +4 -0
- package/src/shared-hooks/useDynamicDDS.ts +71 -0
- package/src/shared-hooks/useSharedMap.ts +132 -0
- package/src/shared-hooks/useSharedState.ts +85 -0
- package/src/shared-hooks/useTaskManager.ts +82 -0
- package/src/types/ActionTypes.ts +76 -0
- package/src/types/PropTypes.ts +10 -0
- package/src/types/ResultTypes.ts +187 -0
- package/src/types/index.ts +3 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/type-check.ts +69 -0
- package/tinylicious.log +4 -0
- package/tsconfig.build.json +6 -0
- package/tsconfig.json +72 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
11
|
+
import { LiveCanvas } from "@microsoft/live-share-canvas";
|
|
12
|
+
export class TurboLiveCanvas extends TurboDataObject {
|
|
13
|
+
constructor(dataObject) {
|
|
14
|
+
const onDidOverrideDataObject = () => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (this._isInitialized && this._inkingManager) {
|
|
17
|
+
(_a = this._inkingManager) === null || _a === void 0 ? void 0 : _a.clear();
|
|
18
|
+
(_b = this._inkingManager) === null || _b === void 0 ? void 0 : _b.removeAllListeners();
|
|
19
|
+
try {
|
|
20
|
+
yield this.dataObject.initialize(this._inkingManager);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error(error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
super(dataObject, [], onDidOverrideDataObject);
|
|
28
|
+
this._isInitialized = false;
|
|
29
|
+
}
|
|
30
|
+
get isInitialized() {
|
|
31
|
+
return this._isInitialized;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Gets the current cursor sharing status of this client.
|
|
35
|
+
*/
|
|
36
|
+
get isCursorShared() {
|
|
37
|
+
return this.dataObject.isCursorShared;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Sets the current cursor sharing status of this client.
|
|
41
|
+
*/
|
|
42
|
+
set isCursorShared(value) {
|
|
43
|
+
this.dataObject.isCursorShared = value;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Gets the list of roles that are allowed to emit wet stroke events.
|
|
47
|
+
*/
|
|
48
|
+
get allowedRoles() {
|
|
49
|
+
return this.dataObject.allowedRoles;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Sets the list of roles that are allowed to emit wet stroke events.
|
|
53
|
+
*/
|
|
54
|
+
set allowedRoles(value) {
|
|
55
|
+
this.dataObject.allowedRoles = value;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Optional callback that allows the consuming application to provide a
|
|
59
|
+
* friendly display name and/or a picture that will be used on remote devices
|
|
60
|
+
* to render shared cursors.
|
|
61
|
+
*/
|
|
62
|
+
get onGetLocalUserInfo() {
|
|
63
|
+
return this.dataObject.onGetLocalUserInfo;
|
|
64
|
+
}
|
|
65
|
+
set onGetLocalUserInfo(value) {
|
|
66
|
+
this.dataObject.onGetLocalUserInfo = value;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Optional callback that allows the consuming application to provide its own
|
|
70
|
+
* live cursor visual representation by extending the abstract `LiveCursor`
|
|
71
|
+
* class. The callback is passed the user information retrieved via the
|
|
72
|
+
* `onGetLocalUserInfo` calback, if provided.
|
|
73
|
+
*/
|
|
74
|
+
get onCreateLiveCursor() {
|
|
75
|
+
return this.dataObject.onCreateLiveCursor;
|
|
76
|
+
}
|
|
77
|
+
set onCreateLiveCursor(value) {
|
|
78
|
+
this.dataObject.onCreateLiveCursor = value;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* initialize the object.
|
|
82
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
83
|
+
*/
|
|
84
|
+
initialize(inkingManager) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
yield this.dataObject.initialize(inkingManager);
|
|
87
|
+
this._inkingManager = inkingManager;
|
|
88
|
+
this._isInitialized = true;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static create(turboClient, uniqueKey, onDidFirstInitialize) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const results = yield turboClient.getDDS(`<LiveCanvas>:${uniqueKey}`, LiveCanvas, (dds) => {
|
|
94
|
+
return new TurboLiveCanvas(dds);
|
|
95
|
+
});
|
|
96
|
+
const dds = results.dds;
|
|
97
|
+
if (results.created) {
|
|
98
|
+
onDidFirstInitialize === null || onDidFirstInitialize === void 0 ? void 0 : onDidFirstInitialize(dds);
|
|
99
|
+
}
|
|
100
|
+
return dds;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=TurboLiveCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLiveCanvas.js","sourceRoot":"","sources":["../../../src/live-share-turbo/dds-objects/TurboLiveCanvas.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAA4B,UAAU,EAAc,MAAM,8BAA8B,CAAC;AAGhG,MAAM,OAAO,eAAgB,SAAQ,eAGpC;IAIG,YAAY,UAAsB;QAC9B,MAAM,uBAAuB,GAAG,GAAS,EAAE;;YACvC,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,EAAE;gBAC5C,MAAA,IAAI,CAAC,cAAc,0CAAE,KAAK,EAAE,CAAC;gBAC7B,MAAA,IAAI,CAAC,cAAc,0CAAE,kBAAkB,EAAE,CAAC;gBAC1C,IAAI;oBACA,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;iBACzD;gBAAC,OAAO,KAAU,EAAE;oBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACxB;aACJ;QACL,CAAC,CAAA,CAAC;QACF,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAC;QAf3C,mBAAc,GAAY,KAAK,CAAC;IAgBxC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,IAAI,cAAc,CAAC,KAAc;QAC7B,IAAI,CAAC,UAAU,CAAC,cAAc,GAAG,KAAK,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,UAAU,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,0 +1,28 @@
|
|
|
1
|
+
import { ILiveEvent, ILiveEventEvents, LiveEvent, UserMeetingRole } from "@microsoft/live-share";
|
|
2
|
+
import { IFluidTurboClient } from "../../live-share-react/bin/live-share-turbo/interfaces";
|
|
3
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
4
|
+
export declare class TurboLiveEvent<TEvent extends ILiveEvent = ILiveEvent> extends TurboDataObject<ILiveEventEvents<TEvent>, LiveEvent<TEvent>> {
|
|
5
|
+
private _isInitialized;
|
|
6
|
+
private _allowedRoles?;
|
|
7
|
+
constructor(dataObject: LiveEvent<TEvent>);
|
|
8
|
+
get isInitialized(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* initialize the object.
|
|
11
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
12
|
+
*/
|
|
13
|
+
initialize(allowedRoles?: UserMeetingRole[]): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Broadcasts an event to all other clients.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* The event will be queued for delivery if the client isn't currently connected.
|
|
19
|
+
* @param evt Optional. Event to send. If omitted, an event will still be sent but it won't
|
|
20
|
+
* include any custom event data.
|
|
21
|
+
* @returns The full event object that was sent, including the timestamp of when the event
|
|
22
|
+
* was sent and the clientId if known. The clientId will be `undefined` if the client is
|
|
23
|
+
* disconnected at time of delivery.
|
|
24
|
+
*/
|
|
25
|
+
sendEvent(evt?: Partial<TEvent>): TEvent;
|
|
26
|
+
static create<TEvent extends ILiveEvent = ILiveEvent>(turboClient: IFluidTurboClient, uniqueKey: string, onDidFirstInitialize?: (dds: TurboLiveEvent<TEvent>) => void): Promise<TurboLiveEvent<TEvent>>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=TurboLiveEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLiveEvent.d.ts","sourceRoot":"","sources":["../../../src/live-share-turbo/dds-objects/TurboLiveEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAmB,MAAM,uBAAuB,CAAC;AAElH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,cAAc,CACvB,MAAM,SAAS,UAAU,GAAG,UAAU,CACxC,SAAQ,eAAe,CACrB,gBAAgB,CAAC,MAAM,CAAC,EACxB,SAAS,CAAC,MAAM,CAAC,CACpB;IACG,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,aAAa,CAAC,CAAoB;gBAE9B,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC;IAazC,IAAW,aAAa,IAAI,OAAO,CAElC;IAED;;;OAGG;IACU,UAAU,CAAC,YAAY,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxE;;;;;;;;;;OAUG;IACI,SAAS,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM;WAI3B,MAAM,CAAC,MAAM,SAAS,UAAU,GAAG,UAAU,EAC7D,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,MAAM,EACjB,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,IAAI,GAC7D,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;CAiBrC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { LiveEvent, LiveEventEvents } from "@microsoft/live-share";
|
|
11
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
12
|
+
export class TurboLiveEvent extends TurboDataObject {
|
|
13
|
+
constructor(dataObject) {
|
|
14
|
+
const onDidOverrideDataObject = () => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
if (this._isInitialized) {
|
|
16
|
+
try {
|
|
17
|
+
yield this.dataObject.initialize(this._allowedRoles);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error(error);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
super(dataObject, Object.keys(LiveEventEvents), onDidOverrideDataObject);
|
|
25
|
+
this._isInitialized = false;
|
|
26
|
+
}
|
|
27
|
+
get isInitialized() {
|
|
28
|
+
return this._isInitialized;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* initialize the object.
|
|
32
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
33
|
+
*/
|
|
34
|
+
initialize(allowedRoles) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
yield this.dataObject.initialize(allowedRoles);
|
|
37
|
+
this._allowedRoles = allowedRoles;
|
|
38
|
+
this._isInitialized = true;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Broadcasts an event to all other clients.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* The event will be queued for delivery if the client isn't currently connected.
|
|
46
|
+
* @param evt Optional. Event to send. If omitted, an event will still be sent but it won't
|
|
47
|
+
* include any custom event data.
|
|
48
|
+
* @returns The full event object that was sent, including the timestamp of when the event
|
|
49
|
+
* was sent and the clientId if known. The clientId will be `undefined` if the client is
|
|
50
|
+
* disconnected at time of delivery.
|
|
51
|
+
*/
|
|
52
|
+
sendEvent(evt) {
|
|
53
|
+
return this.dataObject.sendEvent(evt);
|
|
54
|
+
}
|
|
55
|
+
static create(turboClient, uniqueKey, onDidFirstInitialize) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const results = yield turboClient.getDDS(`<LiveEvent>:${uniqueKey}`, (LiveEvent), (dds) => {
|
|
58
|
+
return new TurboLiveEvent(dds);
|
|
59
|
+
});
|
|
60
|
+
const dds = results.dds;
|
|
61
|
+
if (results.created) {
|
|
62
|
+
onDidFirstInitialize === null || onDidFirstInitialize === void 0 ? void 0 : onDidFirstInitialize(dds);
|
|
63
|
+
}
|
|
64
|
+
return dds;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=TurboLiveEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLiveEvent.js","sourceRoot":"","sources":["../../../src/live-share-turbo/dds-objects/TurboLiveEvent.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAgC,SAAS,EAAmB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGlH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,OAAO,cAEX,SAAQ,eAGT;IAIG,YAAY,UAA6B;QACrC,MAAM,uBAAuB,GAAG,GAAS,EAAE;YACvC,IAAI,IAAI,CAAC,cAAc,EAAE;gBACrB,IAAI;oBACA,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;iBACxD;gBAAC,OAAO,KAAU,EAAE;oBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACxB;aACJ;QACL,CAAC,CAAA,CAAC;QACF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,uBAAuB,CAAC,CAAC;QAbrE,mBAAc,GAAY,KAAK,CAAC;IAcxC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACU,UAAU,CAAC,YAAgC;;YACpD,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YAC/C,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC/B,CAAC;KAAA;IAED;;;;;;;;;;OAUG;IACI,SAAS,CAAC,GAAqB;QAClC,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAO,MAAM,CACtB,WAA8B,EAC9B,SAAiB,EACjB,oBAA4D;;YAE5D,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,CAIpC,eAAe,SAAS,EAAE,EAC1B,CAAA,SAAiB,CAAA,EACjB,CAAC,GAAmB,EAA0B,EAAE;gBAC5C,OAAO,IAAI,cAAc,CAAC,GAAwB,CAAC,CAAC;YACxD,CAAC,CACJ,CAAC;YACF,MAAM,GAAG,GAAG,OAAO,CAAC,GAA6B,CAAC;YAClD,IAAI,OAAO,CAAC,OAAO,EAAE;gBACjB,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAG,GAAG,CAAC,CAAC;aAC/B;YACD,OAAO,GAAG,CAAC;QACf,CAAC;KAAA;CACJ"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LiveTelemetryLogger, UserMeetingRole } from "@microsoft/live-share";
|
|
2
|
+
import { IFluidTurboClient } from "../../live-share-react/bin/live-share-turbo/interfaces";
|
|
3
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
4
|
+
import { ExtendedMediaSessionAction, IMediaPlayer, IMediaPlayerState, LiveMediaSession, LiveMediaSessionCoordinator, MediaPlayerSynchronizer, MediaSessionActionThrottler } from "@microsoft/live-share-media";
|
|
5
|
+
export declare class TurboLiveMediaSession extends TurboDataObject<any, LiveMediaSession> {
|
|
6
|
+
private _isInitialized;
|
|
7
|
+
private _allowedRoles?;
|
|
8
|
+
constructor(dataObject: LiveMediaSession);
|
|
9
|
+
get isInitialized(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Extension point that lets applications replace the default logic for throttling the sessions
|
|
12
|
+
* local sync behavior.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* The `LiveMediaCoordinator` is fairly aggressive at wanting to keep the local media player
|
|
16
|
+
* in sync with the rest of the group. This aggressiveness can result in the coordinator sending
|
|
17
|
+
* new sync actions before the local player has finished responding to the previous sync action.
|
|
18
|
+
* The `ActionThrottler` gives apps fine grain control over how aggressive they want sync to be.
|
|
19
|
+
*
|
|
20
|
+
* By default, a `RepeatedAction` throttler is used which prevents the same sync action from
|
|
21
|
+
* being sent within an adjustable time period.
|
|
22
|
+
*/
|
|
23
|
+
get actionThrottler(): MediaSessionActionThrottler;
|
|
24
|
+
set actionThrottler(value: MediaSessionActionThrottler);
|
|
25
|
+
/**
|
|
26
|
+
* The group coordinator for the session.
|
|
27
|
+
*/
|
|
28
|
+
get coordinator(): LiveMediaSessionCoordinator;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the logger used by the session and coordinator.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* This is used by the `MediaPlayerSynchronizer` to log events.
|
|
34
|
+
*/
|
|
35
|
+
get logger(): LiveTelemetryLogger;
|
|
36
|
+
/**
|
|
37
|
+
* initialize the object.
|
|
38
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
39
|
+
*/
|
|
40
|
+
initialize(allowedRoles?: UserMeetingRole[]): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Registers an action handler with the session.
|
|
43
|
+
* @param action Name of the action to register a handler for.
|
|
44
|
+
* @param handler Function called when the action is triggered.
|
|
45
|
+
*/
|
|
46
|
+
setActionHandler(action: ExtendedMediaSessionAction, handler: MediaSessionActionHandler | null): void;
|
|
47
|
+
/**
|
|
48
|
+
* Registers a handler that will be queried anytime the group coordinate needs to know the
|
|
49
|
+
* local players transport state and position.
|
|
50
|
+
*/
|
|
51
|
+
setRequestPlayerStateHandler(handler: () => IMediaPlayerState): void;
|
|
52
|
+
/**
|
|
53
|
+
* Begins synchronizing the playback of a media element.
|
|
54
|
+
* @param player Something that "looks like" and HTML Media Element.
|
|
55
|
+
* @returns A new synchronizer instance. Call `synchronizer.end()` to stop synchronizing the elements playback.
|
|
56
|
+
*/
|
|
57
|
+
synchronize(player: IMediaPlayer): MediaPlayerSynchronizer;
|
|
58
|
+
static create(turboClient: IFluidTurboClient, uniqueKey: string, onDidFirstInitialize?: (dds: TurboLiveMediaSession) => void): Promise<TurboLiveMediaSession>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=TurboLiveMediaSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLiveMediaSession.d.ts","sourceRoot":"","sources":["../../../src/live-share-turbo/dds-objects/TurboLiveMediaSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACH,0BAA0B,EAC1B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC9B,MAAM,6BAA6B,CAAC;AAErC,qBAAa,qBAAsB,SAAQ,eAAe,CACtD,GAAG,EACH,gBAAgB,CACnB;IACG,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,aAAa,CAAC,CAAoB;gBAE9B,UAAU,EAAE,gBAAgB;IAaxC,IAAW,aAAa,IAAI,OAAO,CAElC;IAED;;;;;;;;;;;;OAYG;IACH,IAAW,eAAe,IAAI,2BAA2B,CAExD;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,2BAA2B,EAE5D;IAED;;OAEG;IACH,IAAW,WAAW,IAAI,2BAA2B,CAEpD;IAED;;;;;OAKG;IACH,IAAW,MAAM,IAAI,mBAAmB,CAEvC;IAED;;;OAGG;IACU,UAAU,CAAC,YAAY,CAAC,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxE;;;;OAIG;IACI,gBAAgB,CACnB,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAC1C,IAAI;IAIP;;;OAGG;IACI,4BAA4B,CAAC,OAAO,EAAE,MAAM,iBAAiB;IAIpE;;;;OAIG;IACI,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,uBAAuB;WAI7C,MAAM,CACtB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,MAAM,EACjB,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,IAAI,GAC5D,OAAO,CAAC,qBAAqB,CAAC;CAcpC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
11
|
+
import { LiveMediaSession, } from "@microsoft/live-share-media";
|
|
12
|
+
export class TurboLiveMediaSession extends TurboDataObject {
|
|
13
|
+
constructor(dataObject) {
|
|
14
|
+
const onDidOverrideDataObject = () => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
if (this._isInitialized) {
|
|
16
|
+
try {
|
|
17
|
+
yield this.dataObject.initialize(this._allowedRoles);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error(error);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
super(dataObject, [], onDidOverrideDataObject);
|
|
25
|
+
this._isInitialized = false;
|
|
26
|
+
}
|
|
27
|
+
get isInitialized() {
|
|
28
|
+
return this._isInitialized;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Extension point that lets applications replace the default logic for throttling the sessions
|
|
32
|
+
* local sync behavior.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* The `LiveMediaCoordinator` is fairly aggressive at wanting to keep the local media player
|
|
36
|
+
* in sync with the rest of the group. This aggressiveness can result in the coordinator sending
|
|
37
|
+
* new sync actions before the local player has finished responding to the previous sync action.
|
|
38
|
+
* The `ActionThrottler` gives apps fine grain control over how aggressive they want sync to be.
|
|
39
|
+
*
|
|
40
|
+
* By default, a `RepeatedAction` throttler is used which prevents the same sync action from
|
|
41
|
+
* being sent within an adjustable time period.
|
|
42
|
+
*/
|
|
43
|
+
get actionThrottler() {
|
|
44
|
+
return this.dataObject.actionThrottler;
|
|
45
|
+
}
|
|
46
|
+
set actionThrottler(value) {
|
|
47
|
+
this.dataObject.actionThrottler = value;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The group coordinator for the session.
|
|
51
|
+
*/
|
|
52
|
+
get coordinator() {
|
|
53
|
+
return this.dataObject.coordinator;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns the logger used by the session and coordinator.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* This is used by the `MediaPlayerSynchronizer` to log events.
|
|
60
|
+
*/
|
|
61
|
+
get logger() {
|
|
62
|
+
return this.dataObject.logger;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* initialize the object.
|
|
66
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
67
|
+
*/
|
|
68
|
+
initialize(allowedRoles) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
yield this.dataObject.initialize(allowedRoles);
|
|
71
|
+
this._allowedRoles = allowedRoles;
|
|
72
|
+
this._isInitialized = true;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Registers an action handler with the session.
|
|
77
|
+
* @param action Name of the action to register a handler for.
|
|
78
|
+
* @param handler Function called when the action is triggered.
|
|
79
|
+
*/
|
|
80
|
+
setActionHandler(action, handler) {
|
|
81
|
+
return this.dataObject.setActionHandler(action, handler);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Registers a handler that will be queried anytime the group coordinate needs to know the
|
|
85
|
+
* local players transport state and position.
|
|
86
|
+
*/
|
|
87
|
+
setRequestPlayerStateHandler(handler) {
|
|
88
|
+
return this.dataObject.setRequestPlayerStateHandler(handler);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Begins synchronizing the playback of a media element.
|
|
92
|
+
* @param player Something that "looks like" and HTML Media Element.
|
|
93
|
+
* @returns A new synchronizer instance. Call `synchronizer.end()` to stop synchronizing the elements playback.
|
|
94
|
+
*/
|
|
95
|
+
synchronize(player) {
|
|
96
|
+
return this.dataObject.synchronize(player);
|
|
97
|
+
}
|
|
98
|
+
static create(turboClient, uniqueKey, onDidFirstInitialize) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const results = yield turboClient.getDDS(`<LiveMediaSession>:${uniqueKey}`, LiveMediaSession, (dds) => {
|
|
101
|
+
return new TurboLiveMediaSession(dds);
|
|
102
|
+
});
|
|
103
|
+
const dds = results.dds;
|
|
104
|
+
if (results.created) {
|
|
105
|
+
onDidFirstInitialize === null || onDidFirstInitialize === void 0 ? void 0 : onDidFirstInitialize(dds);
|
|
106
|
+
}
|
|
107
|
+
return dds;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=TurboLiveMediaSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLiveMediaSession.js","sourceRoot":"","sources":["../../../src/live-share-turbo/dds-objects/TurboLiveMediaSession.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAIH,gBAAgB,GAInB,MAAM,6BAA6B,CAAC;AAErC,MAAM,OAAO,qBAAsB,SAAQ,eAG1C;IAIG,YAAY,UAA4B;QACpC,MAAM,uBAAuB,GAAG,GAAS,EAAE;YACvC,IAAI,IAAI,CAAC,cAAc,EAAE;gBACrB,IAAI;oBACA,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;iBACxD;gBAAC,OAAO,KAAU,EAAE;oBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACxB;aACJ;QACL,CAAC,CAAA,CAAC;QACF,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAC;QAb3C,mBAAc,GAAY,KAAK,CAAC;IAcxC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;IAC3C,CAAC;IAED,IAAW,eAAe,CAAC,KAAkC;QACzD,IAAI,CAAC,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,IAAW,WA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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ILivePresenceEvents, LivePresence, LivePresenceUser, PresenceState } from "@microsoft/live-share";
|
|
2
|
+
import { IFluidTurboClient } from "../../live-share-react/bin/live-share-turbo/interfaces";
|
|
3
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
4
|
+
export declare class TurboLivePresence<TData extends object = object> extends TurboDataObject<ILivePresenceEvents<TData>, LivePresence<TData>> {
|
|
5
|
+
private _isInitialized;
|
|
6
|
+
private _userId?;
|
|
7
|
+
private _data?;
|
|
8
|
+
private _state?;
|
|
9
|
+
constructor(dataObject: LivePresence<TData>);
|
|
10
|
+
get isInitialized(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Number of seconds without a presence update before a remote user is considered offline.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Defaults to a value of `20` seconds. The minimum value is 0.1 seconds for testing purposes.
|
|
16
|
+
*/
|
|
17
|
+
get expirationPeriod(): number;
|
|
18
|
+
set expirationPeriod(value: number);
|
|
19
|
+
/**
|
|
20
|
+
* Optional data object shared by the user.
|
|
21
|
+
*/
|
|
22
|
+
get data(): TData | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The users current presence state.
|
|
25
|
+
*/
|
|
26
|
+
get state(): PresenceState;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the ID of the local user.
|
|
29
|
+
*/
|
|
30
|
+
get userId(): string;
|
|
31
|
+
/**
|
|
32
|
+
* initialize the object.
|
|
33
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
34
|
+
*/
|
|
35
|
+
initialize(userId?: string, data?: TData, state?: PresenceState): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns a snapshot of the current list of presence objects being tracked.
|
|
38
|
+
* @returns Array of presence objects.
|
|
39
|
+
*/
|
|
40
|
+
toArray(): LivePresenceUser<TData>[];
|
|
41
|
+
/**
|
|
42
|
+
* Updates the users presence state and/or shared data object.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This will trigger the immediate broadcast of the users presence to all other clients.
|
|
46
|
+
* @param state Optional. Presence state to change.
|
|
47
|
+
* @param data Optional. Data object to change. A deep copy of the data object is saved to avoid any future changes.
|
|
48
|
+
*/
|
|
49
|
+
updatePresence(state?: PresenceState, data?: TData): void;
|
|
50
|
+
/**
|
|
51
|
+
* Enumerates each user the object is tracking presence for.
|
|
52
|
+
* @param callback Function to call for each user.
|
|
53
|
+
* @param callback.user Current presence information for a user.
|
|
54
|
+
* @param filter Optional. Presence state to filter enumeration to.
|
|
55
|
+
*/
|
|
56
|
+
forEach(callback: (user: LivePresenceUser<TData>) => void, filter?: PresenceState): void;
|
|
57
|
+
/**
|
|
58
|
+
* Counts the number of users that the object is tracking presence for.
|
|
59
|
+
* @param filter Optional. Presence state to filter count to.
|
|
60
|
+
* @returns Total number of other users we've seen or number of users with a given presence status.
|
|
61
|
+
*/
|
|
62
|
+
getCount(filter?: PresenceState): number;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the current presence info for a specific client ID.
|
|
65
|
+
* @param clientId The ID of the client to retrieve.
|
|
66
|
+
* @returns The current presence information for the client if they've connected to the space.
|
|
67
|
+
*/
|
|
68
|
+
getPresenceForClient(clientId: string): LivePresenceUser<TData> | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the current presence info for a specific user.
|
|
71
|
+
* @param userId The ID of the user to retrieve.
|
|
72
|
+
* @returns The current presence information for the user if they've connected to the space.
|
|
73
|
+
*/
|
|
74
|
+
getPresenceForUser(userId: string): LivePresenceUser<TData> | undefined;
|
|
75
|
+
static create<TData extends object = object>(turboClient: IFluidTurboClient, uniqueKey: string, onDidFirstInitialize?: (dds: TurboLivePresence<TData>) => void): Promise<TurboLivePresence<TData>>;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=TurboLivePresence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLivePresence.d.ts","sourceRo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,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,IAAI,EACjD,MAAM,CAAC,EAAE,aAAa,GACvB,IAAI;IAIP;;;;OAIG;IACI,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,MAAM;IAI/C;;;;OAIG;IACI,oBAAoB,CACvB,QAAQ,EAAE,MAAM,GACjB,gBAAgB,CAAC,KAAK,CAAC,GAAG,SAAS;IAItC;;;;OAIG;IACI,kBAAkB,CACrB,MAAM,EAAE,MAAM,GACf,gBAAgB,CAAC,KAAK,CAAC,GAAG,SAAS;WAIlB,MAAM,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EACpD,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,MAAM,EACjB,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,IAAI,GAC/D,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;CAiBvC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { LivePresence, PresenceState, LivePresenceEvents, } from "@microsoft/live-share";
|
|
11
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
12
|
+
export class TurboLivePresence extends TurboDataObject {
|
|
13
|
+
constructor(dataObject) {
|
|
14
|
+
const onDidOverrideDataObject = () => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
if (this._isInitialized) {
|
|
16
|
+
try {
|
|
17
|
+
yield this.dataObject.initialize(this._userId, this._data, this._state);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error(error);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
super(dataObject, Object.keys(LivePresenceEvents), onDidOverrideDataObject);
|
|
25
|
+
this._isInitialized = false;
|
|
26
|
+
}
|
|
27
|
+
get isInitialized() {
|
|
28
|
+
return this._isInitialized;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Number of seconds without a presence update before a remote user is considered offline.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Defaults to a value of `20` seconds. The minimum value is 0.1 seconds for testing purposes.
|
|
35
|
+
*/
|
|
36
|
+
get expirationPeriod() {
|
|
37
|
+
return this.dataObject.expirationPeriod;
|
|
38
|
+
}
|
|
39
|
+
set expirationPeriod(value) {
|
|
40
|
+
this.dataObject.expirationPeriod = value;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Optional data object shared by the user.
|
|
44
|
+
*/
|
|
45
|
+
get data() {
|
|
46
|
+
return this.dataObject.data;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The users current presence state.
|
|
50
|
+
*/
|
|
51
|
+
get state() {
|
|
52
|
+
return this.dataObject.state;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns the ID of the local user.
|
|
56
|
+
*/
|
|
57
|
+
get userId() {
|
|
58
|
+
return this.dataObject.userId;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* initialize the object.
|
|
62
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
63
|
+
*/
|
|
64
|
+
initialize(userId, data, state = PresenceState.online) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
yield this.dataObject.initialize(userId, data, state);
|
|
67
|
+
this._userId = userId;
|
|
68
|
+
this._data = data;
|
|
69
|
+
this._state = state;
|
|
70
|
+
this._isInitialized = true;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns a snapshot of the current list of presence objects being tracked.
|
|
75
|
+
* @returns Array of presence objects.
|
|
76
|
+
*/
|
|
77
|
+
toArray() {
|
|
78
|
+
return this.dataObject.toArray();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Updates the users presence state and/or shared data object.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* This will trigger the immediate broadcast of the users presence to all other clients.
|
|
85
|
+
* @param state Optional. Presence state to change.
|
|
86
|
+
* @param data Optional. Data object to change. A deep copy of the data object is saved to avoid any future changes.
|
|
87
|
+
*/
|
|
88
|
+
updatePresence(state, data) {
|
|
89
|
+
return this.dataObject.updatePresence(state, data);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Enumerates each user the object is tracking presence for.
|
|
93
|
+
* @param callback Function to call for each user.
|
|
94
|
+
* @param callback.user Current presence information for a user.
|
|
95
|
+
* @param filter Optional. Presence state to filter enumeration to.
|
|
96
|
+
*/
|
|
97
|
+
forEach(callback, filter) {
|
|
98
|
+
return this.dataObject.forEach(callback, filter);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Counts the number of users that the object is tracking presence for.
|
|
102
|
+
* @param filter Optional. Presence state to filter count to.
|
|
103
|
+
* @returns Total number of other users we've seen or number of users with a given presence status.
|
|
104
|
+
*/
|
|
105
|
+
getCount(filter) {
|
|
106
|
+
return this.dataObject.getCount(filter);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns the current presence info for a specific client ID.
|
|
110
|
+
* @param clientId The ID of the client to retrieve.
|
|
111
|
+
* @returns The current presence information for the client if they've connected to the space.
|
|
112
|
+
*/
|
|
113
|
+
getPresenceForClient(clientId) {
|
|
114
|
+
return this.dataObject.getPresenceForClient(clientId);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returns the current presence info for a specific user.
|
|
118
|
+
* @param userId The ID of the user to retrieve.
|
|
119
|
+
* @returns The current presence information for the user if they've connected to the space.
|
|
120
|
+
*/
|
|
121
|
+
getPresenceForUser(userId) {
|
|
122
|
+
return this.dataObject.getPresenceForUser(userId);
|
|
123
|
+
}
|
|
124
|
+
static create(turboClient, uniqueKey, onDidFirstInitialize) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const results = yield turboClient.getDDS(`<LivePresence>:${uniqueKey}`, (LivePresence), (dds) => {
|
|
127
|
+
return new TurboLivePresence(dds);
|
|
128
|
+
});
|
|
129
|
+
const dds = results.dds;
|
|
130
|
+
if (results.created) {
|
|
131
|
+
onDidFirstInitialize === null || onDidFirstInitialize === void 0 ? void 0 : onDidFirstInitialize(dds);
|
|
132
|
+
}
|
|
133
|
+
return dds;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=TurboLivePresence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurboLivePresence.js","sourceRoot":"","sources":["../../../src/live-share-turbo/dds-objects/TurboLivePresence.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAEH,YAAY,EAEZ,aAAa,EACb,kBAAkB,GACrB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,OAAO,iBAEX,SAAQ,eAGT;IAMG,YAAY,UAA+B;QACvC,MAAM,uBAAuB,GAAG,GAAS,EAAE;YACvC,IAAI,IAAI,CAAC,cAAc,EAAE;gBACrB,IAAI;oBACA,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAC5B,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,CACd,CAAC;iB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/live-share";
|
|
2
|
+
import { IFluidTurboClient } from "../../live-share-react/bin/live-share-turbo/interfaces";
|
|
3
|
+
import { TurboDataObject } from "./TurboDataObject";
|
|
4
|
+
export declare class TurboLiveState<TData = undefined> extends TurboDataObject<ILiveStateEvents<TData>, LiveState<TData>> {
|
|
5
|
+
private _isInitialized;
|
|
6
|
+
private _allowedRoles?;
|
|
7
|
+
constructor(dataObject: LiveState<TData>);
|
|
8
|
+
get isInitialized(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Optional data object for the current state.
|
|
11
|
+
*/
|
|
12
|
+
get data(): TData | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The current state.
|
|
15
|
+
*/
|
|
16
|
+
get state(): string;
|
|
17
|
+
/**
|
|
18
|
+
* initialize the object.
|
|
19
|
+
* @param allowedRoles Optional. List of roles allowed to send events.
|
|
20
|
+
*/
|
|
21
|
+
initialize(allowedRoles?: UserMeetingRole[], state?: string, data?: TData): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Changes to a new state with an optional data object.
|
|
24
|
+
* @param state New state name.
|
|
25
|
+
* @param data Optional. Data object to associate with the new state.
|
|
26
|
+
*/
|
|
27
|
+
changeState(state: string, data?: TData): void;
|
|
28
|
+
static create<TData = undefined>(turboClient: IFluidTurboClient, uniqueKey: string, onDidFirstInitialize?: (dds: TurboLiveState<TData>) => void): Promise<TurboLiveState<TData>>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=TurboLiveState.d.ts.map
|