@yidun/livedetect-sdk-h5 2.0.1 → 2.2.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.
Files changed (33) hide show
  1. package/README.md +8 -4
  2. package/dist/{NELiveDetection.v2.0.1.umd.js → NELiveDetection.umd.js} +2 -2
  3. package/dist/es/NELiveDetection.esm.js +2 -2
  4. package/dist/es/typings/index.d.ts +3 -3
  5. package/dist/es/typings/main/constants.d.ts +34 -34
  6. package/dist/es/typings/main/helpers.d.ts +23 -23
  7. package/dist/es/typings/main/libs/BDFaceSdk.esm.min.d.ts +2 -2
  8. package/dist/es/typings/main/libs/asmcrypto.d.ts +32 -32
  9. package/dist/es/typings/main/libs/index.d.ts +8 -8
  10. package/dist/es/typings/main/live-detection.d.ts +36 -34
  11. package/dist/es/typings/main/modules/camera/index.d.ts +18 -18
  12. package/dist/es/typings/main/modules/color/index.d.ts +14 -14
  13. package/dist/es/typings/main/modules/footer/index.d.ts +8 -8
  14. package/dist/es/typings/main/modules/progress/index.d.ts +11 -11
  15. package/dist/es/typings/main/modules/record/checking.d.ts +5 -5
  16. package/dist/es/typings/main/modules/record/index.d.ts +15 -15
  17. package/dist/es/typings/main/modules/record/start.d.ts +14 -14
  18. package/dist/es/typings/main/modules/tip/index.d.ts +13 -13
  19. package/dist/es/typings/main/modules/toast/index.d.ts +12 -12
  20. package/dist/es/typings/main/modules/toast/toast-item.d.ts +9 -9
  21. package/dist/es/typings/main/types.d.ts +29 -27
  22. package/dist/es/typings/main/utils/collector.d.ts +13 -13
  23. package/dist/es/typings/main/utils/dispose.d.ts +8 -8
  24. package/dist/es/typings/main/utils/dom.d.ts +15 -15
  25. package/dist/es/typings/main/utils/domNode.d.ts +7 -7
  26. package/dist/es/typings/main/utils/eventmitter.d.ts +10 -10
  27. package/dist/es/typings/main/utils/i18n.d.ts +72 -72
  28. package/dist/es/typings/main/utils/index.d.ts +24 -24
  29. package/dist/es/typings/main/utils/is.d.ts +7 -7
  30. package/dist/es/typings/main/utils/logger.d.ts +9 -9
  31. package/dist/es/typings/main/utils/request.d.ts +12 -9
  32. package/package.json +6 -3
  33. /package/dist/{NELiveDetection.v2.0.1.min.css → NELiveDetection.min.css} +0 -0
@@ -1,3 +1,3 @@
1
- import './style/index.less';
2
- import NELiveDetection from './main/live-detection';
3
- export default NELiveDetection;
1
+ import './style/index.less';
2
+ import NELiveDetection from './main/live-detection';
3
+ export default NELiveDetection;
@@ -1,34 +1,34 @@
1
- import type { FailCode } from './types';
2
- export declare const CLASS_PREFIX = "ne-live-detection";
3
- export declare const EVENT: {
4
- readonly STATUS: "status";
5
- readonly TIP: "tip";
6
- readonly ACTION: "action";
7
- readonly COLOR: "color";
8
- readonly LOADING: "loading";
9
- readonly UPDATE_CONFIG: "update-config";
10
- readonly VIDEO_CHANGE: "video-change";
11
- readonly UPDATE_RECORD_STEP: "update-record-step";
12
- readonly READY: "ready";
13
- readonly VERIFY: "verify";
14
- readonly ERROR: "error";
15
- readonly TIMEOUT: "timeout";
16
- readonly CHECKING: "checking";
17
- readonly CHECK_DONE: "check-done";
18
- readonly BACK: "back";
19
- };
20
- export declare const ERR_CODE: Record<string, [number, string]>;
21
- export declare const PARAMS_COMMON: {
22
- PIC_TYPE: number;
23
- SDK_TYPE: number;
24
- };
25
- export declare const TIP_CODE_MAP: Record<string, [string, string]>;
26
- export declare const FAIL_CODE_MAP: Record<string, [FailCode, string]>;
27
- export declare const CHECK_STATUS_MAP: Record<string, number>;
28
- export declare const VIDEO_ACTION_MAP: Record<string, [string, string]>;
29
- export declare const SOLUTION_TYPE_MAP: Record<string, [number, string]>;
30
- export declare const COLLECT_LOG_TYPE: {
31
- DEBUG_LOG: string[];
32
- API_ERRPR: string[];
33
- RESOURCE_ERRPR: string[];
34
- };
1
+ import type { FailCode } from './types';
2
+ export declare const CLASS_PREFIX = "ne-live-detection";
3
+ export declare const EVENT: {
4
+ readonly STATUS: "status";
5
+ readonly TIP: "tip";
6
+ readonly ACTION: "action";
7
+ readonly COLOR: "color";
8
+ readonly LOADING: "loading";
9
+ readonly UPDATE_CONFIG: "update-config";
10
+ readonly VIDEO_CHANGE: "video-change";
11
+ readonly UPDATE_RECORD_STEP: "update-record-step";
12
+ readonly READY: "ready";
13
+ readonly VERIFY: "verify";
14
+ readonly ERROR: "error";
15
+ readonly TIMEOUT: "timeout";
16
+ readonly CHECKING: "checking";
17
+ readonly CHECK_DONE: "check-done";
18
+ readonly BACK: "back";
19
+ };
20
+ export declare const ERR_CODE: Record<string, [number, string]>;
21
+ export declare const PARAMS_COMMON: {
22
+ PIC_TYPE: number;
23
+ SDK_TYPE: number;
24
+ };
25
+ export declare const TIP_CODE_MAP: Record<string, [string, string]>;
26
+ export declare const FAIL_CODE_MAP: Record<string, [FailCode, string]>;
27
+ export declare const CHECK_STATUS_MAP: Record<string, number>;
28
+ export declare const VIDEO_ACTION_MAP: Record<string, [string, string]>;
29
+ export declare const SOLUTION_TYPE_MAP: Record<string, [number, string]>;
30
+ export declare const COLLECT_LOG_TYPE: {
31
+ DEBUG_LOG: string[];
32
+ API_ERRPR: string[];
33
+ RESOURCE_ERRPR: string[];
34
+ };
@@ -1,23 +1,23 @@
1
- import type { Options, WarnType } from './types';
2
- import Collector from './utils/collector';
3
- export declare function collectError(collector?: Collector, info?: {
4
- type: string;
5
- name: string;
6
- value: string;
7
- }): void;
8
- export declare function collectPerformance(collector?: Collector): ((url: string) => void) | undefined;
9
- export declare function collectLog(name: string, opts: Options, logMsg: string): {
10
- type: string;
11
- name: string;
12
- value: string;
13
- };
14
- export declare function processOptions(options?: Options, collector?: Collector): Required<Options>;
15
- export declare function getHeadersInfo(headers?: Record<string, string>): {
16
- model: string;
17
- osVersion: string;
18
- sdkType: string;
19
- terminal: string;
20
- version: string;
21
- };
22
- export declare function getTipTextByCode(type: WarnType, code: string): string | null;
23
- export declare function getTipCircleColor(type: WarnType, code: string): "#FC8D74" | "#5FD6A9" | undefined;
1
+ import type { Options, WarnType } from './types';
2
+ import Collector from './utils/collector';
3
+ export declare function collectError(collector?: Collector, info?: {
4
+ type: string;
5
+ name: string;
6
+ value: string;
7
+ }): void;
8
+ export declare function collectPerformance(collector?: Collector): ((url: string) => void) | undefined;
9
+ export declare function collectLog(name: string, opts: Options, logMsg: string): {
10
+ type: string;
11
+ name: string;
12
+ value: string;
13
+ };
14
+ export declare function processOptions(options?: Options, collector?: Collector): Required<Options>;
15
+ export declare function getHeadersInfo(headers?: Record<string, string>): {
16
+ model: string;
17
+ osVersion: string;
18
+ sdkType: string;
19
+ terminal: string;
20
+ version: string;
21
+ };
22
+ export declare function getTipTextByCode(type: WarnType, code: string): string | null;
23
+ export declare function getTipCircleColor(type: WarnType, code: string): "#FC8D74" | "#5FD6A9" | undefined;
@@ -1,2 +1,2 @@
1
- export { BDFaceLiveDetection as default };
2
- declare function BDFaceLiveDetection(_options: any): any;
1
+ export { BDFaceLiveDetection as default };
2
+ declare function BDFaceLiveDetection(_options: any): any;
@@ -1,32 +1,32 @@
1
- export class AES_GCM {
2
- static encrypt(cleartext: any, key: any, nonce: any, adata: any, tagsize: any): Uint8Array;
3
- static decrypt(ciphertext: any, key: any, nonce: any, adata: any, tagsize: any): Uint8Array;
4
- constructor(key: any, nonce: any, adata: any, tagSize: number | undefined, aes: any);
5
- tagSize: number;
6
- gamma0: number;
7
- counter: number;
8
- aes: any;
9
- adata: any;
10
- encrypt(data: any): Uint8Array;
11
- decrypt(data: any): Uint8Array;
12
- AES_GCM_Encrypt_process(data: any): Uint8Array;
13
- AES_GCM_Encrypt_finish(): Uint8Array;
14
- AES_GCM_Decrypt_process(data: any): Uint8Array;
15
- AES_GCM_Decrypt_finish(): Uint8Array;
16
- AES_GCM_decrypt(data: any): Uint8Array;
17
- AES_GCM_encrypt(data: any): Uint8Array;
18
- _gcm_mac_process(data: any): void;
19
- }
20
- export class IllegalArgumentError extends Error {
21
- constructor(...args: any[]);
22
- }
23
- export class IllegalStateError extends Error {
24
- constructor(...args: any[]);
25
- }
26
- export class SecurityError extends Error {
27
- constructor(...args: any[]);
28
- }
29
- export function base64_to_bytes(str: any): Uint8Array;
30
- export function bytes_to_base64(arr: any): string;
31
- export function bytes_to_string(bytes: any, utf8?: boolean): string;
32
- export function string_to_bytes(str: any, utf8?: boolean): Uint8Array;
1
+ export class AES_GCM {
2
+ static encrypt(cleartext: any, key: any, nonce: any, adata: any, tagsize: any): Uint8Array;
3
+ static decrypt(ciphertext: any, key: any, nonce: any, adata: any, tagsize: any): Uint8Array;
4
+ constructor(key: any, nonce: any, adata: any, tagSize: number | undefined, aes: any);
5
+ tagSize: number;
6
+ gamma0: number;
7
+ counter: number;
8
+ aes: any;
9
+ adata: any;
10
+ encrypt(data: any): Uint8Array;
11
+ decrypt(data: any): Uint8Array;
12
+ AES_GCM_Encrypt_process(data: any): Uint8Array;
13
+ AES_GCM_Encrypt_finish(): Uint8Array;
14
+ AES_GCM_Decrypt_process(data: any): Uint8Array;
15
+ AES_GCM_Decrypt_finish(): Uint8Array;
16
+ AES_GCM_decrypt(data: any): Uint8Array;
17
+ AES_GCM_encrypt(data: any): Uint8Array;
18
+ _gcm_mac_process(data: any): void;
19
+ }
20
+ export class IllegalArgumentError extends Error {
21
+ constructor(...args: any[]);
22
+ }
23
+ export class IllegalStateError extends Error {
24
+ constructor(...args: any[]);
25
+ }
26
+ export class SecurityError extends Error {
27
+ constructor(...args: any[]);
28
+ }
29
+ export function base64_to_bytes(str: any): Uint8Array;
30
+ export function bytes_to_base64(arr: any): string;
31
+ export function bytes_to_string(bytes: any, utf8?: boolean): string;
32
+ export function string_to_bytes(str: any, utf8?: boolean): Uint8Array;
@@ -1,8 +1,8 @@
1
- export function normalizeParams(data: any): string;
2
- export function uuid(len: any, radix: any): string;
3
- export function eypt(data: any): {
4
- key: string;
5
- iv: string;
6
- eyptStr: string;
7
- };
8
- export function decrypt(str: any, key: any, iv: any): string;
1
+ export function normalizeParams(data: any): string;
2
+ export function uuid(len: any, radix: any): string;
3
+ export function eypt(data: any): {
4
+ key: string;
5
+ iv: string;
6
+ eyptStr: string;
7
+ };
8
+ export function decrypt(str: any, key: any, iv: any): string;
@@ -1,34 +1,36 @@
1
- import type { Options } from './types';
2
- import type { Dispose } from './utils/dispose';
3
- import { EventEmitter } from './utils/eventmitter';
4
- import Collector from './utils/collector';
5
- import { Tip } from './modules/tip';
6
- import { Camera } from './modules/camera';
7
- import { Progress } from './modules/progress';
8
- import { Footer } from './modules/footer';
9
- import { Record } from './modules/record';
10
- declare class NELiveDetection extends EventEmitter implements Dispose {
11
- bdFaceSdk: any;
12
- options: Required<Options>;
13
- container: HTMLElement | null;
14
- el: HTMLElement;
15
- readonly collector: Collector;
16
- readonly netCollector: Collector;
17
- readonly tip: Tip;
18
- readonly camera: Camera;
19
- readonly progress: Progress;
20
- readonly footer: Footer;
21
- readonly record: Record;
22
- constructor(options: Options);
23
- mount(container?: Options['container']): void;
24
- mergeOptionsFromServer(): Promise<void>;
25
- initBdFaceSdk(isEmitReady?: boolean): Promise<void>;
26
- start(): void;
27
- restart(): Promise<void>;
28
- dispose(): void;
29
- private getConfigs;
30
- private check;
31
- private videoChange;
32
- private collectCheckUnpassError;
33
- }
34
- export default NELiveDetection;
1
+ import { RequestOptions } from './utils/request';
2
+ import type { Options } from './types';
3
+ import type { Dispose } from './utils/dispose';
4
+ import { EventEmitter } from './utils/eventmitter';
5
+ import Collector from './utils/collector';
6
+ import { Tip } from './modules/tip';
7
+ import { Camera } from './modules/camera';
8
+ import { Progress } from './modules/progress';
9
+ import { Footer } from './modules/footer';
10
+ import { Record } from './modules/record';
11
+ declare class NELiveDetection extends EventEmitter implements Dispose {
12
+ bdFaceSdk: any;
13
+ options: Required<Options>;
14
+ container: HTMLElement | null;
15
+ el: HTMLElement;
16
+ readonly collector: Collector;
17
+ readonly netCollector: Collector;
18
+ readonly request: <T>(opts: Omit<RequestOptions, 'apiServer'>, callback?: Function) => Promise<T>;
19
+ readonly tip: Tip;
20
+ readonly camera: Camera;
21
+ readonly progress: Progress;
22
+ readonly footer: Footer;
23
+ readonly record?: Record;
24
+ constructor(options: Options);
25
+ mount(container?: Options['container']): void;
26
+ mergeOptionsFromServer(): Promise<void>;
27
+ initBdFaceSdk(isEmitReady?: boolean): Promise<void>;
28
+ start(): void;
29
+ restart(): Promise<void>;
30
+ dispose(): void;
31
+ private getConfigs;
32
+ private check;
33
+ private videoChange;
34
+ private collectCheckUnpassError;
35
+ }
36
+ export default NELiveDetection;
@@ -1,18 +1,18 @@
1
- import type { WarnType } from '@Src/main/types';
2
- import NELiveDetection from '@Src/main/live-detection';
3
- import { DomNode } from '@Src/main/utils/domNode';
4
- export declare class Camera extends DomNode {
5
- private readonly neLiveDetection;
6
- readonly cameraInner: HTMLElement;
7
- readonly cameraLoadingText: HTMLElement;
8
- readonly circleBg: HTMLElement;
9
- readonly circleAni: HTMLElement;
10
- loading: boolean;
11
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
12
- updateCameraDiameter(): void;
13
- updateLoadingStatus(val: boolean): void;
14
- updateCircleAni({ type, code }: {
15
- code: string;
16
- type: WarnType;
17
- }): void;
18
- }
1
+ import type { WarnType } from '@Src/main/types';
2
+ import NELiveDetection from '@Src/main/live-detection';
3
+ import { DomNode } from '@Src/main/utils/domNode';
4
+ export declare class Camera extends DomNode {
5
+ private readonly neLiveDetection;
6
+ readonly cameraInner: HTMLElement;
7
+ readonly cameraLoadingText: HTMLElement;
8
+ readonly circleBg: HTMLElement;
9
+ readonly circleAni: HTMLElement;
10
+ loading: boolean;
11
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
12
+ updateCameraDiameter(): void;
13
+ updateLoadingStatus(val: boolean): void;
14
+ updateCircleAni({ type, code }: {
15
+ code: string;
16
+ type: WarnType;
17
+ }): void;
18
+ }
@@ -1,14 +1,14 @@
1
- import NELiveDetection from '@Src/main/live-detection';
2
- import { DomNode } from '@Src/main/utils/domNode';
3
- export interface ColorOptions {
4
- size: number;
5
- }
6
- export declare class Color extends DomNode {
7
- private readonly neLiveDetection;
8
- private readonly opts;
9
- colors: HTMLElement[];
10
- activeColor: number;
11
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection, opts: ColorOptions);
12
- initColors(): void;
13
- updateActiveColor(activeColor: number): void;
14
- }
1
+ import NELiveDetection from '@Src/main/live-detection';
2
+ import { DomNode } from '@Src/main/utils/domNode';
3
+ export interface ColorOptions {
4
+ size: number;
5
+ }
6
+ export declare class Color extends DomNode {
7
+ private readonly neLiveDetection;
8
+ private readonly opts;
9
+ colors: HTMLElement[];
10
+ activeColor: number;
11
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection, opts: ColorOptions);
12
+ initColors(): void;
13
+ updateActiveColor(activeColor: number): void;
14
+ }
@@ -1,8 +1,8 @@
1
- import NELiveDetection from '@Src/main/live-detection';
2
- import { DomNode } from '@Src/main/utils/domNode';
3
- export declare class Footer extends DomNode {
4
- private readonly neLiveDetection;
5
- iconTips: Array<[string, string, string]>;
6
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
7
- initFooter(): void;
8
- }
1
+ import NELiveDetection from '@Src/main/live-detection';
2
+ import { DomNode } from '@Src/main/utils/domNode';
3
+ export declare class Footer extends DomNode {
4
+ private readonly neLiveDetection;
5
+ iconTips: Array<[string, string, string]>;
6
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
7
+ initFooter(): void;
8
+ }
@@ -1,11 +1,11 @@
1
- import NELiveDetection from '@Src/main/live-detection';
2
- import { DomNode } from '@Src/main/utils/domNode';
3
- export declare class Progress extends DomNode {
4
- private readonly neLiveDetection;
5
- steps: HTMLElement[];
6
- activeIndex: number;
7
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
8
- initSteps(): void;
9
- updateActiveStep(activeIndex: number): void;
10
- updateActiveIndex(activeIndex: number): void;
11
- }
1
+ import NELiveDetection from '@Src/main/live-detection';
2
+ import { DomNode } from '@Src/main/utils/domNode';
3
+ export declare class Progress extends DomNode {
4
+ private readonly neLiveDetection;
5
+ steps: HTMLElement[];
6
+ activeIndex: number;
7
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
8
+ initSteps(): void;
9
+ updateActiveStep(activeIndex: number): void;
10
+ updateActiveIndex(activeIndex: number): void;
11
+ }
@@ -1,5 +1,5 @@
1
- import { DomNode } from '@Src/main/utils/domNode';
2
- export default class Checking extends DomNode {
3
- constructor(container: HTMLElement);
4
- show(show?: boolean): void;
5
- }
1
+ import { DomNode } from '@Src/main/utils/domNode';
2
+ export default class Checking extends DomNode {
3
+ constructor(container: HTMLElement);
4
+ show(show?: boolean): void;
5
+ }
@@ -1,15 +1,15 @@
1
- import NELiveDetection from '@Src/main/live-detection';
2
- import { DomNode } from '@Src/main/utils/domNode';
3
- import Start from './start';
4
- import Checking from './checking';
5
- declare type Step = 'start' | 'checking';
6
- export declare class Record extends DomNode {
7
- private readonly neLiveDetection;
8
- step?: Step;
9
- readonly start: Start;
10
- readonly checking: Checking;
11
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
12
- show(show?: boolean): void;
13
- updateStep(step: Step): void;
14
- }
15
- export {};
1
+ import NELiveDetection from '@Src/main/live-detection';
2
+ import { DomNode } from '@Src/main/utils/domNode';
3
+ import Start from './start';
4
+ import Checking from './checking';
5
+ declare type Step = 'start' | 'checking';
6
+ export declare class Record extends DomNode {
7
+ private readonly neLiveDetection;
8
+ step?: Step;
9
+ readonly start: Start;
10
+ readonly checking: Checking;
11
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
12
+ show(show?: boolean): void;
13
+ updateStep(step: Step): void;
14
+ }
15
+ export {};
@@ -1,14 +1,14 @@
1
- import { DomNode } from '@Src/main/utils/domNode';
2
- import Toast from '../toast';
3
- import NELiveDetection from '@Src/main/live-detection';
4
- export default class Start extends DomNode {
5
- private readonly neLiveDetection;
6
- recordBtn: HTMLButtonElement;
7
- recordFileInput: HTMLInputElement;
8
- conditionWrapper: HTMLDivElement;
9
- readonly toast: Toast;
10
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
11
- show(show?: boolean): void;
12
- private updateSolutionTip;
13
- private uploadVideo;
14
- }
1
+ import { DomNode } from '@Src/main/utils/domNode';
2
+ import Toast from '../toast';
3
+ import NELiveDetection from '@Src/main/live-detection';
4
+ export default class Start extends DomNode {
5
+ private readonly neLiveDetection;
6
+ recordBtn: HTMLButtonElement;
7
+ recordFileInput: HTMLInputElement;
8
+ conditionWrapper: HTMLDivElement;
9
+ readonly toast: Toast;
10
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
11
+ show(show?: boolean): void;
12
+ private updateSolutionTip;
13
+ private uploadVideo;
14
+ }
@@ -1,13 +1,13 @@
1
- import type { WarnType } from '@Src/main/types';
2
- import NELiveDetection from '@Src/main/live-detection';
3
- import { DomNode } from '@Src/main/utils/domNode';
4
- export declare class Tip extends DomNode {
5
- private readonly neLiveDetection;
6
- code: string;
7
- text: string | null;
8
- constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
9
- updateTip({ code, type }: {
10
- code: string;
11
- type: WarnType;
12
- }): void;
13
- }
1
+ import type { WarnType } from '@Src/main/types';
2
+ import NELiveDetection from '@Src/main/live-detection';
3
+ import { DomNode } from '@Src/main/utils/domNode';
4
+ export declare class Tip extends DomNode {
5
+ private readonly neLiveDetection;
6
+ code: string;
7
+ text: string | null;
8
+ constructor(container: HTMLElement, neLiveDetection: NELiveDetection);
9
+ updateTip({ code, type }: {
10
+ code: string;
11
+ type: WarnType;
12
+ }): void;
13
+ }
@@ -1,12 +1,12 @@
1
- import { Dispose } from '@Src/main/utils/dispose';
2
- import ToastItem from './toast-item';
3
- export declare type Position = 'center';
4
- declare class Toast implements Dispose {
5
- private toasts;
6
- private container;
7
- constructor(container: HTMLElement);
8
- show(html: string | HTMLElement, position: Position, timeout?: number): ToastItem;
9
- close(toastItem?: ToastItem): void;
10
- dispose(): void;
11
- }
12
- export default Toast;
1
+ import { Dispose } from '@Src/main/utils/dispose';
2
+ import ToastItem from './toast-item';
3
+ export declare type Position = 'center';
4
+ declare class Toast implements Dispose {
5
+ private toasts;
6
+ private container;
7
+ constructor(container: HTMLElement);
8
+ show(html: string | HTMLElement, position: Position, timeout?: number): ToastItem;
9
+ close(toastItem?: ToastItem): void;
10
+ dispose(): void;
11
+ }
12
+ export default Toast;
@@ -1,9 +1,9 @@
1
- import { DomNode } from '@Src/main/utils/domNode';
2
- import { Position } from '.';
3
- declare class ToastItem extends DomNode {
4
- timer: any;
5
- readonly position: Position;
6
- constructor(container: HTMLElement, html: string | HTMLElement, position?: Position);
7
- dispose(): void;
8
- }
9
- export default ToastItem;
1
+ import { DomNode } from '@Src/main/utils/domNode';
2
+ import { Position } from '.';
3
+ declare class ToastItem extends DomNode {
4
+ timer: any;
5
+ readonly position: Position;
6
+ constructor(container: HTMLElement, html: string | HTMLElement, position?: Position);
7
+ dispose(): void;
8
+ }
9
+ export default ToastItem;
@@ -1,27 +1,29 @@
1
- import NELiveDetection from './live-detection';
2
- import type { Lang } from './utils/i18n';
3
- export interface RequestResponse {
4
- code: number;
5
- msg: string;
6
- result: string;
7
- }
8
- export interface PirvateOptions {
9
- code?: string;
10
- colorMap?: string[];
11
- token?: string;
12
- solutionType?: number;
13
- videoActions?: string[];
14
- }
15
- export interface Options extends PirvateOptions {
16
- container: HTMLElement | string;
17
- businessKey: string;
18
- mode?: 'mount' | 'popup';
19
- diameter?: number;
20
- audio?: boolean;
21
- footerTip?: boolean;
22
- lang?: Lang;
23
- onMount?: (instance?: NELiveDetection) => void;
24
- onReady?: (instance?: NELiveDetection) => void;
25
- }
26
- export declare type WarnType = 'fail' | 'tip';
27
- export declare type FailCode = 'unsupported' | 'notallowed' | 'notfound' | 'notreadable' | 'overconstrained' | 'abort' | 'reject' | 'timeout' | 'action_timeout' | 'auth' | 'pdFail';
1
+ import NELiveDetection from './live-detection';
2
+ import type { Lang } from './utils/i18n';
3
+ export interface RequestResponse {
4
+ code: number;
5
+ msg: string;
6
+ result: string;
7
+ }
8
+ export interface PirvateOptions {
9
+ code?: string;
10
+ colorMap?: string[];
11
+ token?: string;
12
+ solutionType?: number;
13
+ videoActions?: string[];
14
+ }
15
+ export interface Options extends PirvateOptions {
16
+ container: HTMLElement | string;
17
+ businessKey: string;
18
+ mode?: 'mount' | 'popup';
19
+ diameter?: number;
20
+ audio?: boolean;
21
+ fallback?: boolean;
22
+ footerTip?: boolean;
23
+ lang?: Lang;
24
+ apiServer?: string;
25
+ onMount?: (instance?: NELiveDetection) => void;
26
+ onReady?: (instance?: NELiveDetection) => void;
27
+ }
28
+ export declare type WarnType = 'fail' | 'tip';
29
+ export declare type FailCode = 'unsupported' | 'notallowed' | 'notfound' | 'notreadable' | 'overconstrained' | 'abort' | 'reject' | 'timeout' | 'action_timeout' | 'auth' | 'pdFail';
@@ -1,13 +1,13 @@
1
- import Snaker, { Options as SnakerOptions } from '@yidun/snaker';
2
- interface ExtraParams {
3
- tt: 'web';
4
- dataVersion: 'v1';
5
- }
6
- declare class Collector {
7
- readonly snaker: Snaker;
8
- extraParams: ExtraParams;
9
- constructor(params: Partial<SnakerOptions>);
10
- collect(type: string, name: string, value: string): void;
11
- collectAsync(type: string, name: string, value: string): void;
12
- }
13
- export default Collector;
1
+ import Snaker, { Options as SnakerOptions } from '@yidun/snaker';
2
+ interface ExtraParams {
3
+ tt: 'web';
4
+ dataVersion: 'v1';
5
+ }
6
+ declare class Collector {
7
+ readonly snaker: Snaker;
8
+ extraParams: ExtraParams;
9
+ constructor(params: Partial<SnakerOptions>);
10
+ collect(type: string, name: string, value: string): void;
11
+ collectAsync(type: string, name: string, value: string): void;
12
+ }
13
+ export default Collector;