@yidun/livedetect-sdk-h5 2.3.2 → 2.4.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.
@@ -0,0 +1,2 @@
1
+ import type { UA } from './types';
2
+ export default function compatible(ua: UA): boolean;
@@ -18,6 +18,7 @@ export declare function getHeadersInfo(headers?: Record<string, string>): {
18
18
  sdkType: string;
19
19
  terminal: string;
20
20
  version: string;
21
+ riskVersion: string;
21
22
  };
22
23
  export declare function getTipTextByCode(type: WarnType, code: string): string | null;
23
24
  export declare function getTipCircleColor(type: WarnType, code: string): "#FC8D74" | "#5FD6A9" | undefined;
@@ -35,7 +35,7 @@ declare class NELiveDetection extends EventEmitter implements Dispose {
35
35
  start(): Promise<void>;
36
36
  restart(): Promise<void>;
37
37
  dispose(): void;
38
- private canUseSDK;
38
+ private isSupport;
39
39
  private onSuccess;
40
40
  private onFail;
41
41
  private getConfigs;
@@ -30,15 +30,22 @@ export interface Options extends PirvateOptions {
30
30
  token: string;
31
31
  offlineToken: string;
32
32
  };
33
- isSupport?: (ua: BrandVersion) => boolean;
33
+ useBuiltinSupport?: boolean;
34
+ isSupport?: (ua: UA) => boolean;
34
35
  onMount?: (instance?: NELiveDetection) => void;
35
36
  onReady?: (instance?: NELiveDetection) => void;
36
37
  }
37
38
  export declare type WarnType = 'fail' | 'tip';
38
39
  export declare type FailCode = 'unsupported' | 'notallowed' | 'notfound' | 'notreadable' | 'overconstrained' | 'abort' | 'reject' | 'timeout' | 'action_timeout' | 'auth' | 'pdFail';
39
- export interface BrandVersion {
40
- osName: string;
41
- osVersion: string;
42
- browserName: string;
43
- browserVersion: string;
40
+ export interface Browser {
41
+ name: string;
42
+ version: string;
43
+ }
44
+ export interface OS {
45
+ name: string;
46
+ version: string;
47
+ }
48
+ export interface UA {
49
+ os: OS;
50
+ browser: Browser;
44
51
  }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@yidun/livedetect-sdk-h5",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "活体检测 H5",
5
+ "riskVersion": "2.1.2",
5
6
  "main": "dist/NELiveDetection.umd.js",
6
7
  "module": "dist/es/NELiveDetection.esm.js",
7
8
  "typings": "dist/es/typings/index.d.ts",