ms-types 0.4.21 → 0.4.23
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/package.json +22 -22
- package/types/action.d.ts +285 -285
- package/types/appleocr.d.ts +102 -102
- package/types/config.d.ts +97 -97
- package/types/cryptoUtils.d.ts +59 -59
- package/types/device.d.ts +117 -117
- package/types/draw.d.ts +98 -98
- package/types/global.d.ts +230 -230
- package/types/hid.d.ts +330 -330
- package/types/hotUpdate.d.ts +104 -104
- package/types/http.d.ts +300 -300
- package/types/ime.d.ts +99 -99
- package/types/index.d.ts +28 -28
- package/types/media.d.ts +101 -101
- package/types/mysql.d.ts +178 -178
- package/types/netCard.d.ts +77 -77
- package/types/node.d.ts +292 -292
- package/types/paddleocr.d.ts +73 -73
- package/types/pip.d.ts +51 -51
- package/types/system.d.ts +196 -225
- package/types/thread.d.ts +42 -42
- package/types/tomatoocr.d.ts +209 -209
- package/types/tts.d.ts +91 -91
- package/types/ui.d.ts +185 -185
- package/types/utils.d.ts +77 -77
- package/types/yolo.d.ts +114 -114
- package/types/zh/HID/346/250/241/345/235/227.d.ts +334 -334
- package/types/zh/HTTP/346/250/241/345/235/227.d.ts +301 -301
- package/types/zh/MySql/346/250/241/345/235/227.d.ts +179 -179
- package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +74 -74
- package/types/zh/YOLO/346/250/241/345/235/227.d.ts +118 -118
- package/types/zh/index.d.ts +25 -25
- package/types/zh//345/205/250/345/261/200/346/250/241/345/235/227.d.ts +220 -220
- package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +287 -287
- package/types/zh//345/215/241/345/257/206/346/250/241/345/235/227.d.ts +90 -90
- package/types/zh//345/252/222/344/275/223/346/250/241/345/235/227.d.ts +102 -102
- package/types/zh//345/267/245/345/205/267/346/250/241/345/235/227.d.ts +77 -77
- package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +55 -55
- package/types/zh//346/226/207/345/255/227/350/275/254/350/257/255/351/237/263/346/250/241/345/235/227.d.ts +92 -92
- package/types/zh//347/203/255/346/233/264/346/226/260/346/250/241/345/235/227.d.ts +105 -105
- package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +196 -225
- package/types/zh//347/272/277/347/250/213/346/250/241/345/235/227.d.ts +43 -43
- package/types/zh//347/273/230/345/233/276/346/250/241/345/235/227.d.ts +100 -98
- package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +290 -290
- package/types/zh//350/213/271/346/236/234OCR.d.ts +104 -104
- package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +90 -90
- package/types/zh//350/256/276/345/244/207/346/250/241/345/235/227.d.ts +118 -118
- package/types/zh//350/276/223/345/205/245/346/263/225/346/250/241/345/235/227.d.ts +100 -100
- package/types/zh//351/205/215/347/275/256/346/250/241/345/235/227.d.ts +99 -99
package/types/utils.d.ts
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 工具模块 包含工具函数等功能
|
|
3
|
-
*/
|
|
4
|
-
declare namespace utils {
|
|
5
|
-
/**
|
|
6
|
-
* 格式化时间
|
|
7
|
-
* @param format 格式化字符串
|
|
8
|
-
* @returns 格式化后的时间字符串
|
|
9
|
-
* @example
|
|
10
|
-
* utils.timeFormat("yyyy-MM-dd hh:mm:ss")
|
|
11
|
-
*/
|
|
12
|
-
function timeFormat(format: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* 生成随机数
|
|
15
|
-
* @param min 最小值
|
|
16
|
-
* @param max 最大值
|
|
17
|
-
* @returns 随机数
|
|
18
|
-
* @example
|
|
19
|
-
* utils.random(1, 10)
|
|
20
|
-
*/
|
|
21
|
-
function random(min: number, max: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* 生成随机UUID
|
|
24
|
-
* @returns 随机UUID字符串
|
|
25
|
-
* @example
|
|
26
|
-
* utils.randomUUID()
|
|
27
|
-
*/
|
|
28
|
-
function randomUUID(): string;
|
|
29
|
-
/**
|
|
30
|
-
* 将应用置入前台
|
|
31
|
-
* @example
|
|
32
|
-
* utils.takeMeToFront()
|
|
33
|
-
*/
|
|
34
|
-
function takeMeToFront(): boolean;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* str转 hex 字符串
|
|
38
|
-
* @param source 字符串
|
|
39
|
-
* @returns hex字符串
|
|
40
|
-
* @example
|
|
41
|
-
* utils.hexString("hello")
|
|
42
|
-
*/
|
|
43
|
-
function hexString(source: string): string;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 字符串转base64
|
|
47
|
-
* @param source 字符串
|
|
48
|
-
* @returns base64字符串
|
|
49
|
-
* @example
|
|
50
|
-
* utils.base64Encoded("hello")
|
|
51
|
-
*/
|
|
52
|
-
function base64Encoded(source: string): string;
|
|
53
|
-
/**
|
|
54
|
-
* base64转字符串
|
|
55
|
-
* @param source base64字符串
|
|
56
|
-
* @returns 字符串
|
|
57
|
-
* @example
|
|
58
|
-
* utils.base64Decoded("aGVsbG8=")
|
|
59
|
-
*/
|
|
60
|
-
function base64Decoded(source: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* 16进制字符串转 base64
|
|
63
|
-
* @param hexString 16进制字符串
|
|
64
|
-
* @returns base64字符串
|
|
65
|
-
* @example
|
|
66
|
-
* utils.hexStringBase64Encoded("68656c6c6f")
|
|
67
|
-
*/
|
|
68
|
-
function hexStringBase64Encoded(hexString: string): string;
|
|
69
|
-
/**
|
|
70
|
-
* base64 转 16进制字符串
|
|
71
|
-
* @param base64HexString base64字符串
|
|
72
|
-
* @returns 16进制字符串
|
|
73
|
-
* @example
|
|
74
|
-
* utils.hexStringBase64Decoded("aGVsbG8=")
|
|
75
|
-
*/
|
|
76
|
-
function hexStringBase64Decoded(base64HexString: string): string;
|
|
77
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 工具模块 包含工具函数等功能
|
|
3
|
+
*/
|
|
4
|
+
declare namespace utils {
|
|
5
|
+
/**
|
|
6
|
+
* 格式化时间
|
|
7
|
+
* @param format 格式化字符串
|
|
8
|
+
* @returns 格式化后的时间字符串
|
|
9
|
+
* @example
|
|
10
|
+
* utils.timeFormat("yyyy-MM-dd hh:mm:ss")
|
|
11
|
+
*/
|
|
12
|
+
function timeFormat(format: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* 生成随机数
|
|
15
|
+
* @param min 最小值
|
|
16
|
+
* @param max 最大值
|
|
17
|
+
* @returns 随机数
|
|
18
|
+
* @example
|
|
19
|
+
* utils.random(1, 10)
|
|
20
|
+
*/
|
|
21
|
+
function random(min: number, max: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* 生成随机UUID
|
|
24
|
+
* @returns 随机UUID字符串
|
|
25
|
+
* @example
|
|
26
|
+
* utils.randomUUID()
|
|
27
|
+
*/
|
|
28
|
+
function randomUUID(): string;
|
|
29
|
+
/**
|
|
30
|
+
* 将应用置入前台
|
|
31
|
+
* @example
|
|
32
|
+
* utils.takeMeToFront()
|
|
33
|
+
*/
|
|
34
|
+
function takeMeToFront(): boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* str转 hex 字符串
|
|
38
|
+
* @param source 字符串
|
|
39
|
+
* @returns hex字符串
|
|
40
|
+
* @example
|
|
41
|
+
* utils.hexString("hello")
|
|
42
|
+
*/
|
|
43
|
+
function hexString(source: string): string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 字符串转base64
|
|
47
|
+
* @param source 字符串
|
|
48
|
+
* @returns base64字符串
|
|
49
|
+
* @example
|
|
50
|
+
* utils.base64Encoded("hello")
|
|
51
|
+
*/
|
|
52
|
+
function base64Encoded(source: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* base64转字符串
|
|
55
|
+
* @param source base64字符串
|
|
56
|
+
* @returns 字符串
|
|
57
|
+
* @example
|
|
58
|
+
* utils.base64Decoded("aGVsbG8=")
|
|
59
|
+
*/
|
|
60
|
+
function base64Decoded(source: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* 16进制字符串转 base64
|
|
63
|
+
* @param hexString 16进制字符串
|
|
64
|
+
* @returns base64字符串
|
|
65
|
+
* @example
|
|
66
|
+
* utils.hexStringBase64Encoded("68656c6c6f")
|
|
67
|
+
*/
|
|
68
|
+
function hexStringBase64Encoded(hexString: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* base64 转 16进制字符串
|
|
71
|
+
* @param base64HexString base64字符串
|
|
72
|
+
* @returns 16进制字符串
|
|
73
|
+
* @example
|
|
74
|
+
* utils.hexStringBase64Decoded("aGVsbG8=")
|
|
75
|
+
*/
|
|
76
|
+
function hexStringBase64Decoded(base64HexString: string): string;
|
|
77
|
+
}
|
package/types/yolo.d.ts
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* YOLO目标检测模块 包含加载模型、目标检测等功能
|
|
3
|
-
*/
|
|
4
|
-
declare namespace yolo {
|
|
5
|
-
/**
|
|
6
|
-
* YOLO检测结果
|
|
7
|
-
*/
|
|
8
|
-
interface YoloResult {
|
|
9
|
-
/**
|
|
10
|
-
* 检测框的左上角x坐标
|
|
11
|
-
*/
|
|
12
|
-
x: number;
|
|
13
|
-
/**
|
|
14
|
-
* 检测框的左上角y坐标
|
|
15
|
-
*/
|
|
16
|
-
y: number;
|
|
17
|
-
/**
|
|
18
|
-
* 检测框的右下角x坐标
|
|
19
|
-
*/
|
|
20
|
-
ex: number;
|
|
21
|
-
/**
|
|
22
|
-
* 检测框的右下角y坐标
|
|
23
|
-
*/
|
|
24
|
-
ey: number;
|
|
25
|
-
/**
|
|
26
|
-
* 检测框的中心点x坐标
|
|
27
|
-
*/
|
|
28
|
-
centerX: number;
|
|
29
|
-
/**
|
|
30
|
-
* 检测框的中心点y坐标
|
|
31
|
-
*/
|
|
32
|
-
centerY: number;
|
|
33
|
-
/**
|
|
34
|
-
* 检测框的宽度
|
|
35
|
-
*/
|
|
36
|
-
width: number;
|
|
37
|
-
/**
|
|
38
|
-
* 检测框的高度
|
|
39
|
-
*/
|
|
40
|
-
height: number;
|
|
41
|
-
/**
|
|
42
|
-
* 检测框的置信度
|
|
43
|
-
*/
|
|
44
|
-
confidence: number;
|
|
45
|
-
/**
|
|
46
|
-
* 检测框的类别ID
|
|
47
|
-
*/
|
|
48
|
-
classId: number;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* 加载YOLO模型
|
|
52
|
-
* @param paramPath ncnn模型的param文件的绝对路径
|
|
53
|
-
* @param binPath ncnn模型的bin文件绝对路径
|
|
54
|
-
* @param nc 模型的标签数量,可在标签集data.yaml中看到
|
|
55
|
-
* @param version 模型版本,默认11, 支持 8 11 26
|
|
56
|
-
* @returns 加载成功返回模型ID字符串,失败返回null
|
|
57
|
-
* @example
|
|
58
|
-
* const modelId = yolo.load("yolov8n.param", "yolov8n.bin", 80)
|
|
59
|
-
*/
|
|
60
|
-
function load(
|
|
61
|
-
paramPath: string,
|
|
62
|
-
binPath: string,
|
|
63
|
-
nc: number,
|
|
64
|
-
version?: number
|
|
65
|
-
): string | null;
|
|
66
|
-
/**
|
|
67
|
-
* 加载YOLOv11模型 (兼容 yolov8 模型)
|
|
68
|
-
* @param paramPath ncnn模型的param文件的绝对路径
|
|
69
|
-
* @param binPath ncnn模型的bin文件绝对路径
|
|
70
|
-
* @param nc 模型的标签数量,可在标签集data.yaml中看到
|
|
71
|
-
* @returns 加载成功返回模型ID字符串,失败返回null
|
|
72
|
-
* @example
|
|
73
|
-
* const modelId = yolo.loadV11("yolov11n.param", "yolov11n.bin", 80)
|
|
74
|
-
*/
|
|
75
|
-
function loadV11(
|
|
76
|
-
paramPath: string,
|
|
77
|
-
binPath: string,
|
|
78
|
-
nc: number
|
|
79
|
-
): string | null;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* 目标检测
|
|
83
|
-
* @param modelId 模型ID
|
|
84
|
-
* @param img 图像ID,"screen"用当前屏幕检测,可以填入图像ID或者http图片地址或文件地址
|
|
85
|
-
* @param targetSize 图像进入后缩放的检测大小,模型训练一般都用640,因此这里的640一般不要改
|
|
86
|
-
* @param threshold 置信度,默认0.4,小于这个值的会被过滤掉
|
|
87
|
-
* @param nmsThreshold 重叠阈值,一般是0.5不需要更改
|
|
88
|
-
* @returns 检测结果数组
|
|
89
|
-
* @example
|
|
90
|
-
* const results = yolo.detect(modelId, "screen", 640, 0.4, 0.5)
|
|
91
|
-
*/
|
|
92
|
-
function detect(
|
|
93
|
-
modelId: string,
|
|
94
|
-
img: string,
|
|
95
|
-
targetSize?: number,
|
|
96
|
-
threshold?: number,
|
|
97
|
-
nmsThreshold?: number
|
|
98
|
-
): YoloResult[];
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* 释放指定模型资源
|
|
102
|
-
* @param modelId 模型ID
|
|
103
|
-
* @example
|
|
104
|
-
* yolo.free(modelId)
|
|
105
|
-
*/
|
|
106
|
-
function free(modelId: string): void;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 释放所有模型资源
|
|
110
|
-
* @example
|
|
111
|
-
* yolo.freeAll()
|
|
112
|
-
*/
|
|
113
|
-
function freeAll(): void;
|
|
114
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* YOLO目标检测模块 包含加载模型、目标检测等功能
|
|
3
|
+
*/
|
|
4
|
+
declare namespace yolo {
|
|
5
|
+
/**
|
|
6
|
+
* YOLO检测结果
|
|
7
|
+
*/
|
|
8
|
+
interface YoloResult {
|
|
9
|
+
/**
|
|
10
|
+
* 检测框的左上角x坐标
|
|
11
|
+
*/
|
|
12
|
+
x: number;
|
|
13
|
+
/**
|
|
14
|
+
* 检测框的左上角y坐标
|
|
15
|
+
*/
|
|
16
|
+
y: number;
|
|
17
|
+
/**
|
|
18
|
+
* 检测框的右下角x坐标
|
|
19
|
+
*/
|
|
20
|
+
ex: number;
|
|
21
|
+
/**
|
|
22
|
+
* 检测框的右下角y坐标
|
|
23
|
+
*/
|
|
24
|
+
ey: number;
|
|
25
|
+
/**
|
|
26
|
+
* 检测框的中心点x坐标
|
|
27
|
+
*/
|
|
28
|
+
centerX: number;
|
|
29
|
+
/**
|
|
30
|
+
* 检测框的中心点y坐标
|
|
31
|
+
*/
|
|
32
|
+
centerY: number;
|
|
33
|
+
/**
|
|
34
|
+
* 检测框的宽度
|
|
35
|
+
*/
|
|
36
|
+
width: number;
|
|
37
|
+
/**
|
|
38
|
+
* 检测框的高度
|
|
39
|
+
*/
|
|
40
|
+
height: number;
|
|
41
|
+
/**
|
|
42
|
+
* 检测框的置信度
|
|
43
|
+
*/
|
|
44
|
+
confidence: number;
|
|
45
|
+
/**
|
|
46
|
+
* 检测框的类别ID
|
|
47
|
+
*/
|
|
48
|
+
classId: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 加载YOLO模型
|
|
52
|
+
* @param paramPath ncnn模型的param文件的绝对路径
|
|
53
|
+
* @param binPath ncnn模型的bin文件绝对路径
|
|
54
|
+
* @param nc 模型的标签数量,可在标签集data.yaml中看到
|
|
55
|
+
* @param version 模型版本,默认11, 支持 8 11 26
|
|
56
|
+
* @returns 加载成功返回模型ID字符串,失败返回null
|
|
57
|
+
* @example
|
|
58
|
+
* const modelId = yolo.load("yolov8n.param", "yolov8n.bin", 80)
|
|
59
|
+
*/
|
|
60
|
+
function load(
|
|
61
|
+
paramPath: string,
|
|
62
|
+
binPath: string,
|
|
63
|
+
nc: number,
|
|
64
|
+
version?: number
|
|
65
|
+
): string | null;
|
|
66
|
+
/**
|
|
67
|
+
* 加载YOLOv11模型 (兼容 yolov8 模型)
|
|
68
|
+
* @param paramPath ncnn模型的param文件的绝对路径
|
|
69
|
+
* @param binPath ncnn模型的bin文件绝对路径
|
|
70
|
+
* @param nc 模型的标签数量,可在标签集data.yaml中看到
|
|
71
|
+
* @returns 加载成功返回模型ID字符串,失败返回null
|
|
72
|
+
* @example
|
|
73
|
+
* const modelId = yolo.loadV11("yolov11n.param", "yolov11n.bin", 80)
|
|
74
|
+
*/
|
|
75
|
+
function loadV11(
|
|
76
|
+
paramPath: string,
|
|
77
|
+
binPath: string,
|
|
78
|
+
nc: number
|
|
79
|
+
): string | null;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 目标检测
|
|
83
|
+
* @param modelId 模型ID
|
|
84
|
+
* @param img 图像ID,"screen"用当前屏幕检测,可以填入图像ID或者http图片地址或文件地址
|
|
85
|
+
* @param targetSize 图像进入后缩放的检测大小,模型训练一般都用640,因此这里的640一般不要改
|
|
86
|
+
* @param threshold 置信度,默认0.4,小于这个值的会被过滤掉
|
|
87
|
+
* @param nmsThreshold 重叠阈值,一般是0.5不需要更改
|
|
88
|
+
* @returns 检测结果数组
|
|
89
|
+
* @example
|
|
90
|
+
* const results = yolo.detect(modelId, "screen", 640, 0.4, 0.5)
|
|
91
|
+
*/
|
|
92
|
+
function detect(
|
|
93
|
+
modelId: string,
|
|
94
|
+
img: string,
|
|
95
|
+
targetSize?: number,
|
|
96
|
+
threshold?: number,
|
|
97
|
+
nmsThreshold?: number
|
|
98
|
+
): YoloResult[];
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 释放指定模型资源
|
|
102
|
+
* @param modelId 模型ID
|
|
103
|
+
* @example
|
|
104
|
+
* yolo.free(modelId)
|
|
105
|
+
*/
|
|
106
|
+
function free(modelId: string): void;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 释放所有模型资源
|
|
110
|
+
* @example
|
|
111
|
+
* yolo.freeAll()
|
|
112
|
+
*/
|
|
113
|
+
function freeAll(): void;
|
|
114
|
+
}
|