@upscopeio/react 2024.10.18 → 2024.11.1
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/index.d.ts +2 -2
- package/package.json +1 -1
- package/sdk.d.ts +16 -4
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CobrowsingSdkConfiguration,
|
|
1
|
+
import { CobrowsingSdkConfiguration, Upscope } from "./sdk";
|
|
2
2
|
|
|
3
3
|
type UpscopeProviderProps = {
|
|
4
4
|
enabled?: boolean;
|
|
@@ -10,7 +10,7 @@ type UpscopeContext = {
|
|
|
10
10
|
Upscope: Upscope | undefined;
|
|
11
11
|
shortId: string | undefined;
|
|
12
12
|
getLookupCode: () => Promise<string | undefined>;
|
|
13
|
-
listen:
|
|
13
|
+
listen: (event: keyof SDKEvents, callback: (data: any) => void) => void;
|
|
14
14
|
reset: () => void;
|
|
15
15
|
isSharing: boolean;
|
|
16
16
|
};
|
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ type CobrowsingSdkConfiguration = {
|
|
|
42
42
|
allowRemoteScroll: boolean;
|
|
43
43
|
allowRemoteType: boolean;
|
|
44
44
|
allowAgentRedirect: boolean;
|
|
45
|
+
allowFullScreen: boolean;
|
|
45
46
|
requireControlRequest: boolean;
|
|
46
47
|
rewriteExternalLinks: boolean;
|
|
47
48
|
collectHistory: boolean;
|
|
@@ -62,10 +63,13 @@ type CobrowsingSdkConfiguration = {
|
|
|
62
63
|
domChangesDelay: number;
|
|
63
64
|
ignoreBrowserSupport: boolean;
|
|
64
65
|
enableCanvases: boolean;
|
|
65
|
-
customCallController: null | ((callback: (accepted: boolean) => void) => void);
|
|
66
|
-
customControlRequestController: null | ((callback: (accepted: boolean) => void) => void);
|
|
66
|
+
customCallController: null | ((callback: (accepted: boolean) => void) => void | (() => void));
|
|
67
|
+
customControlRequestController: null | ((callback: (accepted: boolean) => void) => void | (() => void));
|
|
68
|
+
customFullScreenRequestController: null | ((callback: (accepted: boolean) => void) => void | (() => void));
|
|
67
69
|
controlRequestTitle: string;
|
|
68
70
|
controlRequestMessage: string;
|
|
71
|
+
fullScreenRequestTitle: string;
|
|
72
|
+
fullScreenRequestMessage: string;
|
|
69
73
|
callPromptText: string;
|
|
70
74
|
callRingtone: string;
|
|
71
75
|
authorizationPromptTitle: string;
|
|
@@ -100,7 +104,7 @@ type CobrowsingSdkConfiguration = {
|
|
|
100
104
|
sfdcFieldLabel: string;
|
|
101
105
|
sfdcFieldId: string;
|
|
102
106
|
needsProxy: (url: string) => boolean;
|
|
103
|
-
onSessionRequest: (cb: (accepted: boolean) => void, requestingAgent: string | null) => void;
|
|
107
|
+
onSessionRequest: (cb: (accepted: boolean) => void, requestingAgent: string | null) => void | (() => void);
|
|
104
108
|
onSessionStart: () => void;
|
|
105
109
|
onSessionEnd: () => void;
|
|
106
110
|
onWaitingForCall: () => void;
|
|
@@ -119,8 +123,9 @@ type SDKEvents = {
|
|
|
119
123
|
callStart: undefined;
|
|
120
124
|
callAccepted: undefined;
|
|
121
125
|
agentRequestUpdate: ["pending" | "unavailable" | "canceled" | "accepted"];
|
|
122
|
-
newObserver: [string];
|
|
126
|
+
newObserver: [string, Observer];
|
|
123
127
|
observerGone: [string];
|
|
128
|
+
observersCount: [number];
|
|
124
129
|
agentsAvailable: undefined;
|
|
125
130
|
sessionContinue: undefined;
|
|
126
131
|
sessionEnd: undefined;
|
|
@@ -130,6 +135,13 @@ type SDKEvents = {
|
|
|
130
135
|
customMessage: [{ observer: string } | { visitor: string }, Record<string, any>];
|
|
131
136
|
};
|
|
132
137
|
|
|
138
|
+
type Observer = {
|
|
139
|
+
name: string | null;
|
|
140
|
+
id: string;
|
|
141
|
+
screenWidth: number;
|
|
142
|
+
screenHeight: number;
|
|
143
|
+
};
|
|
144
|
+
|
|
133
145
|
type Instruction =
|
|
134
146
|
| ["init", Partial<Omit<CobrowsingSdkConfiguration, "apiKey">> & { apiKey: string }]
|
|
135
147
|
| ["reset"]
|