zcw-shared 1.5.0 → 1.8.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 +93 -363
- package/dist/constants/colorPatterns.d.ts +8 -2
- package/dist/constants/colorPatterns.js.map +1 -1
- package/dist/constants/namedColors.d.ts +16 -2
- package/dist/constants/namedColors.js.map +1 -1
- package/dist/constants/softwareConfigs.d.ts +0 -1
- package/dist/constants/softwareConfigs.js +0 -1
- package/dist/constants/softwareConfigs.js.map +1 -1
- package/dist/functions/ag-grid/generateLicense.d.ts +2 -2
- package/dist/functions/android/buildProject.d.ts +12 -0
- package/dist/functions/android/buildProject.js +123 -0
- package/dist/functions/android/buildProject.js.map +1 -0
- package/dist/functions/android/modifyGradle.d.ts +17 -0
- package/dist/functions/android/modifyGradle.js +69 -0
- package/dist/functions/android/modifyGradle.js.map +1 -0
- package/dist/functions/android/modifyManifest.d.ts +23 -0
- package/dist/functions/android/modifyManifest.js +198 -0
- package/dist/functions/android/modifyManifest.js.map +1 -0
- package/dist/functions/android/permission.d.ts +30 -0
- package/dist/functions/android/permission.js +65 -0
- package/dist/functions/android/permission.js.map +1 -0
- package/dist/functions/color/colorValidation.d.ts +11 -0
- package/dist/functions/color/colorValidation.js +35 -0
- package/dist/functions/color/colorValidation.js.map +1 -0
- package/dist/functions/color/convertColor.d.ts +0 -1
- package/dist/functions/color/convertColor.js +135 -166
- package/dist/functions/color/convertColor.js.map +1 -1
- package/dist/functions/color/deduplicateColors.js +23 -38
- package/dist/functions/color/deduplicateColors.js.map +1 -1
- package/dist/functions/color/detectColorFormat.d.ts +8 -2
- package/dist/functions/color/detectColorFormat.js +49 -51
- package/dist/functions/color/detectColorFormat.js.map +1 -1
- package/dist/functions/color/extractColors.js +48 -18
- package/dist/functions/color/extractColors.js.map +1 -1
- package/dist/functions/css/extractCssVariables.d.ts +1 -1
- package/dist/functions/css/extractCssVariables.js +1 -1
- package/dist/functions/css/extractCssVariables.js.map +1 -1
- package/dist/functions/debug/createDebugger.d.ts +8 -7
- package/dist/functions/debug/createDebugger.js +49 -39
- package/dist/functions/debug/createDebugger.js.map +1 -1
- package/dist/functions/dom/detectOverflow.d.ts +3 -3
- package/dist/functions/dom/detectOverflow.js +3 -3
- package/dist/functions/dom/detectOverflow.js.map +1 -1
- package/dist/functions/dom/getElementRect.d.ts +1 -1
- package/dist/functions/dom/getElementRect.js.map +1 -1
- package/dist/functions/dom/getRelativePosition.d.ts +1 -1
- package/dist/functions/dom/getRelativePosition.js.map +1 -1
- package/dist/functions/dom/getViewportRect.d.ts +2 -2
- package/dist/functions/dom/getViewportRect.js +2 -2
- package/dist/functions/dom/getViewportRect.js.map +1 -1
- package/dist/functions/dom/getViewportSize.d.ts +2 -2
- package/dist/functions/dom/getViewportSize.js.map +1 -1
- package/dist/functions/image/generateMacIcons.d.ts +3 -3
- package/dist/functions/image/generateMacIcons.js.map +1 -1
- package/dist/functions/image/generateMacTrayIcon.d.ts +3 -3
- package/dist/functions/image/generateMacTrayIcon.js.map +1 -1
- package/dist/functions/image/generatePaddedImage.d.ts +2 -2
- package/dist/functions/image/generatePaddedImage.js.map +1 -1
- package/dist/functions/image/generatePwaIcons.d.ts +3 -3
- package/dist/functions/image/generatePwaIcons.js.map +1 -1
- package/dist/functions/image/generateRoundedImage.d.ts +2 -2
- package/dist/functions/image/generateRoundedImage.js.map +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.d.ts +2 -2
- package/dist/functions/ipc/dispatchIpcRequest.js +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -1
- package/dist/functions/software/findSoftware.d.ts +3 -3
- package/dist/functions/software/findSoftware.js +7 -9
- package/dist/functions/software/findSoftware.js.map +1 -1
- package/dist/functions/string/base64.d.ts +1 -1
- package/dist/functions/string/capitalize.js.map +1 -1
- package/dist/functions/string/caseConverter.d.ts +0 -1
- package/dist/functions/string/caseConverter.js +1 -8
- package/dist/functions/string/caseConverter.js.map +1 -1
- package/dist/functions/string/desensitize.js.map +1 -1
- package/dist/functions/string/htmlEscape.d.ts +4 -1
- package/dist/functions/string/htmlEscape.js +37 -25
- package/dist/functions/string/htmlEscape.js.map +1 -1
- package/dist/functions/string/levenshtein.js.map +1 -1
- package/dist/functions/string/normalize.js.map +1 -1
- package/dist/functions/string/pad.d.ts +0 -1
- package/dist/functions/string/pad.js +0 -3
- package/dist/functions/string/pad.js.map +1 -1
- package/dist/functions/string/palindrome.js.map +1 -1
- package/dist/functions/string/similarity.js.map +1 -1
- package/dist/functions/string/template.js.map +1 -1
- package/dist/functions/string/wordCount.js.map +1 -1
- package/dist/functions/tencent-cloud/getSecret.js.map +1 -1
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +7 -7
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +98 -24
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +1 -1
- package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +3 -3
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +1 -1
- package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +1 -1
- package/dist/functions/uniapp/app-plus/configureStrings.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/configureStrings.js.map +1 -1
- package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/copyAppResources.js.map +1 -1
- package/dist/functions/uniapp/app-plus/parseManifest.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/parseManifest.js.map +1 -1
- package/dist/functions/uniapp/app-plus/validateOptions.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/validateOptions.js.map +1 -1
- package/dist/functions/uniapp/build.d.ts +20 -0
- package/dist/functions/uniapp/build.js +84 -0
- package/dist/functions/uniapp/build.js.map +1 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.d.ts +7 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js +30 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js.map +1 -0
- package/dist/functions/uniapp/detectProjectType.d.ts +16 -0
- package/dist/functions/uniapp/detectProjectType.js +68 -0
- package/dist/functions/uniapp/detectProjectType.js.map +1 -0
- package/dist/functions/uniapp/parseManifest.d.ts +12 -0
- package/dist/functions/uniapp/parseManifest.js +46 -0
- package/dist/functions/uniapp/parseManifest.js.map +1 -0
- package/dist/functions/uniapp/waitForPages.d.ts +3 -2
- package/dist/functions/uniapp/waitForPages.js.map +1 -1
- package/dist/functions/utils/compose.js.map +1 -1
- package/dist/functions/utils/cond.js.map +1 -1
- package/dist/functions/utils/curry.js.map +1 -1
- package/dist/functions/utils/debounce.js.map +1 -1
- package/dist/functions/utils/evolve.js.map +1 -1
- package/dist/functions/utils/flow.js.map +1 -1
- package/dist/functions/utils/generateExports.d.ts +16 -0
- package/dist/functions/utils/generateExports.js +34 -0
- package/dist/functions/utils/generateExports.js.map +1 -0
- package/dist/functions/utils/isType.js.map +1 -1
- package/dist/functions/utils/memoize.js.map +1 -1
- package/dist/functions/utils/once.js.map +1 -1
- package/dist/functions/utils/partial.js.map +1 -1
- package/dist/functions/utils/pipe.js.map +1 -1
- package/dist/functions/utils/retryWithBackoff.js.map +1 -1
- package/dist/functions/utils/tap.js.map +1 -1
- package/dist/functions/utils/throttle.js.map +1 -1
- package/dist/functions/utils/until.js.map +1 -1
- package/dist/functions/utils/validate.js.map +1 -1
- package/dist/functions/utils/walk.d.ts +11 -0
- package/dist/functions/utils/walk.js +27 -0
- package/dist/functions/utils/walk.js.map +1 -0
- package/dist/functions/vue/dynamicMount.d.ts +5 -5
- package/dist/functions/vue/dynamicMount.js +3 -1
- package/dist/functions/vue/dynamicMount.js.map +1 -1
- package/dist/functions/vue/extractColorsFromVueFile.js +2 -11
- package/dist/functions/vue/extractColorsFromVueFile.js.map +1 -1
- package/dist/functions/vue/extractColorsFromVueSection.js.map +1 -1
- package/dist/functions/vue/filterSections.js.map +1 -1
- package/dist/functions/vue/isVNode.js +3 -1
- package/dist/functions/vue/isVNode.js.map +1 -1
- package/dist/functions/vue/isVueComponent.js.map +1 -1
- package/dist/functions/vue/parseVueFile.js.map +1 -1
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +2 -2
- package/dist/functions/wechat/miniapp/downloadFile.js +8 -8
- package/dist/functions/wechat/miniapp/downloadFile.js.map +1 -1
- package/dist/functions/xml/modifyXml.d.ts +11 -0
- package/dist/functions/xml/modifyXml.js +46 -0
- package/dist/functions/xml/modifyXml.js.map +1 -0
- package/dist/hooks/useAi.d.ts +3 -3
- package/dist/hooks/useAi.js.map +1 -1
- package/dist/hooks/useAltool.d.ts +3 -32
- package/dist/hooks/useAltool.js.map +1 -1
- package/dist/hooks/useFetch.d.ts +2 -2
- package/dist/hooks/useFetch.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts +4 -4
- package/dist/hooks/useLocalStorage.js +51 -18
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useSessionStorage.d.ts +4 -4
- package/dist/hooks/useSessionStorage.js +51 -18
- package/dist/hooks/useSessionStorage.js.map +1 -1
- package/dist/hooks/useStorage.d.ts +10 -3
- package/dist/hooks/useStorage.js +33 -35
- package/dist/hooks/useStorage.js.map +1 -1
- package/dist/hooks/useStorageWithIndexedDB.d.ts +4 -4
- package/dist/hooks/useStorageWithIndexedDB.js +39 -29
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -1
- package/dist/hooks/useWASM.d.ts +2 -2
- package/dist/hooks/useWASM.js +6 -10
- package/dist/hooks/useWASM.js.map +1 -1
- package/dist/hooks/useWebWorker.d.ts +25 -4
- package/dist/hooks/useWebWorker.js.map +1 -1
- package/dist/hooks/useWorkerFunction.d.ts +22 -4
- package/dist/hooks/useWorkerFunction.js +1 -1
- package/dist/hooks/useWorkerFunction.js.map +1 -1
- package/dist/hooks/useWorkerPool.d.ts +30 -4
- package/dist/hooks/useWorkerPool.js.map +1 -1
- package/package.json +17 -22
- package/references/arraybuffer.d.ts +109 -0
- package/references/blob.d.ts +37 -0
- package/references/browser.d.ts +55 -160
- package/references/chrome.extension.d.ts +83 -0
- package/references/console.d.ts +3 -142
- package/references/{crypto.d.ts → crypto-js.d.ts} +1 -1
- package/references/dom.d.ts +41 -0
- package/references/encoding.d.ts +24 -0
- package/references/fetch.d.ts +6 -151
- package/references/indexeddb.d.ts +49 -0
- package/references/json5.d.ts +0 -7
- package/references/location.d.ts +16 -0
- package/references/node.d.ts +105 -94
- package/references/storage.d.ts +6 -100
- package/references/timer.d.ts +4 -5
- package/references/uniapp.d.ts +47 -5
- package/references/url.d.ts +9 -114
- package/references/vue.d.ts +71 -98
- package/references/webassembly.d.ts +96 -122
- package/references/wechat.d.ts +1 -1
- package/references/worker.d.ts +78 -132
- package/references/xml.d.ts +71 -39
- package/types/altool.d.ts +49 -17
- package/types/android-build.d.ts +31 -56
- package/types/color.d.ts +0 -90
- package/types/geometry.d.ts +1 -38
- package/types/platform.d.ts +4 -0
- package/types/software.d.ts +0 -12
- package/types/storage.d.ts +3 -1
- package/types/uniapp-android-build.d.ts +49 -0
- package/types/worker.d.ts +3 -189
- package/references/browser.extension.d.ts +0 -14
- package/types/network.d.ts +0 -184
- package/types/util.d.ts +0 -27
- package/types/wasm.d.ts +0 -217
package/references/worker.d.ts
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Web Worker 环境类型定义
|
|
3
|
-
*
|
|
3
|
+
* 提供核心 Worker API 的类型支持
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
// 核心类型定义
|
|
7
|
+
export type WorkerType = 'classic' | 'module'
|
|
8
|
+
export type WorkerCredentials = 'omit' | 'same-origin' | 'include'
|
|
9
|
+
export type ServiceWorkerState = 'installing' | 'installed' | 'activating' | 'activated' | 'redundant'
|
|
10
|
+
|
|
11
|
+
// 配置接口
|
|
12
|
+
export interface WorkerConfig {
|
|
13
|
+
type?: WorkerType
|
|
14
|
+
credentials?: WorkerCredentials
|
|
12
15
|
name?: string
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
export interface Transferable {
|
|
19
|
-
// 标记接口,用于类型检查
|
|
20
|
-
}
|
|
18
|
+
// 标记接口
|
|
19
|
+
export interface Transferable {}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
* Worker 全局作用域接口
|
|
24
|
-
*/
|
|
25
|
-
export interface WorkerGlobalScope extends EventTarget {
|
|
26
|
-
self: WorkerGlobalScope
|
|
27
|
-
location: WorkerLocation
|
|
28
|
-
navigator: WorkerNavigator
|
|
29
|
-
importScripts(...urls: string[]): void
|
|
30
|
-
close(): void
|
|
31
|
-
postMessage(message: any, transfer?: Transferable[]): void
|
|
32
|
-
onmessage: ((event: MessageEvent) => void) | null
|
|
33
|
-
onmessageerror: ((event: MessageEvent) => void) | null
|
|
34
|
-
onerror: ((event: ErrorEvent) => void) | null
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Worker 位置接口
|
|
39
|
-
*/
|
|
21
|
+
// 位置信息
|
|
40
22
|
export interface WorkerLocation {
|
|
41
23
|
href: string
|
|
42
24
|
protocol: string
|
|
@@ -49,9 +31,7 @@ export interface WorkerLocation {
|
|
|
49
31
|
origin: string
|
|
50
32
|
}
|
|
51
33
|
|
|
52
|
-
|
|
53
|
-
* Worker 导航器接口
|
|
54
|
-
*/
|
|
34
|
+
// 导航器信息
|
|
55
35
|
export interface WorkerNavigator {
|
|
56
36
|
userAgent: string
|
|
57
37
|
platform: string
|
|
@@ -61,21 +41,16 @@ export interface WorkerNavigator {
|
|
|
61
41
|
hardwareConcurrency: number
|
|
62
42
|
}
|
|
63
43
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*/
|
|
67
|
-
export interface MessageEvent<T = any> extends Event {
|
|
44
|
+
// 事件接口
|
|
45
|
+
export interface WorkerMessageEvent<T = any> extends Event {
|
|
68
46
|
data: T
|
|
69
47
|
origin: string
|
|
70
48
|
lastEventId: string
|
|
71
|
-
source:
|
|
72
|
-
ports: readonly
|
|
49
|
+
source: WorkerMessageSource | null
|
|
50
|
+
ports: readonly WorkerMessagePort[]
|
|
73
51
|
}
|
|
74
52
|
|
|
75
|
-
|
|
76
|
-
* 错误事件接口
|
|
77
|
-
*/
|
|
78
|
-
export interface ErrorEvent extends Event {
|
|
53
|
+
export interface WorkerErrorEvent extends Event {
|
|
79
54
|
message: string
|
|
80
55
|
filename: string
|
|
81
56
|
lineno: number
|
|
@@ -83,125 +58,96 @@ export interface ErrorEvent extends Event {
|
|
|
83
58
|
error: any
|
|
84
59
|
}
|
|
85
60
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*/
|
|
89
|
-
export interface MessagePort extends EventTarget {
|
|
61
|
+
// 消息通信
|
|
62
|
+
export interface WorkerMessagePort extends EventTarget {
|
|
90
63
|
postMessage(message: any, transfer?: Transferable[]): void
|
|
91
64
|
start(): void
|
|
92
65
|
close(): void
|
|
93
|
-
onmessage: ((event:
|
|
94
|
-
onmessageerror: ((event:
|
|
66
|
+
onmessage: ((event: WorkerMessageEvent) => void) | null
|
|
67
|
+
onmessageerror: ((event: WorkerMessageEvent) => void) | null
|
|
95
68
|
}
|
|
96
69
|
|
|
97
|
-
|
|
98
|
-
* 消息事件源类型
|
|
99
|
-
*/
|
|
100
|
-
export type MessageEventSource = WindowProxy | MessagePort | ServiceWorker
|
|
70
|
+
export type WorkerMessageSource = WorkerWindowProxy | WorkerMessagePort | WorkerServiceWorker
|
|
101
71
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*/
|
|
105
|
-
export interface WindowProxy {
|
|
106
|
-
// 标记接口,用于类型检查
|
|
107
|
-
}
|
|
72
|
+
// 代理和服务
|
|
73
|
+
export interface WorkerWindowProxy {}
|
|
108
74
|
|
|
109
|
-
|
|
110
|
-
* Service Worker 接口
|
|
111
|
-
*/
|
|
112
|
-
export interface ServiceWorker extends EventTarget {
|
|
75
|
+
export interface WorkerServiceWorker extends EventTarget {
|
|
113
76
|
scriptURL: string
|
|
114
77
|
state: ServiceWorkerState
|
|
115
78
|
postMessage(message: any, transfer?: Transferable[]): void
|
|
116
79
|
onstatechange: ((event: Event) => void) | null
|
|
117
80
|
}
|
|
118
81
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
82
|
+
// Worker 全局作用域
|
|
83
|
+
export interface WorkerGlobalScope extends EventTarget {
|
|
84
|
+
self: WorkerGlobalScope
|
|
85
|
+
location: WorkerLocation
|
|
86
|
+
navigator: WorkerNavigator
|
|
87
|
+
importScripts(...urls: string[]): void
|
|
88
|
+
close(): void
|
|
89
|
+
postMessage(message: any, transfer?: Transferable[]): void
|
|
90
|
+
onmessage: ((event: WorkerMessageEvent) => void) | null
|
|
91
|
+
onmessageerror: ((event: WorkerMessageEvent) => void) | null
|
|
92
|
+
onerror: ((event: WorkerErrorEvent) => void) | null
|
|
129
93
|
}
|
|
130
94
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
*/
|
|
134
|
-
export interface Worker extends EventTarget {
|
|
95
|
+
// Worker 实例
|
|
96
|
+
export interface WorkerInstance extends EventTarget {
|
|
135
97
|
postMessage(message: any, transfer?: Transferable[]): void
|
|
136
98
|
terminate(): void
|
|
137
|
-
onmessage: ((event:
|
|
138
|
-
onmessageerror: ((event:
|
|
139
|
-
onerror: ((event:
|
|
99
|
+
onmessage: ((event: WorkerMessageEvent) => void) | null
|
|
100
|
+
onmessageerror: ((event: WorkerMessageEvent) => void) | null
|
|
101
|
+
onerror: ((event: WorkerErrorEvent) => void) | null
|
|
140
102
|
}
|
|
141
103
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
export interface WorkerEnvironment {
|
|
147
|
-
Worker?: WorkerConstructor
|
|
148
|
-
SharedWorker?: SharedWorkerConstructor
|
|
149
|
-
ServiceWorker?: ServiceWorkerConstructor
|
|
150
|
-
MessageChannel?: MessageChannelConstructor
|
|
151
|
-
BroadcastChannel?: BroadcastChannelConstructor
|
|
104
|
+
// 共享 Worker
|
|
105
|
+
export interface WorkerShared extends EventTarget {
|
|
106
|
+
port: WorkerMessagePort
|
|
107
|
+
onerror: ((event: WorkerErrorEvent) => void) | null
|
|
152
108
|
}
|
|
153
109
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
new (scriptURL: string | URL, options?: string | WorkerOptions): SharedWorker
|
|
110
|
+
// 消息通道
|
|
111
|
+
export interface WorkerMessageChannel {
|
|
112
|
+
port1: WorkerMessagePort
|
|
113
|
+
port2: WorkerMessagePort
|
|
159
114
|
}
|
|
160
115
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
116
|
+
// 广播通道
|
|
117
|
+
export interface WorkerBroadcastChannel extends EventTarget {
|
|
118
|
+
name: string
|
|
119
|
+
postMessage(message: any): void
|
|
120
|
+
close(): void
|
|
121
|
+
onmessage: ((event: WorkerMessageEvent) => void) | null
|
|
122
|
+
onmessageerror: ((event: WorkerMessageEvent) => void) | null
|
|
167
123
|
}
|
|
168
124
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
export interface ServiceWorkerConstructor {
|
|
173
|
-
new (): ServiceWorker
|
|
125
|
+
// 构造函数类型
|
|
126
|
+
export interface WorkerConstructor {
|
|
127
|
+
new (scriptURL: string | URL, options?: WorkerConfig): WorkerInstance
|
|
174
128
|
}
|
|
175
129
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
*/
|
|
179
|
-
export interface MessageChannelConstructor {
|
|
180
|
-
new (): MessageChannel
|
|
130
|
+
export interface WorkerSharedConstructor {
|
|
131
|
+
new (scriptURL: string | URL, options?: string | WorkerConfig): WorkerShared
|
|
181
132
|
}
|
|
182
133
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
*/
|
|
186
|
-
export interface MessageChannel {
|
|
187
|
-
port1: MessagePort
|
|
188
|
-
port2: MessagePort
|
|
134
|
+
export interface WorkerServiceConstructor {
|
|
135
|
+
new (): WorkerServiceWorker
|
|
189
136
|
}
|
|
190
137
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
*/
|
|
194
|
-
export interface BroadcastChannelConstructor {
|
|
195
|
-
new (name: string): BroadcastChannel
|
|
138
|
+
export interface WorkerMessageChannelConstructor {
|
|
139
|
+
new (): WorkerMessageChannel
|
|
196
140
|
}
|
|
197
141
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
142
|
+
export interface WorkerBroadcastChannelConstructor {
|
|
143
|
+
new (name: string): WorkerBroadcastChannel
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 运行时接口
|
|
147
|
+
export interface WorkerRuntime {
|
|
148
|
+
Worker: WorkerConstructor
|
|
149
|
+
SharedWorker: WorkerSharedConstructor
|
|
150
|
+
ServiceWorker: WorkerServiceConstructor
|
|
151
|
+
MessageChannel: WorkerMessageChannelConstructor
|
|
152
|
+
BroadcastChannel: WorkerBroadcastChannelConstructor
|
|
207
153
|
}
|
package/references/xml.d.ts
CHANGED
|
@@ -1,56 +1,88 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* XML
|
|
3
|
-
*
|
|
2
|
+
* XML 处理类型定义
|
|
3
|
+
* 提供核心 XML 处理功能的类型支持
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export interface XMLParser {
|
|
10
|
-
parseFromString(xmlString: string, mimeType: string): XMLDocument
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* XML 序列化器接口
|
|
15
|
-
*/
|
|
16
|
-
export interface XMLSerializer {
|
|
17
|
-
serializeToString(node: Node): string
|
|
18
|
-
}
|
|
6
|
+
// 核心类型定义
|
|
7
|
+
export type XMLMimeType = 'text/xml' | 'application/xml' | 'application/xhtml+xml' | 'image/svg+xml'
|
|
8
|
+
export type XMLNodeType = 'element' | 'text' | 'comment' | 'document'
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
// 节点接口
|
|
11
|
+
export interface XMLNode {
|
|
12
|
+
nodeType: XMLNodeType
|
|
13
|
+
nodeName: string
|
|
14
|
+
nodeValue: string | null
|
|
15
|
+
textContent: string | null
|
|
16
|
+
parentNode: XMLNode | null
|
|
17
|
+
childNodes: XMLNodeList
|
|
27
18
|
}
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
export interface XMLElement {
|
|
20
|
+
// 元素接口
|
|
21
|
+
export interface XMLElement extends XMLNode {
|
|
33
22
|
tagName: string
|
|
23
|
+
attributes: XMLAttributeMap
|
|
34
24
|
getAttribute(name: string): string | null
|
|
35
25
|
setAttribute(name: string, value: string): void
|
|
26
|
+
removeAttribute(name: string): void
|
|
27
|
+
hasAttribute(name: string): boolean
|
|
36
28
|
getElementsByTagName(tagName: string): XMLNodeList
|
|
37
|
-
appendChild(child:
|
|
38
|
-
|
|
29
|
+
appendChild(child: XMLNode): XMLNode
|
|
30
|
+
removeChild(child: XMLNode): XMLNode
|
|
39
31
|
}
|
|
40
32
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
// 属性映射
|
|
34
|
+
export interface XMLAttributeMap {
|
|
35
|
+
length: number
|
|
36
|
+
getNamedItem(name: string): XMLAttribute | null
|
|
37
|
+
setNamedItem(attr: XMLAttribute): XMLAttribute | null
|
|
38
|
+
removeNamedItem(name: string): XMLAttribute
|
|
39
|
+
item(index: number): XMLAttribute | null
|
|
40
|
+
[index: number]: XMLAttribute
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 属性接口
|
|
44
|
+
export interface XMLAttribute {
|
|
45
|
+
name: string
|
|
46
|
+
value: string
|
|
47
|
+
ownerElement: XMLElement | null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 节点列表
|
|
44
51
|
export interface XMLNodeList {
|
|
45
52
|
length: number
|
|
46
|
-
item(index: number):
|
|
47
|
-
[index: number]:
|
|
53
|
+
item(index: number): XMLNode | null
|
|
54
|
+
[index: number]: XMLNode
|
|
48
55
|
}
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
// 文档接口
|
|
58
|
+
export interface XMLDocument extends XMLNode {
|
|
59
|
+
documentElement: XMLElement | null
|
|
60
|
+
createElement(tagName: string): XMLElement
|
|
61
|
+
createTextNode(data: string): XMLNode
|
|
62
|
+
createComment(data: string): XMLNode
|
|
63
|
+
getElementsByTagName(tagName: string): XMLNodeList
|
|
64
|
+
getElementById(id: string): XMLElement | null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 解析器和序列化器
|
|
68
|
+
export interface XMLParser {
|
|
69
|
+
parseFromString(xmlString: string, mimeType?: string): any
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface XMLSerializer {
|
|
73
|
+
serializeToString(node: any): string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface XMLParserConstructor {
|
|
77
|
+
new (options?: any): XMLParser
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface XMLSerializerConstructor {
|
|
81
|
+
new (): XMLSerializer
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 运行时接口
|
|
85
|
+
export interface XMLRuntime {
|
|
86
|
+
DOMParser: XMLParserConstructor
|
|
87
|
+
XMLSerializer: XMLSerializerConstructor
|
|
56
88
|
}
|
package/types/altool.d.ts
CHANGED
|
@@ -31,23 +31,6 @@ export interface AltoolAuthApiKey {
|
|
|
31
31
|
|
|
32
32
|
export type AltoolAuth = AltoolAuthCredentials | AltoolAuthApiKey
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* altool基础选项
|
|
36
|
-
*/
|
|
37
|
-
export interface AltoolBaseOptions {
|
|
38
|
-
/** 应用类型 */
|
|
39
|
-
type: AltoolAppType
|
|
40
|
-
/** 输出格式 */
|
|
41
|
-
outputFormat?: AltoolOutputFormat
|
|
42
|
-
/** 认证信息 */
|
|
43
|
-
auth: AltoolAuth
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* altool命令类型
|
|
48
|
-
*/
|
|
49
|
-
export type AltoolCommand = 'upload-app' | 'validate-app' | 'list-apps'
|
|
50
|
-
|
|
51
34
|
/**
|
|
52
35
|
* altool执行结果基础接口
|
|
53
36
|
*/
|
|
@@ -62,4 +45,53 @@ export interface AltoolBaseResult {
|
|
|
62
45
|
exitCode: number
|
|
63
46
|
/** 执行的命令 */
|
|
64
47
|
command: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* altool上传选项
|
|
52
|
+
*/
|
|
53
|
+
export interface AltoolUploadOptions {
|
|
54
|
+
file: string
|
|
55
|
+
type: AltoolAppType
|
|
56
|
+
auth: AltoolAuth
|
|
57
|
+
outputFormat?: AltoolOutputFormat
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* altool验证选项
|
|
62
|
+
*/
|
|
63
|
+
export interface AltoolValidateOptions {
|
|
64
|
+
file: string
|
|
65
|
+
type: AltoolAppType
|
|
66
|
+
auth: AltoolAuth
|
|
67
|
+
outputFormat?: AltoolOutputFormat
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* altool验证结果
|
|
72
|
+
*/
|
|
73
|
+
export interface AltoolValidateResult {
|
|
74
|
+
hasWarnings: boolean
|
|
75
|
+
hasErrors: boolean
|
|
76
|
+
warnings: string[]
|
|
77
|
+
errors: string[]
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* altool应用信息选项
|
|
82
|
+
*/
|
|
83
|
+
export interface AltoolAppInfoOptions {
|
|
84
|
+
type: AltoolAppType
|
|
85
|
+
auth: AltoolAuth
|
|
86
|
+
outputFormat?: AltoolOutputFormat
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 应用信息
|
|
91
|
+
*/
|
|
92
|
+
export interface AppInfo {
|
|
93
|
+
bundleId: string
|
|
94
|
+
name: string
|
|
95
|
+
version: string
|
|
96
|
+
build: string
|
|
65
97
|
}
|
package/types/android-build.d.ts
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Android 离线打包相关类型定义
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* 定义通用 Android 离线打包功能使用的接口和类型
|
|
6
|
+
*
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @author Assistant
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ChildProcess, FileSystem, Path, Process } from '../references/node.d'
|
|
12
|
+
import type { XMLParser, XMLSerializer, XMLParserConstructor, XMLSerializerConstructor } from '../references/xml.d'
|
|
13
|
+
import type { JSON5Parser } from '../references/json5.d'
|
|
4
14
|
|
|
5
15
|
/**
|
|
6
|
-
* Android
|
|
16
|
+
* Android 工程编译选项(通用)
|
|
7
17
|
*/
|
|
8
18
|
export interface AndroidBuildOptions {
|
|
9
|
-
/**
|
|
19
|
+
/** 工程路径 */
|
|
10
20
|
projectPath: string
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
applicationId: string
|
|
19
|
-
/** 是否为调试版本 */
|
|
20
|
-
debug?: boolean
|
|
21
|
-
/** UniApp 构建脚本名称,如果不指定则直接使用 uni 命令 */
|
|
22
|
-
buildScript?: string
|
|
23
|
-
/** Android 示例工程路径 */
|
|
24
|
-
androidProjectPath: string
|
|
25
|
-
/** 签名配置(可选) */
|
|
21
|
+
/** 输出路径 */
|
|
22
|
+
outputPath?: string
|
|
23
|
+
/** 是否清理构建 */
|
|
24
|
+
clean?: boolean
|
|
25
|
+
/** 构建变体 */
|
|
26
|
+
buildVariant?: 'debug' | 'release'
|
|
27
|
+
/** 签名配置 */
|
|
26
28
|
signing?: {
|
|
27
|
-
|
|
29
|
+
keystorePath: string
|
|
28
30
|
keystorePassword: string
|
|
29
31
|
keyAlias: string
|
|
30
32
|
keyPassword: string
|
|
@@ -32,54 +34,27 @@ export interface AndroidBuildOptions {
|
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
|
-
* Android
|
|
37
|
+
* Android 工程编译结果(通用)
|
|
36
38
|
*/
|
|
37
39
|
export interface AndroidBuildResult {
|
|
38
|
-
/** 是否成功 */
|
|
39
40
|
success: boolean
|
|
40
|
-
/** 输出文件路径 */
|
|
41
41
|
outputPath?: string
|
|
42
|
-
/** 错误信息 */
|
|
43
42
|
error?: string
|
|
44
|
-
/** 构建日志 */
|
|
45
43
|
logs: string[]
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* 系统依赖接口
|
|
48
|
+
* 用于依赖注入,确保函数的环境无关性
|
|
50
49
|
*/
|
|
51
50
|
export interface SystemDependencies {
|
|
52
|
-
childProcess:
|
|
53
|
-
fs:
|
|
54
|
-
path:
|
|
55
|
-
process:
|
|
51
|
+
childProcess: ChildProcess
|
|
52
|
+
fs: FileSystem
|
|
53
|
+
path: Path
|
|
54
|
+
process: Process
|
|
56
55
|
setTimeout: (callback: () => void, delay: number) => any
|
|
57
56
|
require: (id: string) => any
|
|
58
57
|
json5: JSON5Parser
|
|
59
|
-
xmlParser:
|
|
60
|
-
xmlSerializer:
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 验证结果接口
|
|
65
|
-
*/
|
|
66
|
-
export interface ValidationResult {
|
|
67
|
-
valid: boolean
|
|
68
|
-
error?: string
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 操作结果接口
|
|
73
|
-
*/
|
|
74
|
-
export interface OperationResult {
|
|
75
|
-
success: boolean
|
|
76
|
-
error?: string
|
|
77
|
-
logs: string[]
|
|
58
|
+
xmlParser: XMLParserConstructor
|
|
59
|
+
xmlSerializer: XMLSerializerConstructor
|
|
78
60
|
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* 构建结果接口
|
|
82
|
-
*/
|
|
83
|
-
export interface BuildResult extends OperationResult {
|
|
84
|
-
outputPath?: string
|
|
85
|
-
}
|