@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.
- package/README.md +8 -4
- package/dist/{NELiveDetection.v2.0.1.umd.js → NELiveDetection.umd.js} +2 -2
- package/dist/es/NELiveDetection.esm.js +2 -2
- package/dist/es/typings/index.d.ts +3 -3
- package/dist/es/typings/main/constants.d.ts +34 -34
- package/dist/es/typings/main/helpers.d.ts +23 -23
- package/dist/es/typings/main/libs/BDFaceSdk.esm.min.d.ts +2 -2
- package/dist/es/typings/main/libs/asmcrypto.d.ts +32 -32
- package/dist/es/typings/main/libs/index.d.ts +8 -8
- package/dist/es/typings/main/live-detection.d.ts +36 -34
- package/dist/es/typings/main/modules/camera/index.d.ts +18 -18
- package/dist/es/typings/main/modules/color/index.d.ts +14 -14
- package/dist/es/typings/main/modules/footer/index.d.ts +8 -8
- package/dist/es/typings/main/modules/progress/index.d.ts +11 -11
- package/dist/es/typings/main/modules/record/checking.d.ts +5 -5
- package/dist/es/typings/main/modules/record/index.d.ts +15 -15
- package/dist/es/typings/main/modules/record/start.d.ts +14 -14
- package/dist/es/typings/main/modules/tip/index.d.ts +13 -13
- package/dist/es/typings/main/modules/toast/index.d.ts +12 -12
- package/dist/es/typings/main/modules/toast/toast-item.d.ts +9 -9
- package/dist/es/typings/main/types.d.ts +29 -27
- package/dist/es/typings/main/utils/collector.d.ts +13 -13
- package/dist/es/typings/main/utils/dispose.d.ts +8 -8
- package/dist/es/typings/main/utils/dom.d.ts +15 -15
- package/dist/es/typings/main/utils/domNode.d.ts +7 -7
- package/dist/es/typings/main/utils/eventmitter.d.ts +10 -10
- package/dist/es/typings/main/utils/i18n.d.ts +72 -72
- package/dist/es/typings/main/utils/index.d.ts +24 -24
- package/dist/es/typings/main/utils/is.d.ts +7 -7
- package/dist/es/typings/main/utils/logger.d.ts +9 -9
- package/dist/es/typings/main/utils/request.d.ts +12 -9
- package/package.json +6 -3
- /package/dist/{NELiveDetection.v2.0.1.min.css → NELiveDetection.min.css} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DomListener } from './dom';
|
|
2
|
-
export interface Dispose {
|
|
3
|
-
dispose: () => void;
|
|
4
|
-
}
|
|
5
|
-
export declare function getDisposeMap(): Map<any, Dispose[]>;
|
|
6
|
-
export declare function addDispose<T extends Dispose>(key: any, d: T): T;
|
|
7
|
-
export declare function dispose(key: any): void;
|
|
8
|
-
export declare function addDisposeListener<K extends keyof GlobalEventHandlersEventMap>(key: any, node: EventTarget, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): DomListener;
|
|
1
|
+
import { DomListener } from './dom';
|
|
2
|
+
export interface Dispose {
|
|
3
|
+
dispose: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function getDisposeMap(): Map<any, Dispose[]>;
|
|
6
|
+
export declare function addDispose<T extends Dispose>(key: any, d: T): T;
|
|
7
|
+
export declare function dispose(key: any): void;
|
|
8
|
+
export declare function addDisposeListener<K extends keyof GlobalEventHandlersEventMap>(key: any, node: EventTarget, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): DomListener;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Dispose } from './dispose';
|
|
2
|
-
export declare function createEle<T extends HTMLElement>(tag?: string, attrs?: Record<string, any>, children?: string | Node[], classPrefix?: string): T;
|
|
3
|
-
export declare function getEle(el: HTMLElement | string | undefined | null): HTMLElement | null;
|
|
4
|
-
export declare function removeEle(el: Element): void;
|
|
5
|
-
export declare function addClass<T extends Element>(dom: T, cls?: string, prefix?: string): T;
|
|
6
|
-
export declare function removeClass<T extends Element>(dom: T, cls: string, prefix?: string): T;
|
|
7
|
-
export declare function removeAllChildNode(el: Element): void;
|
|
8
|
-
export declare class DomListener implements Dispose {
|
|
9
|
-
private node;
|
|
10
|
-
private readonly type;
|
|
11
|
-
private handler;
|
|
12
|
-
private options?;
|
|
13
|
-
constructor(node: EventTarget, type: string, handler: (e: any) => void, options?: boolean | AddEventListenerOptions | undefined);
|
|
14
|
-
dispose(): void;
|
|
15
|
-
}
|
|
1
|
+
import { Dispose } from './dispose';
|
|
2
|
+
export declare function createEle<T extends HTMLElement>(tag?: string, attrs?: Record<string, any>, children?: string | Node[], classPrefix?: string): T;
|
|
3
|
+
export declare function getEle(el: HTMLElement | string | undefined | null): HTMLElement | null;
|
|
4
|
+
export declare function removeEle(el: Element): void;
|
|
5
|
+
export declare function addClass<T extends Element>(dom: T, cls?: string, prefix?: string): T;
|
|
6
|
+
export declare function removeClass<T extends Element>(dom: T, cls: string, prefix?: string): T;
|
|
7
|
+
export declare function removeAllChildNode(el: Element): void;
|
|
8
|
+
export declare class DomListener implements Dispose {
|
|
9
|
+
private node;
|
|
10
|
+
private readonly type;
|
|
11
|
+
private handler;
|
|
12
|
+
private options?;
|
|
13
|
+
constructor(node: EventTarget, type: string, handler: (e: any) => void, options?: boolean | AddEventListenerOptions | undefined);
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Dispose } from './dispose';
|
|
2
|
-
export declare class DomNode implements Dispose {
|
|
3
|
-
el: HTMLElement;
|
|
4
|
-
constructor(container?: HTMLElement, tag?: string | HTMLElement, attrs?: Record<string, any>, children?: string | Node[], classPrefix?: string);
|
|
5
|
-
injectStyle(style?: Partial<CSSStyleDeclaration>): void;
|
|
6
|
-
dispose(): void;
|
|
7
|
-
}
|
|
1
|
+
import { Dispose } from './dispose';
|
|
2
|
+
export declare class DomNode implements Dispose {
|
|
3
|
+
el: HTMLElement;
|
|
4
|
+
constructor(container?: HTMLElement, tag?: string | HTMLElement, attrs?: Record<string, any>, children?: string | Node[], classPrefix?: string);
|
|
5
|
+
injectStyle(style?: Partial<CSSStyleDeclaration>): void;
|
|
6
|
+
dispose(): void;
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Dispose } from './dispose';
|
|
2
|
-
export declare class EventEmitter {
|
|
3
|
-
private _events;
|
|
4
|
-
constructor();
|
|
5
|
-
emit(evt: string, ...args: any[]): boolean;
|
|
6
|
-
on(evt: string, fn?: Function): Dispose;
|
|
7
|
-
once(evt: string, fn?: Function): Dispose;
|
|
8
|
-
off(evt: string, fn?: Function): this;
|
|
9
|
-
removeAllListeners(evt?: string): this;
|
|
10
|
-
}
|
|
1
|
+
import { Dispose } from './dispose';
|
|
2
|
+
export declare class EventEmitter {
|
|
3
|
+
private _events;
|
|
4
|
+
constructor();
|
|
5
|
+
emit(evt: string, ...args: any[]): boolean;
|
|
6
|
+
on(evt: string, fn?: Function): Dispose;
|
|
7
|
+
once(evt: string, fn?: Function): Dispose;
|
|
8
|
+
off(evt: string, fn?: Function): this;
|
|
9
|
+
removeAllListeners(evt?: string): this;
|
|
10
|
+
}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
export declare type Lang = 'zh-CN' | 'en-US';
|
|
2
|
-
declare class I18n {
|
|
3
|
-
data: Record<string, Record<string, string>>;
|
|
4
|
-
currentLang: Lang;
|
|
5
|
-
trans(key: string, lang?: Lang): string;
|
|
6
|
-
add(lang: Lang, transData: Record<string, string>): void;
|
|
7
|
-
setCurrentLang(lang: Lang): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const i18n: I18n;
|
|
10
|
-
export declare const LOADING = "Loading";
|
|
11
|
-
export declare const FACE_THE_SCREEN = "FaceTheScreen";
|
|
12
|
-
export declare const DETECTION_COMPLETED = "DetectionCompleted";
|
|
13
|
-
export declare const WELL_LIT = "WellLit";
|
|
14
|
-
export declare const FACE_PHONE = "FacePhone";
|
|
15
|
-
export declare const DO_NOT_COVER_FACE = "DoNotCoverFace";
|
|
16
|
-
export declare const XHR_ERROR = "XhrError";
|
|
17
|
-
export declare const CHECK_ERROR = "CheckError";
|
|
18
|
-
export declare const CHECK_NET_FAIL = "CheckNetFail";
|
|
19
|
-
export declare const REJECTED = "Rejected";
|
|
20
|
-
export declare const AUTH = "Auth";
|
|
21
|
-
export declare const UNSUPPORT = "Unsupported";
|
|
22
|
-
export declare const NOT_ALLOWED = "NotAllowed";
|
|
23
|
-
export declare const NOT_FOUND = "NotFound";
|
|
24
|
-
export declare const NOT_READABLE = "NotReadable";
|
|
25
|
-
export declare const OVER_CONSTRAINED = "OverConstrained";
|
|
26
|
-
export declare const ABORT = "Abort";
|
|
27
|
-
export declare const PD_FAIL = "PdFail";
|
|
28
|
-
export declare const GET_CONF_NET_FAIL = "GetConfNetFail";
|
|
29
|
-
export declare const GET_CONF_FAIL = "GetConfFail";
|
|
30
|
-
export declare const TIP_EMPTY = "TipEmpty";
|
|
31
|
-
export declare const TIP_MULTIPLE = "TipMultiple";
|
|
32
|
-
export declare const TIP_OUTSIDE = "TipOutside";
|
|
33
|
-
export declare const TIP_CLOSE = "TipClose";
|
|
34
|
-
export declare const TIP_FAR = "TipFar";
|
|
35
|
-
export declare const TIP_LIGHT = "TipLight";
|
|
36
|
-
export declare const TIP_DARK = "TipDark";
|
|
37
|
-
export declare const TIP_ROTATE = "TipRotate";
|
|
38
|
-
export declare const TIP_BLINK = "TipBlink";
|
|
39
|
-
export declare const TIP_MOUTHOPEN = "TipMouthopen";
|
|
40
|
-
export declare const TIP_HEADRIGHT = "TipHeadRight";
|
|
41
|
-
export declare const TIP_HEADLEFT = "TipHeadLeft";
|
|
42
|
-
export declare const TIP_LOOKUP = "TipLookup";
|
|
43
|
-
export declare const TIP_LOOKDOWN = "TipLookdown";
|
|
44
|
-
export declare const TIP_ACTION_OVER = "TipActionOver";
|
|
45
|
-
export declare const TIP_COLOR_READY = "TipColorReady";
|
|
46
|
-
export declare const TIP_COLOR_RUNNING = "TipColorRunning";
|
|
47
|
-
export declare const TIP_OK = "TipOK";
|
|
48
|
-
export declare const TIP_TIMEOUT = "TipTimeout";
|
|
49
|
-
export declare const FAIL_TIP_UNSUPPORTED = "FailTipUnsupported";
|
|
50
|
-
export declare const FAIL_TIP_NOT_ALLOWED = "FailTipNotAllowed";
|
|
51
|
-
export declare const FAIL_TIP_NOT_FOUND = "FailTipNotFound";
|
|
52
|
-
export declare const FAIL_TIP_NOT_READABLE = "FailTipNotReadable";
|
|
53
|
-
export declare const FAIL_TIP_OVER_CONSTRAINED = "FailTipOverConstrained";
|
|
54
|
-
export declare const FAIL_TIP_ABORT = "FailTipAbort";
|
|
55
|
-
export declare const FAIL_TIP_PD_FAIL = "FailTipPDFail";
|
|
56
|
-
export declare const FAIL_TIP_TIMEOUT = "FailTipTimeout";
|
|
57
|
-
export declare const FAIL_TIP_REJECT = "FailTipReject";
|
|
58
|
-
export declare const FAIL_TIP_AUTH = "FailTipAuth";
|
|
59
|
-
export declare const VIDEO_ACTION_OPEN_MOUTH = "VideoActionOpenMouth";
|
|
60
|
-
export declare const VIDEO_ACTION_WINK = "VideoActionWink";
|
|
61
|
-
export declare const VIDEO_TIP_TESING = "VideoTipTesting";
|
|
62
|
-
export declare const VIDEO_TIP_DURATION = "VideoTipDuration";
|
|
63
|
-
export declare const VIDEO_TIP_CAMERA_FAIL = "VideoTipCameraFail";
|
|
64
|
-
export declare const VIDEO_TIP_SELF_RECORD = "VideoTipSelfRecord";
|
|
65
|
-
export declare const VIDEO_TIP_BRIGHTEN_ENV = "VideoTipBrightenEnv";
|
|
66
|
-
export declare const VIDEO_TIP_BLINK_3_5 = "VideoTipBlink35";
|
|
67
|
-
export declare const VIDEO_TIP_OPEN_MOUTH_3_5 = "VideoTipOpenMouth35";
|
|
68
|
-
export declare const VIDEO_TIP_VIDEO_LEN_3_5 = "VideoTipVideoLen35";
|
|
69
|
-
export declare const VIDEO_START_RECORD = "VideoStartRecord";
|
|
70
|
-
export declare const VIDEO_TIP_VIDEO_TOO_LARGE = "VideoTipVideoTooLarge";
|
|
71
|
-
export declare const VIDEO_TIP_VIDEO_USELESS = "VideoTipVideoUseless";
|
|
72
|
-
export {};
|
|
1
|
+
export declare type Lang = 'zh-CN' | 'en-US';
|
|
2
|
+
declare class I18n {
|
|
3
|
+
data: Record<string, Record<string, string>>;
|
|
4
|
+
currentLang: Lang;
|
|
5
|
+
trans(key: string, lang?: Lang): string;
|
|
6
|
+
add(lang: Lang, transData: Record<string, string>): void;
|
|
7
|
+
setCurrentLang(lang: Lang): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const i18n: I18n;
|
|
10
|
+
export declare const LOADING = "Loading";
|
|
11
|
+
export declare const FACE_THE_SCREEN = "FaceTheScreen";
|
|
12
|
+
export declare const DETECTION_COMPLETED = "DetectionCompleted";
|
|
13
|
+
export declare const WELL_LIT = "WellLit";
|
|
14
|
+
export declare const FACE_PHONE = "FacePhone";
|
|
15
|
+
export declare const DO_NOT_COVER_FACE = "DoNotCoverFace";
|
|
16
|
+
export declare const XHR_ERROR = "XhrError";
|
|
17
|
+
export declare const CHECK_ERROR = "CheckError";
|
|
18
|
+
export declare const CHECK_NET_FAIL = "CheckNetFail";
|
|
19
|
+
export declare const REJECTED = "Rejected";
|
|
20
|
+
export declare const AUTH = "Auth";
|
|
21
|
+
export declare const UNSUPPORT = "Unsupported";
|
|
22
|
+
export declare const NOT_ALLOWED = "NotAllowed";
|
|
23
|
+
export declare const NOT_FOUND = "NotFound";
|
|
24
|
+
export declare const NOT_READABLE = "NotReadable";
|
|
25
|
+
export declare const OVER_CONSTRAINED = "OverConstrained";
|
|
26
|
+
export declare const ABORT = "Abort";
|
|
27
|
+
export declare const PD_FAIL = "PdFail";
|
|
28
|
+
export declare const GET_CONF_NET_FAIL = "GetConfNetFail";
|
|
29
|
+
export declare const GET_CONF_FAIL = "GetConfFail";
|
|
30
|
+
export declare const TIP_EMPTY = "TipEmpty";
|
|
31
|
+
export declare const TIP_MULTIPLE = "TipMultiple";
|
|
32
|
+
export declare const TIP_OUTSIDE = "TipOutside";
|
|
33
|
+
export declare const TIP_CLOSE = "TipClose";
|
|
34
|
+
export declare const TIP_FAR = "TipFar";
|
|
35
|
+
export declare const TIP_LIGHT = "TipLight";
|
|
36
|
+
export declare const TIP_DARK = "TipDark";
|
|
37
|
+
export declare const TIP_ROTATE = "TipRotate";
|
|
38
|
+
export declare const TIP_BLINK = "TipBlink";
|
|
39
|
+
export declare const TIP_MOUTHOPEN = "TipMouthopen";
|
|
40
|
+
export declare const TIP_HEADRIGHT = "TipHeadRight";
|
|
41
|
+
export declare const TIP_HEADLEFT = "TipHeadLeft";
|
|
42
|
+
export declare const TIP_LOOKUP = "TipLookup";
|
|
43
|
+
export declare const TIP_LOOKDOWN = "TipLookdown";
|
|
44
|
+
export declare const TIP_ACTION_OVER = "TipActionOver";
|
|
45
|
+
export declare const TIP_COLOR_READY = "TipColorReady";
|
|
46
|
+
export declare const TIP_COLOR_RUNNING = "TipColorRunning";
|
|
47
|
+
export declare const TIP_OK = "TipOK";
|
|
48
|
+
export declare const TIP_TIMEOUT = "TipTimeout";
|
|
49
|
+
export declare const FAIL_TIP_UNSUPPORTED = "FailTipUnsupported";
|
|
50
|
+
export declare const FAIL_TIP_NOT_ALLOWED = "FailTipNotAllowed";
|
|
51
|
+
export declare const FAIL_TIP_NOT_FOUND = "FailTipNotFound";
|
|
52
|
+
export declare const FAIL_TIP_NOT_READABLE = "FailTipNotReadable";
|
|
53
|
+
export declare const FAIL_TIP_OVER_CONSTRAINED = "FailTipOverConstrained";
|
|
54
|
+
export declare const FAIL_TIP_ABORT = "FailTipAbort";
|
|
55
|
+
export declare const FAIL_TIP_PD_FAIL = "FailTipPDFail";
|
|
56
|
+
export declare const FAIL_TIP_TIMEOUT = "FailTipTimeout";
|
|
57
|
+
export declare const FAIL_TIP_REJECT = "FailTipReject";
|
|
58
|
+
export declare const FAIL_TIP_AUTH = "FailTipAuth";
|
|
59
|
+
export declare const VIDEO_ACTION_OPEN_MOUTH = "VideoActionOpenMouth";
|
|
60
|
+
export declare const VIDEO_ACTION_WINK = "VideoActionWink";
|
|
61
|
+
export declare const VIDEO_TIP_TESING = "VideoTipTesting";
|
|
62
|
+
export declare const VIDEO_TIP_DURATION = "VideoTipDuration";
|
|
63
|
+
export declare const VIDEO_TIP_CAMERA_FAIL = "VideoTipCameraFail";
|
|
64
|
+
export declare const VIDEO_TIP_SELF_RECORD = "VideoTipSelfRecord";
|
|
65
|
+
export declare const VIDEO_TIP_BRIGHTEN_ENV = "VideoTipBrightenEnv";
|
|
66
|
+
export declare const VIDEO_TIP_BLINK_3_5 = "VideoTipBlink35";
|
|
67
|
+
export declare const VIDEO_TIP_OPEN_MOUTH_3_5 = "VideoTipOpenMouth35";
|
|
68
|
+
export declare const VIDEO_TIP_VIDEO_LEN_3_5 = "VideoTipVideoLen35";
|
|
69
|
+
export declare const VIDEO_START_RECORD = "VideoStartRecord";
|
|
70
|
+
export declare const VIDEO_TIP_VIDEO_TOO_LARGE = "VideoTipVideoTooLarge";
|
|
71
|
+
export declare const VIDEO_TIP_VIDEO_USELESS = "VideoTipVideoUseless";
|
|
72
|
+
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export declare function adsorb(n: number, lower?: number, upper?: number): number;
|
|
2
|
-
export declare function field2Value(obj: Record<string, [string | number, string]>, val: string | number): null;
|
|
3
|
-
export declare function safeJsonParse(source: string, defaultVal?: any): any;
|
|
4
|
-
export declare function getApiUrl(url?: string): string | undefined;
|
|
5
|
-
export declare function decimalNum(num: string | number, decimal: number): string | undefined;
|
|
6
|
-
export declare function parseURL(url: string): {
|
|
7
|
-
source?: undefined;
|
|
8
|
-
protocol?: undefined;
|
|
9
|
-
host?: undefined;
|
|
10
|
-
port?: undefined;
|
|
11
|
-
query?: undefined;
|
|
12
|
-
hash?: undefined;
|
|
13
|
-
path?: undefined;
|
|
14
|
-
segments?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
source: string;
|
|
17
|
-
protocol: string;
|
|
18
|
-
host: string;
|
|
19
|
-
port: string;
|
|
20
|
-
query: string;
|
|
21
|
-
hash: string;
|
|
22
|
-
path: string;
|
|
23
|
-
segments: string[];
|
|
24
|
-
};
|
|
1
|
+
export declare function adsorb(n: number, lower?: number, upper?: number): number;
|
|
2
|
+
export declare function field2Value(obj: Record<string, [string | number, string]>, val: string | number): null;
|
|
3
|
+
export declare function safeJsonParse(source: string, defaultVal?: any): any;
|
|
4
|
+
export declare function getApiUrl(url?: string): string | undefined;
|
|
5
|
+
export declare function decimalNum(num: string | number, decimal: number): string | undefined;
|
|
6
|
+
export declare function parseURL(url: string): {
|
|
7
|
+
source?: undefined;
|
|
8
|
+
protocol?: undefined;
|
|
9
|
+
host?: undefined;
|
|
10
|
+
port?: undefined;
|
|
11
|
+
query?: undefined;
|
|
12
|
+
hash?: undefined;
|
|
13
|
+
path?: undefined;
|
|
14
|
+
segments?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
source: string;
|
|
17
|
+
protocol: string;
|
|
18
|
+
host: string;
|
|
19
|
+
port: string;
|
|
20
|
+
query: string;
|
|
21
|
+
hash: string;
|
|
22
|
+
path: string;
|
|
23
|
+
segments: string[];
|
|
24
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function isString(o: any): o is string;
|
|
2
|
-
export declare function isBool(o: any): o is boolean;
|
|
3
|
-
export declare function isFunction(o: any): o is Function;
|
|
4
|
-
export declare function isNumber(o: any): o is number;
|
|
5
|
-
export declare function isHTMLElement(o: any): o is HTMLElement;
|
|
6
|
-
export declare function isEmptyArray<T>(array: T[]): boolean;
|
|
7
|
-
export declare function isLetterWithNum(str: string): boolean;
|
|
1
|
+
export declare function isString(o: any): o is string;
|
|
2
|
+
export declare function isBool(o: any): o is boolean;
|
|
3
|
+
export declare function isFunction(o: any): o is Function;
|
|
4
|
+
export declare function isNumber(o: any): o is number;
|
|
5
|
+
export declare function isHTMLElement(o: any): o is HTMLElement;
|
|
6
|
+
export declare function isEmptyArray<T>(array: T[]): boolean;
|
|
7
|
+
export declare function isLetterWithNum(str: string): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare type LogType = 'info' | 'warn' | 'error';
|
|
2
|
-
export declare const logerPrefix = "[NELiveDetection]";
|
|
3
|
-
declare const _: {
|
|
4
|
-
log(type: LogType, msg: string): void;
|
|
5
|
-
warn(msg: string): void;
|
|
6
|
-
error(msg: string): void;
|
|
7
|
-
assert(condition: boolean, msg: string, hook: (msg: string) => any): void;
|
|
8
|
-
};
|
|
9
|
-
export default _;
|
|
1
|
+
export declare type LogType = 'info' | 'warn' | 'error';
|
|
2
|
+
export declare const logerPrefix = "[NELiveDetection]";
|
|
3
|
+
declare const _: {
|
|
4
|
+
log(type: LogType, msg: string): void;
|
|
5
|
+
warn(msg: string): void;
|
|
6
|
+
error(msg: string): void;
|
|
7
|
+
assert(condition: boolean, msg: string, hook: (msg: string) => any): void;
|
|
8
|
+
};
|
|
9
|
+
export default _;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
3
|
-
method?: 'get' | 'post';
|
|
4
|
-
timeout?: number;
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export interface CreateRequestOptions {
|
|
2
|
+
apiServer: string;
|
|
3
|
+
method?: 'get' | 'post';
|
|
4
|
+
timeout?: number;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface RequestOptions extends CreateRequestOptions {
|
|
8
|
+
url: string;
|
|
9
|
+
data?: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
declare function createRequest(baseOpts: CreateRequestOptions, netCollector?: Function): <T>(opts: Omit<RequestOptions, 'apiServer'>, callback?: Function) => Promise<T>;
|
|
12
|
+
export { createRequest };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yidun/livedetect-sdk-h5",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "活体检测 H5",
|
|
5
5
|
"main": "dist/NELiveDetection.umd.js",
|
|
6
6
|
"module": "dist/es/NELiveDetection.esm.js",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"enquirer": "^2.3.6",
|
|
78
78
|
"eslint": "^8.13.0",
|
|
79
79
|
"eslint-config-xo": "^0.40.0",
|
|
80
|
-
"eslint-config-xo-typescript": "^0.
|
|
80
|
+
"eslint-config-xo-typescript": "^0.57.0",
|
|
81
81
|
"execa": "^5.1.1",
|
|
82
82
|
"fs-extra": "^10.0.0",
|
|
83
83
|
"husky": "^7.0.4",
|
|
@@ -107,6 +107,9 @@
|
|
|
107
107
|
"typescript": "^4.6.3"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@yidun/snaker": "^0.4.
|
|
110
|
+
"@yidun/snaker": "^0.4.3"
|
|
111
|
+
},
|
|
112
|
+
"volta": {
|
|
113
|
+
"node": "14.21.3"
|
|
111
114
|
}
|
|
112
115
|
}
|
|
File without changes
|