@ftvs/jssdk 1.2.0 → 1.3.0
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/lib/index.d.ts +48 -32
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ declare function chooseImage(): Promise<ChooseImageResult>;
|
|
|
77
77
|
* @category 路由
|
|
78
78
|
* @example
|
|
79
79
|
* ```javascript
|
|
80
|
-
* await ftv.
|
|
80
|
+
* await ftv.closeWebView();
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
83
|
declare function closeWebView(): Promise<void>;
|
|
@@ -105,12 +105,6 @@ interface ConfigPayload {
|
|
|
105
105
|
* 服务端分配的 AppSecret。
|
|
106
106
|
*/
|
|
107
107
|
appSecret: string;
|
|
108
|
-
/**
|
|
109
|
-
* 是否启用埋点工具。
|
|
110
|
-
*
|
|
111
|
-
* @default false
|
|
112
|
-
*/
|
|
113
|
-
track?: boolean | string | TrackOptions;
|
|
114
108
|
/**
|
|
115
109
|
* 是否开启 debug 模式。
|
|
116
110
|
*
|
|
@@ -129,7 +123,6 @@ interface ConfigPayload {
|
|
|
129
123
|
* await ftv.config({
|
|
130
124
|
* appId: 'xxxx',
|
|
131
125
|
* appSecret: 'xxxxxx',
|
|
132
|
-
* track: true,
|
|
133
126
|
* debug: process.env.NODE_ENV === 'development',
|
|
134
127
|
* });
|
|
135
128
|
* ```
|
|
@@ -215,6 +208,26 @@ interface GetAuthCodeResult {
|
|
|
215
208
|
*/
|
|
216
209
|
declare function getAuthCode(payload: GetAuthCodePayload): Promise<GetAuthCodeResult>;
|
|
217
210
|
|
|
211
|
+
interface GetTokenResult {
|
|
212
|
+
/**
|
|
213
|
+
* 令牌,返回空字符串表示没有登录
|
|
214
|
+
*/
|
|
215
|
+
token: string;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 获取token令牌
|
|
219
|
+
* @category 开放接口 > 用户信息
|
|
220
|
+
* @example
|
|
221
|
+
* ```javascript
|
|
222
|
+
* const res = await ftv.getAuthToken();
|
|
223
|
+
* // 结果类似:
|
|
224
|
+
* // {
|
|
225
|
+
* // token: 'xxxxxxxxxxxxxxxxxx'
|
|
226
|
+
* // }
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
declare function getAuthToken(): Promise<GetTokenResult>;
|
|
230
|
+
|
|
218
231
|
interface Environment {
|
|
219
232
|
/**
|
|
220
233
|
* 是否在未来电视客户端中。
|
|
@@ -283,26 +296,6 @@ declare function getEnvSync(): Environment;
|
|
|
283
296
|
*/
|
|
284
297
|
declare function getEnv(): Promise<Environment>;
|
|
285
298
|
|
|
286
|
-
interface GetTokenResult {
|
|
287
|
-
/**
|
|
288
|
-
* 令牌,返回空字符串表示没有登录
|
|
289
|
-
*/
|
|
290
|
-
token: string;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* 获取token令牌
|
|
294
|
-
* @category 开放接口 > 用户信息
|
|
295
|
-
* @example
|
|
296
|
-
* ```javascript
|
|
297
|
-
* const res = await ftv.getAuthToken();
|
|
298
|
-
* // 结果类似:
|
|
299
|
-
* // {
|
|
300
|
-
* // token: 'xxxxxxxxxxxxxxxxxx'
|
|
301
|
-
* // }
|
|
302
|
-
* ```
|
|
303
|
-
*/
|
|
304
|
-
declare function getAuthToken(): Promise<GetTokenResult>;
|
|
305
|
-
|
|
306
299
|
declare type OneData<T> = {
|
|
307
300
|
[K in keyof T]: any;
|
|
308
301
|
};
|
|
@@ -438,6 +431,25 @@ interface RequestFaceAuthenticationResult {
|
|
|
438
431
|
*/
|
|
439
432
|
declare function requestFaceAuthentication(payload: RequestFaceAuthenticationPayload): Promise<RequestFaceAuthenticationResult>;
|
|
440
433
|
|
|
434
|
+
interface ReturnToControlPayload {
|
|
435
|
+
/**
|
|
436
|
+
* 是否管控
|
|
437
|
+
*/
|
|
438
|
+
hijack: boolean;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* 路由权限管控。
|
|
442
|
+
*
|
|
443
|
+
* @category 路由
|
|
444
|
+
* @example
|
|
445
|
+
* ```javascript
|
|
446
|
+
* await ftv.returnToControl({
|
|
447
|
+
* hijack: true
|
|
448
|
+
* });
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
declare function returnToControl(payload: ReturnToControlPayload): Promise<void>;
|
|
452
|
+
|
|
441
453
|
interface SelectFamilyResult {
|
|
442
454
|
/**
|
|
443
455
|
* 打开状态
|
|
@@ -484,11 +496,11 @@ declare const _ftv_defaultAddress: typeof defaultAddress;
|
|
|
484
496
|
type _ftv_GetAuthCodePayload = GetAuthCodePayload;
|
|
485
497
|
type _ftv_GetAuthCodeResult = GetAuthCodeResult;
|
|
486
498
|
declare const _ftv_getAuthCode: typeof getAuthCode;
|
|
499
|
+
type _ftv_GetTokenResult = GetTokenResult;
|
|
500
|
+
declare const _ftv_getAuthToken: typeof getAuthToken;
|
|
487
501
|
declare const _ftv_getEnv: typeof getEnv;
|
|
488
502
|
type _ftv_Environment = Environment;
|
|
489
503
|
declare const _ftv_getEnvSync: typeof getEnvSync;
|
|
490
|
-
type _ftv_GetTokenResult = GetTokenResult;
|
|
491
|
-
declare const _ftv_getAuthToken: typeof getAuthToken;
|
|
492
504
|
type _ftv_GetUserInfoPayload = GetUserInfoPayload;
|
|
493
505
|
type _ftv_GetUserInfoResult = GetUserInfoResult;
|
|
494
506
|
declare const _ftv_getUserInfo: typeof getUserInfo;
|
|
@@ -498,6 +510,8 @@ declare const _ftv_navigateTo: typeof navigateTo;
|
|
|
498
510
|
type _ftv_RequestFaceAuthenticationPayload = RequestFaceAuthenticationPayload;
|
|
499
511
|
type _ftv_RequestFaceAuthenticationResult = RequestFaceAuthenticationResult;
|
|
500
512
|
declare const _ftv_requestFaceAuthentication: typeof requestFaceAuthentication;
|
|
513
|
+
type _ftv_ReturnToControlPayload = ReturnToControlPayload;
|
|
514
|
+
declare const _ftv_returnToControl: typeof returnToControl;
|
|
501
515
|
type _ftv_SelectFamilyResult = SelectFamilyResult;
|
|
502
516
|
declare const _ftv_selectFamily: typeof selectFamily;
|
|
503
517
|
declare namespace _ftv {
|
|
@@ -515,11 +529,11 @@ declare namespace _ftv {
|
|
|
515
529
|
_ftv_GetAuthCodePayload as GetAuthCodePayload,
|
|
516
530
|
_ftv_GetAuthCodeResult as GetAuthCodeResult,
|
|
517
531
|
_ftv_getAuthCode as getAuthCode,
|
|
532
|
+
_ftv_GetTokenResult as GetTokenResult,
|
|
533
|
+
_ftv_getAuthToken as getAuthToken,
|
|
518
534
|
_ftv_getEnv as getEnv,
|
|
519
535
|
_ftv_Environment as Environment,
|
|
520
536
|
_ftv_getEnvSync as getEnvSync,
|
|
521
|
-
_ftv_GetTokenResult as GetTokenResult,
|
|
522
|
-
_ftv_getAuthToken as getAuthToken,
|
|
523
537
|
_ftv_GetUserInfoPayload as GetUserInfoPayload,
|
|
524
538
|
_ftv_GetUserInfoResult as GetUserInfoResult,
|
|
525
539
|
_ftv_getUserInfo as getUserInfo,
|
|
@@ -529,6 +543,8 @@ declare namespace _ftv {
|
|
|
529
543
|
_ftv_RequestFaceAuthenticationPayload as RequestFaceAuthenticationPayload,
|
|
530
544
|
_ftv_RequestFaceAuthenticationResult as RequestFaceAuthenticationResult,
|
|
531
545
|
_ftv_requestFaceAuthentication as requestFaceAuthentication,
|
|
546
|
+
_ftv_ReturnToControlPayload as ReturnToControlPayload,
|
|
547
|
+
_ftv_returnToControl as returnToControl,
|
|
532
548
|
_ftv_SelectFamilyResult as SelectFamilyResult,
|
|
533
549
|
_ftv_selectFamily as selectFamily,
|
|
534
550
|
};
|