id-scanner-lib 1.3.3 → 1.5.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 (101) hide show
  1. package/README.md +55 -460
  2. package/dist/id-scanner-lib.esm.js +4641 -0
  3. package/dist/id-scanner-lib.esm.js.map +1 -0
  4. package/dist/id-scanner-lib.js +14755 -0
  5. package/dist/id-scanner-lib.js.map +1 -0
  6. package/dist/types/core/base-module.d.ts +44 -0
  7. package/dist/types/core/camera-manager.d.ts +258 -0
  8. package/dist/types/core/config.d.ts +88 -0
  9. package/dist/types/core/errors.d.ts +111 -0
  10. package/dist/types/core/event-emitter.d.ts +55 -0
  11. package/dist/types/core/logger.d.ts +277 -0
  12. package/dist/types/core/module-manager.d.ts +78 -0
  13. package/dist/types/core/plugin-manager.d.ts +158 -0
  14. package/dist/types/core/resource-manager.d.ts +246 -0
  15. package/dist/types/core/result.d.ts +83 -0
  16. package/dist/types/core/scanner-factory.d.ts +93 -0
  17. package/dist/types/index.bundle.d.ts +1303 -0
  18. package/dist/types/index.d.ts +86 -0
  19. package/dist/types/interfaces/external-types.d.ts +174 -0
  20. package/dist/types/interfaces/face-detection.d.ts +293 -0
  21. package/dist/types/interfaces/scanner-module.d.ts +280 -0
  22. package/dist/types/modules/face/face-detector.d.ts +170 -0
  23. package/dist/types/modules/face/index.d.ts +56 -0
  24. package/dist/types/modules/face/liveness-detector.d.ts +177 -0
  25. package/dist/types/modules/face/types.d.ts +136 -0
  26. package/dist/types/modules/id-card/anti-fake-detector.d.ts +170 -0
  27. package/dist/types/modules/id-card/id-card-detector.d.ts +131 -0
  28. package/dist/types/modules/id-card/index.d.ts +89 -0
  29. package/dist/types/modules/id-card/ocr-processor.d.ts +110 -0
  30. package/dist/types/modules/id-card/ocr-worker.d.ts +31 -0
  31. package/dist/types/modules/id-card/types.d.ts +181 -0
  32. package/dist/types/modules/qrcode/index.d.ts +51 -0
  33. package/dist/types/modules/qrcode/qr-code-scanner.d.ts +64 -0
  34. package/dist/types/modules/qrcode/types.d.ts +67 -0
  35. package/dist/types/utils/camera.d.ts +81 -0
  36. package/dist/types/utils/image-processing.d.ts +176 -0
  37. package/dist/types/utils/index.d.ts +175 -0
  38. package/dist/types/utils/performance.d.ts +81 -0
  39. package/dist/types/utils/resource-manager.d.ts +53 -0
  40. package/dist/types/utils/types.d.ts +166 -0
  41. package/dist/types/utils/worker.d.ts +52 -0
  42. package/dist/types/version.d.ts +7 -0
  43. package/package.json +76 -75
  44. package/src/core/base-module.ts +78 -0
  45. package/src/core/camera-manager.ts +798 -0
  46. package/src/core/config.ts +268 -0
  47. package/src/core/errors.ts +174 -0
  48. package/src/core/event-emitter.ts +110 -0
  49. package/src/core/logger.ts +549 -0
  50. package/src/core/module-manager.ts +165 -0
  51. package/src/core/plugin-manager.ts +429 -0
  52. package/src/core/resource-manager.ts +762 -0
  53. package/src/core/result.ts +163 -0
  54. package/src/core/scanner-factory.ts +237 -0
  55. package/src/index.ts +113 -936
  56. package/src/interfaces/external-types.ts +200 -0
  57. package/src/interfaces/face-detection.ts +309 -0
  58. package/src/interfaces/scanner-module.ts +384 -0
  59. package/src/modules/face/face-detector.ts +931 -0
  60. package/src/modules/face/index.ts +208 -0
  61. package/src/modules/face/liveness-detector.ts +908 -0
  62. package/src/modules/face/types.ts +133 -0
  63. package/src/{id-recognition → modules/id-card}/anti-fake-detector.ts +273 -239
  64. package/src/modules/id-card/id-card-detector.ts +474 -0
  65. package/src/modules/id-card/index.ts +425 -0
  66. package/src/{id-recognition → modules/id-card}/ocr-processor.ts +149 -92
  67. package/src/modules/id-card/ocr-worker.ts +259 -0
  68. package/src/modules/id-card/types.ts +178 -0
  69. package/src/modules/qrcode/index.ts +175 -0
  70. package/src/modules/qrcode/qr-code-scanner.ts +230 -0
  71. package/src/modules/qrcode/types.ts +65 -0
  72. package/src/types/tesseract.d.ts +265 -22
  73. package/src/utils/image-processing.ts +68 -49
  74. package/src/utils/index.ts +426 -0
  75. package/src/utils/performance.ts +168 -131
  76. package/src/utils/resource-manager.ts +65 -146
  77. package/src/utils/types.ts +90 -2
  78. package/src/utils/worker.ts +123 -84
  79. package/src/version.ts +11 -0
  80. package/tools/scaffold.js +543 -0
  81. package/dist/id-scanner-core.esm.js +0 -11349
  82. package/dist/id-scanner-core.js +0 -11361
  83. package/dist/id-scanner-core.min.js +0 -1
  84. package/dist/id-scanner-ocr.esm.js +0 -2319
  85. package/dist/id-scanner-ocr.js +0 -2328
  86. package/dist/id-scanner-ocr.min.js +0 -1
  87. package/dist/id-scanner-qr.esm.js +0 -1296
  88. package/dist/id-scanner-qr.js +0 -1305
  89. package/dist/id-scanner-qr.min.js +0 -1
  90. package/dist/id-scanner.js +0 -4561
  91. package/dist/id-scanner.min.js +0 -1
  92. package/src/core.ts +0 -138
  93. package/src/demo/demo.ts +0 -204
  94. package/src/id-recognition/data-extractor.ts +0 -262
  95. package/src/id-recognition/id-detector.ts +0 -510
  96. package/src/id-recognition/ocr-worker.ts +0 -156
  97. package/src/index-umd.ts +0 -477
  98. package/src/ocr-module.ts +0 -187
  99. package/src/qr-module.ts +0 -179
  100. package/src/scanner/barcode-scanner.ts +0 -251
  101. package/src/scanner/qr-scanner.ts +0 -167
@@ -0,0 +1,175 @@
1
+ /**
2
+ * @file 工具集
3
+ * @description 提供通用工具函数
4
+ * @module utils
5
+ */
6
+ /**
7
+ * 创建延迟Promise
8
+ * @param ms 延迟毫秒数
9
+ */
10
+ export declare function delay(ms: number): Promise<void>;
11
+ /**
12
+ * 节流函数
13
+ * @param fn 要节流的函数
14
+ * @param wait 等待时间(ms)
15
+ */
16
+ export declare function throttle<T extends (...args: any[]) => any>(fn: T, wait: number): (...args: Parameters<T>) => ReturnType<T> | undefined;
17
+ /**
18
+ * 防抖函数
19
+ * @param fn 要防抖的函数
20
+ * @param wait 等待时间(ms)
21
+ * @param immediate 是否立即执行
22
+ */
23
+ export declare function debounce<T extends (...args: any[]) => any>(fn: T, wait: number, immediate?: boolean): (...args: Parameters<T>) => void;
24
+ /**
25
+ * 格式化字节大小
26
+ * @param bytes 字节数
27
+ * @param decimals 小数位数
28
+ */
29
+ export declare function formatBytes(bytes: number, decimals?: number): string;
30
+ /**
31
+ * 生成UUID
32
+ */
33
+ export declare function generateUUID(): string;
34
+ /**
35
+ * 检查浏览器支持的功能
36
+ */
37
+ export declare const browserCapabilities: {
38
+ /**
39
+ * 检查是否支持摄像头
40
+ */
41
+ hasCamera(): boolean;
42
+ /**
43
+ * 检查是否支持WebAssembly
44
+ */
45
+ hasWasm(): boolean;
46
+ /**
47
+ * 检查是否支持WebWorker
48
+ */
49
+ hasWebWorker(): boolean;
50
+ /**
51
+ * 检查是否支持WebGL
52
+ */
53
+ hasWebGL(): boolean;
54
+ /**
55
+ * 检查是否支持SharedArrayBuffer
56
+ */
57
+ hasSharedArrayBuffer(): boolean;
58
+ /**
59
+ * 检查是否支持特定的功能
60
+ * @param feature 功能名称
61
+ */
62
+ supports(feature: string): boolean;
63
+ };
64
+ /**
65
+ * 数组分块
66
+ * @param array 要分块的数组
67
+ * @param chunkSize 每块大小
68
+ */
69
+ export declare function chunk<T>(array: T[], chunkSize: number): T[][];
70
+ /**
71
+ * 安全解析JSON
72
+ * @param text JSON字符串
73
+ * @param fallback 解析失败时的默认值
74
+ */
75
+ export declare function safeParseJSON<T = any>(text: string, fallback: T): T;
76
+ /**
77
+ * 限制值在指定范围内
78
+ * @param value 要限制的值
79
+ * @param min 最小值
80
+ * @param max 最大值
81
+ */
82
+ export declare function clamp(value: number, min: number, max: number): number;
83
+ /**
84
+ * 等待加载图片
85
+ * @param url 图片URL
86
+ */
87
+ export declare function loadImage(url: string): Promise<HTMLImageElement>;
88
+ /**
89
+ * 将Blob转换为Base64
90
+ * @param blob Blob对象
91
+ */
92
+ export declare function blobToBase64(blob: Blob): Promise<string>;
93
+ /**
94
+ * 将Base64转换为Blob
95
+ * @param base64 Base64字符串
96
+ * @param contentType 内容类型
97
+ */
98
+ export declare function base64ToBlob(base64: string, contentType?: string): Blob;
99
+ /**
100
+ * 获取媒体约束
101
+ * @param width 宽度
102
+ * @param height 高度
103
+ * @param facingMode 前后置摄像头
104
+ * @param frameRate 帧率
105
+ */
106
+ export declare function getMediaConstraints(width?: number, height?: number, facingMode?: 'user' | 'environment', frameRate?: number): MediaStreamConstraints;
107
+ /**
108
+ * 检查URL是否有效
109
+ * @param url 要检查的URL
110
+ */
111
+ export declare function isValidUrl(url: string): boolean;
112
+ /**
113
+ * DOM帮助函数
114
+ */
115
+ export declare const dom: {
116
+ /**
117
+ * 创建元素
118
+ * @param tag 标签名
119
+ * @param attributes 属性
120
+ * @param children 子元素
121
+ */
122
+ createElement<K extends keyof HTMLElementTagNameMap>(tag: K, attributes?: Record<string, any>, children?: (string | Node)[]): HTMLElementTagNameMap[K];
123
+ /**
124
+ * 查找元素
125
+ * @param selector 选择器
126
+ * @param parent 父元素
127
+ */
128
+ find<E extends Element = Element>(selector: string, parent?: Document | Element): E | null;
129
+ /**
130
+ * 查找所有元素
131
+ * @param selector 选择器
132
+ * @param parent 父元素
133
+ */
134
+ findAll<E_1 extends Element = Element>(selector: string, parent?: Document | Element): E_1[];
135
+ /**
136
+ * 添加事件监听器
137
+ * @param element 元素
138
+ * @param event 事件名称
139
+ * @param handler 处理函数
140
+ * @param options 选项
141
+ */
142
+ on<K_1 extends keyof HTMLElementEventMap>(element: HTMLElement, event: K_1, handler: (event: HTMLElementEventMap[K_1]) => any, options?: AddEventListenerOptions): void;
143
+ /**
144
+ * 移除事件监听器
145
+ * @param element 元素
146
+ * @param event 事件名称
147
+ * @param handler 处理函数
148
+ * @param options 选项
149
+ */
150
+ off<K_2 extends keyof HTMLElementEventMap>(element: HTMLElement, event: K_2, handler: (event: HTMLElementEventMap[K_2]) => any, options?: EventListenerOptions): void;
151
+ /**
152
+ * 设置样式
153
+ * @param element 元素
154
+ * @param styles 样式对象
155
+ */
156
+ setStyles(element: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
157
+ /**
158
+ * 添加类名
159
+ * @param element 元素
160
+ * @param classNames 类名
161
+ */
162
+ addClass(element: HTMLElement, ...classNames: string[]): void;
163
+ /**
164
+ * 移除类名
165
+ * @param element 元素
166
+ * @param classNames 类名
167
+ */
168
+ removeClass(element: HTMLElement, ...classNames: string[]): void;
169
+ /**
170
+ * 判断是否包含类名
171
+ * @param element 元素
172
+ * @param className 类名
173
+ */
174
+ hasClass(element: HTMLElement, className: string): boolean;
175
+ };
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @file 性能优化工具
3
+ * @description 提供性能优化相关的工具函数
4
+ * @module utils/performance
5
+ */
6
+ /**
7
+ * LRU缓存实现
8
+ */
9
+ export declare class LRUCache<K, V> {
10
+ private capacity;
11
+ private cache;
12
+ /**
13
+ * 构造函数
14
+ * @param capacity 缓存容量
15
+ */
16
+ constructor(capacity?: number);
17
+ /**
18
+ * 获取缓存项
19
+ * @param key 键
20
+ * @returns 值,如果不存在则返回undefined
21
+ */
22
+ get(key: K): V | undefined;
23
+ /**
24
+ * 设置缓存项
25
+ * @param key 键
26
+ * @param value 值
27
+ */
28
+ set(key: K, value: V): void;
29
+ /**
30
+ * 检查键是否存在
31
+ * @param key 键
32
+ * @returns 是否存在
33
+ */
34
+ has(key: K): boolean;
35
+ /**
36
+ * 删除缓存项
37
+ * @param key 键
38
+ * @returns 是否成功删除
39
+ */
40
+ delete(key: K): boolean;
41
+ /**
42
+ * 清空缓存
43
+ */
44
+ clear(): void;
45
+ /**
46
+ * 获取缓存大小
47
+ */
48
+ get size(): number;
49
+ /**
50
+ * 获取所有键
51
+ */
52
+ keys(): IterableIterator<K>;
53
+ /**
54
+ * 获取所有值
55
+ */
56
+ values(): IterableIterator<V>;
57
+ /**
58
+ * 获取所有项
59
+ */
60
+ entries(): IterableIterator<[K, V]>;
61
+ }
62
+ /**
63
+ * 计算图像指纹
64
+ * @param imageData 图像数据
65
+ * @returns 图像指纹
66
+ */
67
+ export declare function calculateImageFingerprint(imageData: ImageData): string;
68
+ /**
69
+ * 防抖函数
70
+ * @param func 要执行的函数
71
+ * @param wait 等待时间(毫秒)
72
+ * @returns 防抖处理后的函数
73
+ */
74
+ export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
75
+ /**
76
+ * 节流函数
77
+ * @param func 要执行的函数
78
+ * @param limit 时间限制(毫秒)
79
+ * @returns 节流处理后的函数
80
+ */
81
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @file 资源管理器
3
+ * @description 提供资源管理和释放功能
4
+ * @module utils/resource-manager
5
+ */
6
+ /**
7
+ * 可释放资源接口
8
+ */
9
+ export interface Disposable {
10
+ /** 释放资源 */
11
+ dispose(): Promise<void> | void;
12
+ }
13
+ /**
14
+ * 资源管理器类
15
+ * 用于管理和自动释放资源
16
+ */
17
+ export declare class ResourceManager {
18
+ private resources;
19
+ /**
20
+ * 注册资源
21
+ * @param resource 可释放资源
22
+ * @returns 资源本身,便于链式调用
23
+ */
24
+ register<T extends Disposable>(resource: T): T;
25
+ /**
26
+ * 释放指定资源
27
+ * @param resource 要释放的资源
28
+ * @returns 是否成功释放
29
+ */
30
+ release(resource: Disposable): Promise<boolean>;
31
+ /**
32
+ * 释放所有资源
33
+ */
34
+ releaseAll(): Promise<void>;
35
+ /**
36
+ * 获取当前管理的资源数量
37
+ */
38
+ get count(): number;
39
+ }
40
+ /**
41
+ * 创建一个自动释放的资源
42
+ * @param factory 资源工厂函数
43
+ * @param disposeCallback 释放回调函数
44
+ * @returns 创建的资源
45
+ */
46
+ export declare function createDisposable<T>(factory: () => T, disposeCallback: (resource: T) => Promise<void> | void): T & Disposable;
47
+ /**
48
+ * 使用资源并自动释放
49
+ * @param resource 可释放资源
50
+ * @param callback 使用资源的回调函数
51
+ * @returns 回调函数的返回值
52
+ */
53
+ export declare function using<T extends Disposable, R>(resource: T, callback: (resource: T) => Promise<R> | R): Promise<R>;
@@ -0,0 +1,166 @@
1
+ /**
2
+ * @file 类型定义文件
3
+ * @description 定义全局类型
4
+ * @module Types
5
+ */
6
+ /**
7
+ * 身份证检测结果接口
8
+ *
9
+ * 包含身份证检测的结果信息,如是否成功检测到身份证、身份证的四个角点坐标以及裁剪后的身份证图像
10
+ *
11
+ * @interface DetectionResult
12
+ * @property {boolean} success - 是否成功检测到身份证
13
+ * @property {Object[]} [corners] - 检测到的身份证四个角点坐标
14
+ * @property {number} corners[].x - 角点X坐标
15
+ * @property {number} corners[].y - 角点Y坐标
16
+ * @property {ImageData} [croppedImage] - 裁剪后的身份证图像
17
+ * @property {ImageData} [imageData] - 原始图像数据
18
+ * @property {Object} [boundingBox] - 检测到的身份证边界框
19
+ * @property {number} boundingBox.x - 边界框左上角X坐标
20
+ * @property {number} boundingBox.y - 边界框左上角Y坐标
21
+ * @property {number} boundingBox.width - 边界框宽度
22
+ * @property {number} boundingBox.height - 边界框高度
23
+ * @property {number} [confidence] - 检测结果的置信度
24
+ * @property {string} [message] - 检测结果的消息
25
+ */
26
+ export interface DetectionResult {
27
+ success: boolean;
28
+ corners?: {
29
+ x: number;
30
+ y: number;
31
+ }[];
32
+ croppedImage?: ImageData;
33
+ imageData?: ImageData;
34
+ boundingBox?: {
35
+ x: number;
36
+ y: number;
37
+ width: number;
38
+ height: number;
39
+ };
40
+ confidence?: number;
41
+ message?: string;
42
+ }
43
+ /**
44
+ * 身份证信息接口
45
+ *
46
+ * 包含从身份证中提取的各项个人信息
47
+ *
48
+ * @interface IDCardInfo
49
+ * @property {string} [name] - 姓名
50
+ * @property {string} [gender] - 性别
51
+ * @property {string} [nationality] - 民族
52
+ * @property {string} [birthDate] - 出生日期
53
+ * @property {string} [address] - 地址
54
+ * @property {string} [idNumber] - 身份证号码
55
+ * @property {string} [issuingAuthority] - 签发机关
56
+ * @property {string} [validPeriod] - 有效期限
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * // 身份证信息示例
61
+ * const idInfo: IDCardInfo = {
62
+ * name: '张三',
63
+ * gender: '男',
64
+ * nationality: '汉族',
65
+ * birthDate: '1990-01-01',
66
+ * address: '北京市海淀区xxxxx',
67
+ * idNumber: '110101199001011234',
68
+ * issuingAuthority: '北京市公安局海淀分局',
69
+ * validPeriod: '2020.01.01-2040.01.01'
70
+ * };
71
+ * ```
72
+ */
73
+ export interface IDCardInfo {
74
+ /** 姓名 */
75
+ name?: string;
76
+ /** 性别 */
77
+ gender?: string;
78
+ /** 民族 */
79
+ ethnicity?: string;
80
+ /** 出生日期 */
81
+ birthDate?: string;
82
+ /** 地址 */
83
+ address?: string;
84
+ /** 身份证号码 */
85
+ idNumber?: string;
86
+ /** 签发机关 */
87
+ issueAuthority?: string;
88
+ /** 有效期起始日期 */
89
+ validFrom?: string;
90
+ /** 有效期截止日期 */
91
+ validTo?: string;
92
+ /** 有效期限(完整文本) */
93
+ validPeriod?: string;
94
+ /** 照片区域 */
95
+ photoRegion?: {
96
+ x: number;
97
+ y: number;
98
+ width: number;
99
+ height: number;
100
+ };
101
+ /** 类型 */
102
+ type?: string;
103
+ /** 置信度 */
104
+ confidence?: number;
105
+ /** 其他属性 */
106
+ [key: string]: any;
107
+ }
108
+ /**
109
+ * 点坐标
110
+ */
111
+ export interface Point {
112
+ x: number;
113
+ y: number;
114
+ }
115
+ /**
116
+ * 矩形区域
117
+ */
118
+ export interface Rect {
119
+ x: number;
120
+ y: number;
121
+ width: number;
122
+ height: number;
123
+ }
124
+ /**
125
+ * 可释放资源接口
126
+ */
127
+ export interface Disposable {
128
+ /** 释放资源 */
129
+ dispose(): Promise<void>;
130
+ }
131
+ /**
132
+ * 图像处理选项
133
+ */
134
+ export interface ImageProcessingOptions {
135
+ /** 亮度调整 (-100 到 100) */
136
+ brightness?: number;
137
+ /** 对比度调整 (-100 到 100) */
138
+ contrast?: number;
139
+ /** 饱和度调整 (-100 到 100) */
140
+ saturation?: number;
141
+ /** 锐化强度 (0 到 10) */
142
+ sharpen?: number | boolean;
143
+ /** 高斯模糊半径 (0 到 10) */
144
+ blur?: number;
145
+ /** 是否应用灰度转换 */
146
+ grayscale?: boolean;
147
+ /** 是否应用二值化 */
148
+ binarize?: boolean;
149
+ /** 二值化阈值 (0 到 255) */
150
+ threshold?: number;
151
+ /** 是否应用边缘检测 */
152
+ edgeDetection?: boolean;
153
+ /** 是否应用降噪 */
154
+ denoise?: boolean;
155
+ /** 是否应用直方图均衡化 */
156
+ histogramEqualization?: boolean;
157
+ /** 是否应用透视校正 */
158
+ perspectiveCorrection?: boolean;
159
+ /** 透视校正点 */
160
+ perspectivePoints?: {
161
+ topLeft: Point;
162
+ topRight: Point;
163
+ bottomRight: Point;
164
+ bottomLeft: Point;
165
+ };
166
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @file Worker工具
3
+ * @description 提供Web Worker相关的工具函数
4
+ * @module utils/worker
5
+ */
6
+ /**
7
+ * 检查是否支持Web Worker
8
+ * @returns 是否支持Web Worker
9
+ */
10
+ export declare function isWorkerSupported(): boolean;
11
+ /**
12
+ * 创建Worker
13
+ * @param workerFunction Worker函数
14
+ * @returns Worker实例
15
+ */
16
+ export declare function createWorker<TInput, TOutput>(workerFunction: (input: TInput) => TOutput | Promise<TOutput>): {
17
+ postMessage: (input: TInput) => Promise<TOutput>;
18
+ terminate: () => void;
19
+ };
20
+ /**
21
+ * 工作线程池
22
+ * 用于管理和重用Worker线程,避免频繁创建和销毁
23
+ */
24
+ export declare class WorkerPool<T, R> {
25
+ private workerFunction;
26
+ private size;
27
+ private workers;
28
+ /**
29
+ * 创建工作线程池
30
+ *
31
+ * @param workerFunction 要在Worker中执行的函数
32
+ * @param size 池中Worker的数量
33
+ */
34
+ constructor(workerFunction: (data: T) => Promise<R> | R, size?: number);
35
+ /**
36
+ * 获取一个可用的Worker
37
+ *
38
+ * @returns Worker包装对象
39
+ */
40
+ private getAvailableWorker;
41
+ /**
42
+ * 执行任务
43
+ *
44
+ * @param data 要处理的数据
45
+ * @returns 处理结果的Promise
46
+ */
47
+ execute(data: T): Promise<R>;
48
+ /**
49
+ * 终止所有Worker
50
+ */
51
+ terminate(): void;
52
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @file 版本号文件
3
+ * @description 定义库的版本号
4
+ * @module Version
5
+ */
6
+ export declare const VERSION = "1.5.0";
7
+ export declare const BUILD_DATE: string;