@upscopeio/react-native-sdk 2026.4.1 → 2026.4.2
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 +135 -3
- package/android/build.gradle.kts +1 -1
- package/android/src/main/kotlin/io/upscope/reactnative/UpscopeModule.kt +193 -31
- package/ios/UpscopeModule.mm +3 -0
- package/ios/UpscopeModule.swift +195 -43
- package/lib/commonjs/NativeUpscopeModule.js.map +1 -1
- package/lib/commonjs/Upscope.js +55 -18
- package/lib/commonjs/Upscope.js.map +1 -1
- package/lib/commonjs/hooks.js +45 -2
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/NativeUpscopeModule.js.map +1 -1
- package/lib/module/Upscope.js +57 -19
- package/lib/module/Upscope.js.map +1 -1
- package/lib/module/hooks.js +43 -2
- package/lib/module/hooks.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/NativeUpscopeModule.d.ts +3 -0
- package/lib/typescript/NativeUpscopeModule.d.ts.map +1 -1
- package/lib/typescript/Upscope.d.ts +20 -2
- package/lib/typescript/Upscope.d.ts.map +1 -1
- package/lib/typescript/hooks.d.ts +20 -3
- package/lib/typescript/hooks.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +7 -7
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +64 -17
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/NativeUpscopeModule.ts +5 -0
- package/src/Upscope.ts +63 -20
- package/src/hooks.ts +56 -3
- package/src/index.ts +19 -10
- package/src/types.ts +78 -30
- package/src/version.ts +1 -1
- package/upscopeio-react-native-sdk.podspec +1 -1
package/lib/commonjs/index.js
CHANGED
|
@@ -27,12 +27,24 @@ Object.defineProperty(exports, "useConnectionState", {
|
|
|
27
27
|
return _hooks.useConnectionState;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "useFullDeviceSharingState", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _hooks.useFullDeviceSharingState;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "useLookupCode", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function () {
|
|
33
39
|
return _hooks.useLookupCode;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "useRemoteControlState", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _hooks.useRemoteControlState;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
36
48
|
Object.defineProperty(exports, "useSessionState", {
|
|
37
49
|
enumerable: true,
|
|
38
50
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Upscope","_interopRequireDefault","require","_hooks","_UpscopeMasked","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_Upscope","_interopRequireDefault","require","_hooks","_UpscopeMasked","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAUA,IAAAE,cAAA,GAAAF,OAAA;AAAgD,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.SDK_VERSION = void 0;
|
|
7
7
|
// Auto-generated by scripts/generate-version.sh — do not edit manually
|
|
8
|
-
const SDK_VERSION = exports.SDK_VERSION = "2026.4.
|
|
8
|
+
const SDK_VERSION = exports.SDK_VERSION = "2026.4.2";
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeUpscopeModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeUpscopeModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAmClD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
|
package/lib/module/Upscope.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { NativeEventEmitter } from
|
|
4
|
-
import
|
|
5
|
-
import { SDK_VERSION } from "./version";
|
|
3
|
+
import { NativeEventEmitter, TurboModuleRegistry } from 'react-native';
|
|
4
|
+
import { SDK_VERSION } from './version';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Subscription handle returned by addListener. Callers must invoke remove()
|
|
9
8
|
* to avoid memory leaks when the component/scope unmounts.
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the native TurboModule lazily on first use. Resolving at import time
|
|
13
|
+
* runs during the initial JS bundle evaluation — before the bridgeless runtime
|
|
14
|
+
* has finished registering third-party TurboModules — which makes
|
|
15
|
+
* `getEnforcing` throw "UpscopeModule could not be found". Deferring until a
|
|
16
|
+
* method is actually called avoids that startup ordering issue.
|
|
17
|
+
*/
|
|
18
|
+
let nativeModule;
|
|
19
|
+
function native() {
|
|
20
|
+
return nativeModule ??= TurboModuleRegistry.getEnforcing('UpscopeModule');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Lazily-created emitter — one instance for the lifetime of the JS runtime.
|
|
24
|
+
let eventEmitter;
|
|
25
|
+
function emitter() {
|
|
26
|
+
return eventEmitter ??= new NativeEventEmitter(native());
|
|
27
|
+
}
|
|
14
28
|
|
|
15
29
|
/**
|
|
16
30
|
* Imperative JS API over the native Upscope TurboModule.
|
|
@@ -21,44 +35,68 @@ const emitter = new NativeEventEmitter(NativeUpscopeModule);
|
|
|
21
35
|
const Upscope = {
|
|
22
36
|
/** Initialise the SDK. Must be called before any other method. */
|
|
23
37
|
initialize(config) {
|
|
24
|
-
|
|
38
|
+
native().initialize({
|
|
25
39
|
...config,
|
|
26
40
|
wrapperVersion: SDK_VERSION
|
|
27
41
|
});
|
|
28
42
|
},
|
|
29
43
|
/** Open a WebSocket connection to the Upscope service. */
|
|
30
44
|
connect() {
|
|
31
|
-
|
|
45
|
+
native().connect();
|
|
32
46
|
},
|
|
33
47
|
/** Close the WebSocket connection. */
|
|
34
48
|
disconnect() {
|
|
35
|
-
|
|
49
|
+
native().disconnect();
|
|
36
50
|
},
|
|
37
51
|
/**
|
|
38
52
|
* Reset the connection state.
|
|
39
53
|
* @param reconnect - Whether to reconnect immediately after reset. Defaults to true.
|
|
40
54
|
*/
|
|
41
55
|
reset(reconnect = true) {
|
|
42
|
-
|
|
56
|
+
native().reset(reconnect);
|
|
43
57
|
},
|
|
44
58
|
/**
|
|
45
59
|
* Update user identity and metadata sent to the Upscope service.
|
|
46
60
|
* Safe to call at any time; changes are pushed on the next sync.
|
|
47
61
|
*/
|
|
48
62
|
updateConnection(params) {
|
|
49
|
-
|
|
63
|
+
native().updateConnection(params);
|
|
50
64
|
},
|
|
51
65
|
/** Terminate the active co-browsing session. */
|
|
52
66
|
stopSession() {
|
|
53
|
-
|
|
67
|
+
native().stopSession();
|
|
54
68
|
},
|
|
55
69
|
/** Request that an agent join the current session. */
|
|
56
70
|
requestAgent() {
|
|
57
|
-
|
|
71
|
+
native().requestAgent();
|
|
58
72
|
},
|
|
59
73
|
/** Cancel a pending agent-join request. */
|
|
60
74
|
cancelAgentRequest() {
|
|
61
|
-
|
|
75
|
+
native().cancelAgentRequest();
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* Revoke the agent's active remote control while keeping the session alive.
|
|
79
|
+
* No-op if remote control is not currently active.
|
|
80
|
+
*/
|
|
81
|
+
stopRemoteControl() {
|
|
82
|
+
native().stopRemoteControl();
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* End full-device (broadcast) sharing and revert to in-app sharing, keeping
|
|
86
|
+
* the session alive. No-op if full-device sharing is not currently active.
|
|
87
|
+
*/
|
|
88
|
+
stopFullDeviceSharing() {
|
|
89
|
+
native().stopFullDeviceSharing();
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Answer a pending full-device sharing request delivered via the
|
|
93
|
+
* `fullDeviceRequest` event.
|
|
94
|
+
*
|
|
95
|
+
* @param requestId - The id from the `fullDeviceRequest` event payload.
|
|
96
|
+
* @param accept - `true` to allow full-device capture, `false` to reject.
|
|
97
|
+
*/
|
|
98
|
+
respondToFullDeviceRequest(requestId, accept) {
|
|
99
|
+
native().respondToFullDeviceRequest(requestId, accept);
|
|
62
100
|
},
|
|
63
101
|
/**
|
|
64
102
|
* Ask the native layer to emit the current lookup code via the
|
|
@@ -66,19 +104,19 @@ const Upscope = {
|
|
|
66
104
|
* asynchronously through the event system.
|
|
67
105
|
*/
|
|
68
106
|
getLookupCode() {
|
|
69
|
-
|
|
107
|
+
native().getLookupCode();
|
|
70
108
|
},
|
|
71
109
|
/** Resolve the current short ID, or null if not yet assigned. */
|
|
72
110
|
getShortId() {
|
|
73
|
-
return
|
|
111
|
+
return native().getShortId();
|
|
74
112
|
},
|
|
75
113
|
/** Resolve the watch link for the current session, or null if unavailable. */
|
|
76
114
|
getWatchLink() {
|
|
77
|
-
return
|
|
115
|
+
return native().getWatchLink();
|
|
78
116
|
},
|
|
79
|
-
/** Send an arbitrary string message to all connected
|
|
117
|
+
/** Send an arbitrary string message to all connected viewers. */
|
|
80
118
|
sendCustomMessage(message) {
|
|
81
|
-
|
|
119
|
+
native().sendCustomMessage(message);
|
|
82
120
|
},
|
|
83
121
|
/**
|
|
84
122
|
* Subscribe to a typed Upscope event.
|
|
@@ -88,7 +126,7 @@ const Upscope = {
|
|
|
88
126
|
* @returns A subscription handle. Call `.remove()` to unsubscribe.
|
|
89
127
|
*/
|
|
90
128
|
addListener(eventName, callback) {
|
|
91
|
-
return emitter.addListener(eventName, callback);
|
|
129
|
+
return emitter().addListener(eventName, callback);
|
|
92
130
|
}
|
|
93
131
|
};
|
|
94
132
|
export default Upscope;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","TurboModuleRegistry","SDK_VERSION","nativeModule","native","getEnforcing","eventEmitter","emitter","Upscope","initialize","config","wrapperVersion","connect","disconnect","reset","reconnect","updateConnection","params","stopSession","requestAgent","cancelAgentRequest","stopRemoteControl","stopFullDeviceSharing","respondToFullDeviceRequest","requestId","accept","getLookupCode","getShortId","getWatchLink","sendCustomMessage","message","addListener","eventName","callback"],"sourceRoot":"../../src","sources":["Upscope.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,mBAAmB,QAAQ,cAAc;AAEtE,SAASC,WAAW,QAAQ,WAAW;;AAQvC;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,YAA8B;AAClC,SAASC,MAAMA,CAAA,EAAS;EACtB,OAAQD,YAAY,KAClBF,mBAAmB,CAACI,YAAY,CAAO,eAAe,CAAC;AAC3D;;AAEA;AACA,IAAIC,YAA4C;AAChD,SAASC,OAAOA,CAAA,EAAuB;EACrC,OAAQD,YAAY,KAAK,IAAIN,kBAAkB,CAACI,MA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A0BA,CAACC,SAAiB,EAAEC,MAAe,EAAQ;IACnErB,MAAM,CAAC,CAAC,CAACmB,0BAA0B,CAACC,SAAS,EAAEC,MAAM,CAAC;EACxD,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,aAAaA,CAAA,EAAS;IACpBtB,MAAM,CAAC,CAAC,CAACsB,aAAa,CAAC,CAAC;EAC1B,CAAC;EAED;EACAC,UAAUA,CAAA,EAA2B;IACnC,OAAOvB,MAAM,CAAC,CAAC,CAACuB,UAAU,CAAC,CAAC;EAC9B,CAAC;EAED;EACAC,YAAYA,CAAA,EAA2B;IACrC,OAAOxB,MAAM,CAAC,CAAC,CAACwB,YAAY,CAAC,CAAC;EAChC,CAAC;EAED;EACAC,iBAAiBA,CAACC,OAAe,EAAQ;IACvC1B,MAAM,CAAC,CAAC,CAACyB,iBAAiB,CAACC,OAAO,CAAC;EACrC,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,WAAWA,CACTC,SAAY,EACZC,QAA6C,EAC1B;IACnB,OAAO1B,OAAO,CAAC,CAAC,CAACwB,WAAW,CAACC,SAAS,EAAEC,QAAQ,CAAC;EACnD;AACF,CAAU;AAEV,eAAezB,OAAO","ignoreList":[]}
|
package/lib/module/hooks.js
CHANGED
|
@@ -18,12 +18,19 @@ export function useConnectionState() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Returns the current co-browsing session state.
|
|
22
|
-
*
|
|
21
|
+
* Returns the current co-browsing session state.
|
|
22
|
+
*
|
|
23
|
+
* Seeds and stays in sync via the `sessionStateChanged` event, which the
|
|
24
|
+
* native layer drives from a current-value publisher — so a fresh subscription
|
|
25
|
+
* immediately receives the real state, even across remounts. The
|
|
26
|
+
* `sessionStarted`/`sessionEnded` events provide redundant fast-path updates.
|
|
23
27
|
*/
|
|
24
28
|
export function useSessionState() {
|
|
25
29
|
const [state, setState] = useState("inactive");
|
|
26
30
|
useEffect(() => {
|
|
31
|
+
const subState = Upscope.addListener("sessionStateChanged", event => {
|
|
32
|
+
setState(event.state);
|
|
33
|
+
});
|
|
27
34
|
const subStart = Upscope.addListener("sessionStarted", () => {
|
|
28
35
|
setState("active");
|
|
29
36
|
});
|
|
@@ -31,6 +38,7 @@ export function useSessionState() {
|
|
|
31
38
|
setState("inactive");
|
|
32
39
|
});
|
|
33
40
|
return () => {
|
|
41
|
+
subState.remove();
|
|
34
42
|
subStart.remove();
|
|
35
43
|
subEnd.remove();
|
|
36
44
|
};
|
|
@@ -70,6 +78,36 @@ export function useLookupCode() {
|
|
|
70
78
|
return code;
|
|
71
79
|
}
|
|
72
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Returns whether an agent currently has remote control of the device.
|
|
83
|
+
* Defaults to "inactive" and stays in sync via `remoteControlStateChanged`.
|
|
84
|
+
*/
|
|
85
|
+
export function useRemoteControlState() {
|
|
86
|
+
const [state, setState] = useState("inactive");
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const sub = Upscope.addListener("remoteControlStateChanged", event => {
|
|
89
|
+
setState(event.state);
|
|
90
|
+
});
|
|
91
|
+
return () => sub.remove();
|
|
92
|
+
}, []);
|
|
93
|
+
return state;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns whether full-device (broadcast) screen sharing is currently running.
|
|
98
|
+
* Defaults to "inactive" and stays in sync via `fullDeviceSharingStateChanged`.
|
|
99
|
+
*/
|
|
100
|
+
export function useFullDeviceSharingState() {
|
|
101
|
+
const [state, setState] = useState("inactive");
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const sub = Upscope.addListener("fullDeviceSharingStateChanged", event => {
|
|
104
|
+
setState(event.state);
|
|
105
|
+
});
|
|
106
|
+
return () => sub.remove();
|
|
107
|
+
}, []);
|
|
108
|
+
return state;
|
|
109
|
+
}
|
|
110
|
+
|
|
73
111
|
/**
|
|
74
112
|
* Returns a stable object of imperative Upscope action methods.
|
|
75
113
|
* Safe to use as a dependency in `useCallback` / `useEffect`.
|
|
@@ -81,6 +119,9 @@ export function useUpscope() {
|
|
|
81
119
|
stopSession: Upscope.stopSession,
|
|
82
120
|
requestAgent: Upscope.requestAgent,
|
|
83
121
|
cancelAgentRequest: Upscope.cancelAgentRequest,
|
|
122
|
+
stopRemoteControl: Upscope.stopRemoteControl,
|
|
123
|
+
stopFullDeviceSharing: Upscope.stopFullDeviceSharing,
|
|
124
|
+
respondToFullDeviceRequest: Upscope.respondToFullDeviceRequest,
|
|
84
125
|
sendCustomMessage: Upscope.sendCustomMessage,
|
|
85
126
|
getLookupCode: Upscope.getLookupCode,
|
|
86
127
|
reset: Upscope.reset
|
package/lib/module/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useEffect","useMemo","Upscope","useConnectionState","state","setState","sub","addListener","event","remove","useSessionState","subStart","subEnd","useShortId","shortId","setShortId","getShortId","then","useLookupCode","code","setCode","lookupCode","useUpscope","connect","disconnect","stopSession","requestAgent","cancelAgentRequest","sendCustomMessage","getLookupCode","reset"],"sourceRoot":"../../src","sources":["hooks.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACpD,OAAOC,OAAO,MAAM,WAAW;
|
|
1
|
+
{"version":3,"names":["useState","useEffect","useMemo","Upscope","useConnectionState","state","setState","sub","addListener","event","remove","useSessionState","subState","subStart","subEnd","useShortId","shortId","setShortId","getShortId","then","useLookupCode","code","setCode","lookupCode","useRemoteControlState","useFullDeviceSharingState","useUpscope","connect","disconnect","stopSession","requestAgent","cancelAgentRequest","stopRemoteControl","stopFullDeviceSharing","respondToFullDeviceRequest","sendCustomMessage","getLookupCode","reset"],"sourceRoot":"../../src","sources":["hooks.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACpD,OAAOC,OAAO,MAAM,WAAW;AAQ/B;AACA;AACA;AACA;AACA,OAAO,SAASC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A;AACA,OAAO,SAASoB,yBAAyBA,CAAA,EAA2B;EAClE,MAAM,CAACpB,KAAK,EAAEC,QAAQ,CAAC,GAAGN,QAAQ,CAAyB,UAAU,CAAC;EAEtEC,SAAS,CAAC,MAAM;IACd,MAAMM,GAAG,GAAGJ,OAAO,CAACK,WAAW,CAC7B,+BAA+B,EAC9BC,KAAK,IAAK;MACTH,QAAQ,CAACG,KAAK,CAACJ,KAAK,CAAC;IACvB,CACF,CAAC;IACD,OAAO,MAAME,GAAG,CAACG,MAAM,CAAC,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASqB,UAAUA,CAAA,EAAG;EAC3B,OAAOxB,OAAO,CACZ,OAAO;IACLyB,OAAO,EAAExB,OAAO,CAACwB,OAAO;IACxBC,UAAU,EAAEzB,OAAO,CAACyB,UAAU;IAC9BC,WAAW,EAAE1B,OAAO,CAAC0B,WAAW;IAChCC,YAAY,EAAE3B,OAAO,CAAC2B,YAAY;IAClCC,kBAAkB,EAAE5B,OAAO,CAAC4B,kBAAkB;IAC9CC,iBAAiB,EAAE7B,OAAO,CAAC6B,iBAAiB;IAC5CC,qBAAqB,EAAE9B,OAAO,CAAC8B,qBAAqB;IACpDC,0BAA0B,EAAE/B,OAAO,CAAC+B,0BAA0B;IAC9DC,iBAAiB,EAAEhC,OAAO,CAACgC,iBAAiB;IAC5CC,aAAa,EAAEjC,OAAO,CAACiC,aAAa;IACpCC,KAAK,EAAElC,OAAO,CAACkC;EACjB,CAAC,CAAC,EACF,EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export { default } from
|
|
4
|
-
export { default as Upscope } from
|
|
5
|
-
export { useConnectionState, useSessionState, useShortId, useLookupCode, useUpscope } from
|
|
6
|
-
export { UpscopeMasked } from
|
|
3
|
+
export { default } from './Upscope';
|
|
4
|
+
export { default as Upscope } from './Upscope';
|
|
5
|
+
export { useConnectionState, useSessionState, useShortId, useLookupCode, useRemoteControlState, useFullDeviceSharingState, useUpscope } from './hooks';
|
|
6
|
+
export { UpscopeMasked } from './UpscopeMasked';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Upscope","useConnectionState","useSessionState","useShortId","useLookupCode","useUpscope","UpscopeMasked"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,OAAkB,QAAQ,WAAW;AAC9C,SAASA,OAAO,IAAIC,OAAO,QAAQ,WAAW;AAG9C,SACEC,kBAAkB,EAClBC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,UAAU,QACL,SAAS;AAEhB,SAASC,aAAa,QAAQ,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","Upscope","useConnectionState","useSessionState","useShortId","useLookupCode","useRemoteControlState","useFullDeviceSharingState","useUpscope","UpscopeMasked"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,OAAkB,QAAQ,WAAW;AAC9C,SAASA,OAAO,IAAIC,OAAO,QAAQ,WAAW;AAG9C,SACEC,kBAAkB,EAClBC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,qBAAqB,EACrBC,yBAAyB,EACzBC,UAAU,QACL,SAAS;AAEhB,SAASC,aAAa,QAAQ,iBAAiB","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -8,6 +8,9 @@ export interface Spec extends TurboModule {
|
|
|
8
8
|
stopSession(): void;
|
|
9
9
|
requestAgent(): void;
|
|
10
10
|
cancelAgentRequest(): void;
|
|
11
|
+
stopRemoteControl(): void;
|
|
12
|
+
stopFullDeviceSharing(): void;
|
|
13
|
+
respondToFullDeviceRequest(requestId: string, accept: boolean): void;
|
|
11
14
|
getLookupCode(): void;
|
|
12
15
|
getShortId(): Promise<string | null>;
|
|
13
16
|
getWatchLink(): Promise<string | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeUpscopeModule.d.ts","sourceRoot":"","sources":["../../src/NativeUpscopeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IAEvC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,OAAO,IAAI,IAAI,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;IACnB,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvC,WAAW,IAAI,IAAI,CAAC;IACpB,YAAY,IAAI,IAAI,CAAC;IACrB,kBAAkB,IAAI,IAAI,CAAC;IAG3B,aAAa,IAAI,IAAI,CAAC;IACtB,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrC,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAGvC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAAuE"}
|
|
1
|
+
{"version":3,"file":"NativeUpscopeModule.d.ts","sourceRoot":"","sources":["../../src/NativeUpscopeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IAEvC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGjC,OAAO,IAAI,IAAI,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;IACnB,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvC,WAAW,IAAI,IAAI,CAAC;IACpB,YAAY,IAAI,IAAI,CAAC;IACrB,kBAAkB,IAAI,IAAI,CAAC;IAG3B,iBAAiB,IAAI,IAAI,CAAC;IAC1B,qBAAqB,IAAI,IAAI,CAAC;IAC9B,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAGrE,aAAa,IAAI,IAAI,CAAC;IACtB,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrC,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAGvC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAAuE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UpscopeConfig, ConnectionUpdateParams, UpscopeEventMap, UpscopeEventName } from
|
|
1
|
+
import type { UpscopeConfig, ConnectionUpdateParams, UpscopeEventMap, UpscopeEventName } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Subscription handle returned by addListener. Callers must invoke remove()
|
|
4
4
|
* to avoid memory leaks when the component/scope unmounts.
|
|
@@ -35,6 +35,24 @@ declare const Upscope: {
|
|
|
35
35
|
readonly requestAgent: () => void;
|
|
36
36
|
/** Cancel a pending agent-join request. */
|
|
37
37
|
readonly cancelAgentRequest: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Revoke the agent's active remote control while keeping the session alive.
|
|
40
|
+
* No-op if remote control is not currently active.
|
|
41
|
+
*/
|
|
42
|
+
readonly stopRemoteControl: () => void;
|
|
43
|
+
/**
|
|
44
|
+
* End full-device (broadcast) sharing and revert to in-app sharing, keeping
|
|
45
|
+
* the session alive. No-op if full-device sharing is not currently active.
|
|
46
|
+
*/
|
|
47
|
+
readonly stopFullDeviceSharing: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Answer a pending full-device sharing request delivered via the
|
|
50
|
+
* `fullDeviceRequest` event.
|
|
51
|
+
*
|
|
52
|
+
* @param requestId - The id from the `fullDeviceRequest` event payload.
|
|
53
|
+
* @param accept - `true` to allow full-device capture, `false` to reject.
|
|
54
|
+
*/
|
|
55
|
+
readonly respondToFullDeviceRequest: (requestId: string, accept: boolean) => void;
|
|
38
56
|
/**
|
|
39
57
|
* Ask the native layer to emit the current lookup code via the
|
|
40
58
|
* `lookupCodeChanged` event. The lookup code itself is delivered
|
|
@@ -45,7 +63,7 @@ declare const Upscope: {
|
|
|
45
63
|
readonly getShortId: () => Promise<string | null>;
|
|
46
64
|
/** Resolve the watch link for the current session, or null if unavailable. */
|
|
47
65
|
readonly getWatchLink: () => Promise<string | null>;
|
|
48
|
-
/** Send an arbitrary string message to all connected
|
|
66
|
+
/** Send an arbitrary string message to all connected viewers. */
|
|
49
67
|
readonly sendCustomMessage: (message: string) => void;
|
|
50
68
|
/**
|
|
51
69
|
* Subscribe to a typed Upscope event.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Upscope.d.ts","sourceRoot":"","sources":["../../src/Upscope.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"Upscope.d.ts","sourceRoot":"","sources":["../../src/Upscope.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;AAqBD;;;;;GAKG;AACH,QAAA,MAAM,OAAO;IACX,kEAAkE;kCAC/C,aAAa,KAAG,IAAI;IAOvC,0DAA0D;4BAC/C,IAAI;IAIf,sCAAsC;+BACxB,IAAI;IAIlB;;;OAGG;iCACc,OAAO,KAAU,IAAI;IAItC;;;OAGG;wCACsB,sBAAsB,KAAG,IAAI;IAItD,gDAAgD;gCACjC,IAAI;IAInB,sDAAsD;iCACtC,IAAI;IAIpB,2CAA2C;uCACrB,IAAI;IAI1B;;;OAGG;sCACkB,IAAI;IAIzB;;;OAGG;0CACsB,IAAI;IAI7B;;;;;;OAMG;qDACmC,MAAM,UAAU,OAAO,KAAG,IAAI;IAIpE;;;;OAIG;kCACc,IAAI;IAIrB,iEAAiE;+BACnD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIpC,8EAA8E;iCAC9D,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAItC,iEAAiE;0CACtC,MAAM,KAAG,IAAI;IAIxC;;;;;;OAMG;2BACS,CAAC,SAAS,gBAAgB,aACzB,CAAC,YACF,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,KAC5C,iBAAiB;CAGZ,CAAC;AAEX,eAAe,OAAO,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import type { ConnectionState, SessionState } from "./types";
|
|
1
|
+
import type { ConnectionState, SessionState, RemoteControlState, FullDeviceSharingState } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Returns the current WebSocket connection state, updated reactively via the
|
|
4
4
|
* `connectionStateChanged` event. Starts as "inactive" before the first event.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useConnectionState(): ConnectionState;
|
|
7
7
|
/**
|
|
8
|
-
* Returns the current co-browsing session state.
|
|
9
|
-
*
|
|
8
|
+
* Returns the current co-browsing session state.
|
|
9
|
+
*
|
|
10
|
+
* Seeds and stays in sync via the `sessionStateChanged` event, which the
|
|
11
|
+
* native layer drives from a current-value publisher — so a fresh subscription
|
|
12
|
+
* immediately receives the real state, even across remounts. The
|
|
13
|
+
* `sessionStarted`/`sessionEnded` events provide redundant fast-path updates.
|
|
10
14
|
*/
|
|
11
15
|
export declare function useSessionState(): SessionState;
|
|
12
16
|
/**
|
|
@@ -19,6 +23,16 @@ export declare function useShortId(): string | null;
|
|
|
19
23
|
* Updated reactively via `lookupCodeChanged`.
|
|
20
24
|
*/
|
|
21
25
|
export declare function useLookupCode(): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Returns whether an agent currently has remote control of the device.
|
|
28
|
+
* Defaults to "inactive" and stays in sync via `remoteControlStateChanged`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useRemoteControlState(): RemoteControlState;
|
|
31
|
+
/**
|
|
32
|
+
* Returns whether full-device (broadcast) screen sharing is currently running.
|
|
33
|
+
* Defaults to "inactive" and stays in sync via `fullDeviceSharingStateChanged`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useFullDeviceSharingState(): FullDeviceSharingState;
|
|
22
36
|
/**
|
|
23
37
|
* Returns a stable object of imperative Upscope action methods.
|
|
24
38
|
* Safe to use as a dependency in `useCallback` / `useEffect`.
|
|
@@ -29,6 +43,9 @@ export declare function useUpscope(): {
|
|
|
29
43
|
stopSession: () => void;
|
|
30
44
|
requestAgent: () => void;
|
|
31
45
|
cancelAgentRequest: () => void;
|
|
46
|
+
stopRemoteControl: () => void;
|
|
47
|
+
stopFullDeviceSharing: () => void;
|
|
48
|
+
respondToFullDeviceRequest: (requestId: string, accept: boolean) => void;
|
|
32
49
|
sendCustomMessage: (message: string) => void;
|
|
33
50
|
getLookupCode: () => void;
|
|
34
51
|
reset: (reconnect?: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAWpD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAqB9C;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAa1C;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAW7C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAW1D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,sBAAsB,CAclE;AAED;;;GAGG;AACH,wBAAgB,UAAU;;;;;;;;;;;;EAiBzB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { default as default } from
|
|
2
|
-
export { default as Upscope } from
|
|
3
|
-
export type { EventSubscription } from
|
|
4
|
-
export { useConnectionState, useSessionState, useShortId, useLookupCode, useUpscope, } from
|
|
5
|
-
export { UpscopeMasked } from
|
|
6
|
-
export type { UpscopeMaskedProps } from
|
|
7
|
-
export type { ConnectionState, SessionState, SessionEndReason, UpscopeError, UpscopeConfig, ConnectionUpdateParams,
|
|
1
|
+
export { default as default } from './Upscope';
|
|
2
|
+
export { default as Upscope } from './Upscope';
|
|
3
|
+
export type { EventSubscription } from './Upscope';
|
|
4
|
+
export { useConnectionState, useSessionState, useShortId, useLookupCode, useRemoteControlState, useFullDeviceSharingState, useUpscope, } from './hooks';
|
|
5
|
+
export { UpscopeMasked } from './UpscopeMasked';
|
|
6
|
+
export type { UpscopeMaskedProps } from './UpscopeMasked';
|
|
7
|
+
export type { ConnectionState, SessionState, SessionEndReason, RemoteControlState, FullDeviceSharingState, UpscopeError, UpscopeConfig, LocalizedString, ConnectionUpdateParams, Viewer, UpscopeEventMap, UpscopeEventName, ConnectionStateChangedEvent, SessionStartedEvent, SessionEndedEvent, CustomMessageEvent, ViewerCountChangedEvent, ViewerLeftEvent, ShortIdChangedEvent, LookupCodeChangedEvent, SessionStateChangedEvent, RemoteControlStateChangedEvent, FullDeviceSharingStateChangedEvent, FullDeviceRequestEvent, } from './types';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,YAAY,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,yBAAyB,EACzB,UAAU,GACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,YAAY,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
|
|
@@ -1,32 +1,63 @@
|
|
|
1
|
-
export type ConnectionState =
|
|
2
|
-
export type SessionState =
|
|
3
|
-
export type SessionEndReason =
|
|
1
|
+
export type ConnectionState = 'inactive' | 'connecting' | 'connected' | 'reconnecting' | 'error';
|
|
2
|
+
export type SessionState = 'inactive' | 'pendingRequest' | 'active' | 'paused' | 'ended';
|
|
3
|
+
export type SessionEndReason = 'userStopped' | 'agentStopped' | 'timeout';
|
|
4
|
+
/** Whether an agent currently has remote control of the device. */
|
|
5
|
+
export type RemoteControlState = 'inactive' | 'active';
|
|
6
|
+
/** Whether full-device (broadcast) screen sharing is currently running. */
|
|
7
|
+
export type FullDeviceSharingState = 'inactive' | 'active';
|
|
4
8
|
export interface UpscopeError {
|
|
5
9
|
readonly code: string;
|
|
6
10
|
readonly message: string;
|
|
7
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* A translated configuration value. Either a single string (same text for every
|
|
14
|
+
* user) or a language-keyed map whose keys are BCP-47 language tags such as
|
|
15
|
+
* `"en"`, `"it"`, or `"pt-PT"`. When a map is provided, the native SDK picks
|
|
16
|
+
* the best match against the device's preferred languages.
|
|
17
|
+
*/
|
|
18
|
+
export type LocalizedString = string | {
|
|
19
|
+
readonly [language: string]: string;
|
|
20
|
+
};
|
|
8
21
|
export interface UpscopeConfig {
|
|
9
22
|
readonly apiKey: string;
|
|
10
23
|
readonly requireAuthorizationForSession?: boolean;
|
|
11
24
|
readonly autoConnect?: boolean;
|
|
12
25
|
readonly region?: string;
|
|
13
|
-
|
|
26
|
+
/** Base domain for SDK endpoints (default `"upscope.io"`). Set for staging/on-prem, e.g. `"upscope.xyz"`. */
|
|
27
|
+
readonly baseDomain?: string;
|
|
14
28
|
readonly showTerminateButton?: boolean;
|
|
15
29
|
readonly authorizationPromptTitle?: string;
|
|
16
30
|
readonly authorizationPromptMessage?: string;
|
|
17
31
|
readonly endOfSessionMessage?: string;
|
|
18
|
-
readonly stopSessionText?:
|
|
32
|
+
readonly stopSessionText?: LocalizedString;
|
|
19
33
|
readonly allowRemoteClick?: boolean;
|
|
20
34
|
readonly allowRemoteScroll?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* When `true`, full-device sharing is declined while masked content is on
|
|
37
|
+
* screen (MediaProjection/ReplayKit capture the raw screen and can't apply
|
|
38
|
+
* view masking). Defaults to the server config. Set `false` to allow
|
|
39
|
+
* full-device sharing even with masked content present.
|
|
40
|
+
*/
|
|
41
|
+
readonly disableFullScreenWhenMasked?: boolean;
|
|
21
42
|
readonly requireControlRequest?: boolean;
|
|
22
43
|
readonly controlRequestTitle?: string;
|
|
23
44
|
readonly controlRequestMessage?: string;
|
|
24
45
|
readonly enableLookupCodeOnShake?: boolean;
|
|
25
46
|
readonly lookupCodeKeyTitle?: string;
|
|
26
47
|
readonly lookupCodeKeyMessage?: string;
|
|
27
|
-
readonly translationsYes?:
|
|
28
|
-
readonly translationsNo?:
|
|
29
|
-
readonly translationsOk?:
|
|
48
|
+
readonly translationsYes?: LocalizedString;
|
|
49
|
+
readonly translationsNo?: LocalizedString;
|
|
50
|
+
readonly translationsOk?: LocalizedString;
|
|
51
|
+
/**
|
|
52
|
+
* iOS only. App Group identifier shared between the host app and its
|
|
53
|
+
* Broadcast Upload Extension, required to enable full-device sharing.
|
|
54
|
+
*/
|
|
55
|
+
readonly broadcastAppGroupId?: string;
|
|
56
|
+
/**
|
|
57
|
+
* iOS only. Bundle identifier of the Broadcast Upload Extension target.
|
|
58
|
+
* Used to pre-select the extension in the broadcast picker.
|
|
59
|
+
*/
|
|
60
|
+
readonly broadcastExtensionBundleId?: string;
|
|
30
61
|
}
|
|
31
62
|
export interface ConnectionUpdateParams {
|
|
32
63
|
readonly uniqueId?: string;
|
|
@@ -36,11 +67,12 @@ export interface ConnectionUpdateParams {
|
|
|
36
67
|
readonly integrationIds?: readonly string[];
|
|
37
68
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
38
69
|
}
|
|
39
|
-
export interface
|
|
70
|
+
export interface Viewer {
|
|
40
71
|
readonly id: string;
|
|
41
72
|
readonly name: string | null;
|
|
42
73
|
readonly screenWidth: number;
|
|
43
74
|
readonly screenHeight: number;
|
|
75
|
+
readonly screenScale: number;
|
|
44
76
|
readonly windowWidth: number;
|
|
45
77
|
readonly windowHeight: number;
|
|
46
78
|
readonly hasFocus: boolean;
|
|
@@ -54,17 +86,16 @@ export interface SessionStartedEvent {
|
|
|
54
86
|
}
|
|
55
87
|
export interface SessionEndedEvent {
|
|
56
88
|
readonly reason: SessionEndReason;
|
|
57
|
-
readonly error?: UpscopeError;
|
|
58
89
|
}
|
|
59
90
|
export interface CustomMessageEvent {
|
|
60
91
|
readonly message: string;
|
|
61
|
-
readonly
|
|
92
|
+
readonly viewerId: string;
|
|
62
93
|
}
|
|
63
|
-
export interface
|
|
94
|
+
export interface ViewerCountChangedEvent {
|
|
64
95
|
readonly count: number;
|
|
65
96
|
}
|
|
66
|
-
export interface
|
|
67
|
-
readonly
|
|
97
|
+
export interface ViewerLeftEvent {
|
|
98
|
+
readonly viewerId: string;
|
|
68
99
|
}
|
|
69
100
|
export interface ShortIdChangedEvent {
|
|
70
101
|
readonly shortId: string | null;
|
|
@@ -72,17 +103,33 @@ export interface ShortIdChangedEvent {
|
|
|
72
103
|
export interface LookupCodeChangedEvent {
|
|
73
104
|
readonly lookupCode: string | null;
|
|
74
105
|
}
|
|
106
|
+
export interface SessionStateChangedEvent {
|
|
107
|
+
readonly state: SessionState;
|
|
108
|
+
}
|
|
109
|
+
export interface RemoteControlStateChangedEvent {
|
|
110
|
+
readonly state: RemoteControlState;
|
|
111
|
+
}
|
|
112
|
+
export interface FullDeviceSharingStateChangedEvent {
|
|
113
|
+
readonly state: FullDeviceSharingState;
|
|
114
|
+
}
|
|
115
|
+
export interface FullDeviceRequestEvent {
|
|
116
|
+
readonly requestId: string;
|
|
117
|
+
}
|
|
75
118
|
export type UpscopeEventMap = {
|
|
76
119
|
readonly connectionStateChanged: ConnectionStateChangedEvent;
|
|
120
|
+
readonly sessionStateChanged: SessionStateChangedEvent;
|
|
77
121
|
readonly sessionStarted: SessionStartedEvent;
|
|
78
122
|
readonly sessionEnded: SessionEndedEvent;
|
|
79
123
|
readonly customMessageReceived: CustomMessageEvent;
|
|
80
124
|
readonly error: UpscopeError;
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
125
|
+
readonly viewerJoined: Viewer;
|
|
126
|
+
readonly viewerLeft: ViewerLeftEvent;
|
|
127
|
+
readonly viewerCountChanged: ViewerCountChangedEvent;
|
|
84
128
|
readonly shortIdChanged: ShortIdChangedEvent;
|
|
85
129
|
readonly lookupCodeChanged: LookupCodeChangedEvent;
|
|
130
|
+
readonly remoteControlStateChanged: RemoteControlStateChangedEvent;
|
|
131
|
+
readonly fullDeviceSharingStateChanged: FullDeviceSharingStateChangedEvent;
|
|
132
|
+
readonly fullDeviceRequest: FullDeviceRequestEvent;
|
|
86
133
|
};
|
|
87
134
|
export type UpscopeEventName = keyof UpscopeEventMap;
|
|
88
135
|
//# sourceMappingURL=types.d.ts.map
|