You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @prop {string} SetupParameters.deviceId - the device id of the client
9
9
* @prop {string} SetupParameters.password - the password of the client
10
10
* @prop {string} SetupParameters.name - the name of the client
11
+
* @prop {string} SetupParameters.appSecret - the app secret of the client
11
12
* @prop {Function} SetupParameters.getStoredClient - a function that returns the stored client data
12
13
* @prop {Function} SetupParameters.setStoredClient - a function that stores the client data
13
14
*/
14
-
typeSetupParameters={
15
-
deviceId: string;
16
-
password: string;
17
-
name: string;
18
-
getStoredClient: ()=>string;
19
-
setStoredClient: (clientData: string|null)=>void;
20
-
};
15
+
typeSetupParameters=
16
+
|{
17
+
deviceId: string;
18
+
password: string;
19
+
name: string;
20
+
appSecret?: string;
21
+
getStoredClient: ()=>string;
22
+
setStoredClient: (clientData: string|null)=>void;
23
+
}
24
+
|{
25
+
getStoredClient: ()=>string;
26
+
setStoredClient: (clientData: string|null)=>void;
27
+
};
21
28
22
29
/**
23
30
* `setup` initializes the Client and executes `connect()` if necessary. It returns a promise that
@@ -28,28 +35,29 @@ type SetupParameters = {
28
35
* @param {string} SetupParameters.deviceId - the device id of the client
29
36
* @param {string} SetupParameters.password - the password of the client
30
37
* @param {string} SetupParameters.name - the name of the client
38
+
* @param {string} SetupParameters.appSecret - the app secret of the client
31
39
* @param {Function} SetupParameters.getStoredClient - a function that returns the stored client data
32
40
* @param {Function} SetupParameters.setStoredClient - a function that stores the client data
33
41
* @returns {Promise<boolean>} - a promise that resolves to a boolean that indicates whether the Client is paired to the application to which it's attempting to connect
34
42
*
35
43
*/
36
-
exportconstsetup=async({
37
-
deviceId,
38
-
password,
39
-
name,
40
-
getStoredClient,
41
-
setStoredClient,
42
-
}: SetupParameters): Promise<boolean>=>{
43
-
if(!getStoredClient)thrownewError('Client data getter required');
0 commit comments