@yidun/livedetect-sdk-h5 2.1.0 → 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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RequestOptions } from './utils/request';
|
|
1
2
|
import type { Options } from './types';
|
|
2
3
|
import type { Dispose } from './utils/dispose';
|
|
3
4
|
import { EventEmitter } from './utils/eventmitter';
|
|
@@ -14,6 +15,7 @@ declare class NELiveDetection extends EventEmitter implements Dispose {
|
|
|
14
15
|
el: HTMLElement;
|
|
15
16
|
readonly collector: Collector;
|
|
16
17
|
readonly netCollector: Collector;
|
|
18
|
+
readonly request: <T>(opts: Omit<RequestOptions, 'apiServer'>, callback?: Function) => Promise<T>;
|
|
17
19
|
readonly tip: Tip;
|
|
18
20
|
readonly camera: Camera;
|
|
19
21
|
readonly progress: Progress;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
1
|
+
export interface CreateRequestOptions {
|
|
2
|
+
apiServer: string;
|
|
3
3
|
method?: 'get' | 'post';
|
|
4
4
|
timeout?: number;
|
|
5
5
|
headers?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface RequestOptions extends CreateRequestOptions {
|
|
8
|
+
url: string;
|
|
6
9
|
data?: Record<string, any>;
|
|
7
10
|
}
|
|
8
|
-
declare function
|
|
9
|
-
export {
|
|
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.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "活体检测 H5",
|
|
5
5
|
"main": "dist/NELiveDetection.umd.js",
|
|
6
6
|
"module": "dist/es/NELiveDetection.esm.js",
|
|
@@ -108,5 +108,8 @@
|
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
110
|
"@yidun/snaker": "^0.4.3"
|
|
111
|
+
},
|
|
112
|
+
"volta": {
|
|
113
|
+
"node": "14.21.3"
|
|
111
114
|
}
|
|
112
115
|
}
|