zcw-shared 1.19.0 → 1.20.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 (249) hide show
  1. package/README.md +1291 -65
  2. package/dist/functions/ag-grid/generateLicense.d.ts +5 -1
  3. package/dist/functions/ag-grid/generateLicense.js +3 -3
  4. package/dist/functions/ag-grid/generateLicense.js.map +1 -1
  5. package/dist/functions/android/buildProject.d.ts +9 -8
  6. package/dist/functions/android/buildProject.js +19 -20
  7. package/dist/functions/android/buildProject.js.map +1 -1
  8. package/dist/functions/android/detectAndroidModules.d.ts +7 -1
  9. package/dist/functions/android/detectAndroidModules.js +7 -7
  10. package/dist/functions/android/detectAndroidModules.js.map +1 -1
  11. package/dist/functions/android/modifyGradle.d.ts +10 -1
  12. package/dist/functions/android/modifyGradle.js +7 -7
  13. package/dist/functions/android/modifyGradle.js.map +1 -1
  14. package/dist/functions/android/modifyManifest.d.ts +11 -2
  15. package/dist/functions/android/modifyManifest.js +4 -4
  16. package/dist/functions/android/modifyManifest.js.map +1 -1
  17. package/dist/functions/android/permission.d.ts +15 -5
  18. package/dist/functions/android/permission.js +8 -8
  19. package/dist/functions/android/permission.js.map +1 -1
  20. package/dist/functions/async/createInterruptibleTask.d.ts +37 -0
  21. package/dist/functions/async/createInterruptibleTask.js +180 -0
  22. package/dist/functions/async/createInterruptibleTask.js.map +1 -0
  23. package/dist/functions/color/convertColor.js +1 -1
  24. package/dist/functions/color/convertColor.js.map +1 -1
  25. package/dist/functions/debug/createDebugger.d.ts +14 -3
  26. package/dist/functions/debug/createDebugger.js +10 -35
  27. package/dist/functions/debug/createDebugger.js.map +1 -1
  28. package/dist/functions/dom/demonstrateResourceLoading.d.ts +32 -0
  29. package/dist/functions/dom/demonstrateResourceLoading.js +169 -0
  30. package/dist/functions/dom/demonstrateResourceLoading.js.map +1 -0
  31. package/dist/functions/dom/detectOverflow.d.ts +5 -1
  32. package/dist/functions/dom/detectOverflow.js +2 -2
  33. package/dist/functions/dom/detectOverflow.js.map +1 -1
  34. package/dist/functions/dom/getViewportRect.d.ts +5 -1
  35. package/dist/functions/dom/getViewportRect.js +3 -3
  36. package/dist/functions/dom/getViewportRect.js.map +1 -1
  37. package/dist/functions/image/compressToTargetSize.d.ts +8 -1
  38. package/dist/functions/image/compressToTargetSize.js +11 -8
  39. package/dist/functions/image/compressToTargetSize.js.map +1 -1
  40. package/dist/functions/image/generateMacIcons.d.ts +5 -1
  41. package/dist/functions/image/generateMacIcons.js +4 -4
  42. package/dist/functions/image/generateMacIcons.js.map +1 -1
  43. package/dist/functions/image/generateMacTrayIcon.d.ts +4 -1
  44. package/dist/functions/image/generateMacTrayIcon.js +2 -2
  45. package/dist/functions/image/generateMacTrayIcon.js.map +1 -1
  46. package/dist/functions/image/generatePaddedImage.d.ts +4 -1
  47. package/dist/functions/image/generatePaddedImage.js +3 -3
  48. package/dist/functions/image/generatePaddedImage.js.map +1 -1
  49. package/dist/functions/image/generatePwaIcons.d.ts +5 -1
  50. package/dist/functions/image/generatePwaIcons.js +4 -4
  51. package/dist/functions/image/generatePwaIcons.js.map +1 -1
  52. package/dist/functions/image/generateRoundedImage.d.ts +5 -1
  53. package/dist/functions/image/generateRoundedImage.js +4 -4
  54. package/dist/functions/image/generateRoundedImage.js.map +1 -1
  55. package/dist/functions/image/getImageDimensions.d.ts +5 -1
  56. package/dist/functions/image/getImageDimensions.js +3 -3
  57. package/dist/functions/image/getImageDimensions.js.map +1 -1
  58. package/dist/functions/ipc/dispatchIpcRequest.d.ts +4 -1
  59. package/dist/functions/ipc/dispatchIpcRequest.js +3 -3
  60. package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -1
  61. package/dist/functions/software/findSoftware.d.ts +2 -2
  62. package/dist/functions/software/findSoftware.js +1 -1
  63. package/dist/functions/software/findSoftware.js.map +1 -1
  64. package/dist/functions/string/base64.d.ts +4 -1
  65. package/dist/functions/string/base64.js +2 -2
  66. package/dist/functions/string/base64.js.map +1 -1
  67. package/dist/functions/tencent-cloud/deploy.tcb.d.ts +12 -2
  68. package/dist/functions/tencent-cloud/deploy.tcb.js +7 -8
  69. package/dist/functions/tencent-cloud/deploy.tcb.js.map +1 -1
  70. package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +27 -2
  71. package/dist/functions/uniapp/app-plus/buildAndroidApp.js +71 -29
  72. package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
  73. package/dist/functions/uniapp/build.d.ts +9 -8
  74. package/dist/functions/uniapp/build.js +8 -9
  75. package/dist/functions/uniapp/build.js.map +1 -1
  76. package/dist/functions/uniapp/detectAndroidProjectStructure.d.ts +5 -1
  77. package/dist/functions/uniapp/detectAndroidProjectStructure.js +5 -5
  78. package/dist/functions/uniapp/detectAndroidProjectStructure.js.map +1 -1
  79. package/dist/functions/uniapp/detectProjectType.d.ts +8 -4
  80. package/dist/functions/uniapp/detectProjectType.js +20 -20
  81. package/dist/functions/uniapp/detectProjectType.js.map +1 -1
  82. package/dist/functions/uniapp/parseManifest.d.ts +7 -1
  83. package/dist/functions/uniapp/parseManifest.js +7 -4
  84. package/dist/functions/uniapp/parseManifest.js.map +1 -1
  85. package/dist/functions/uniapp/waitForPages.d.ts +6 -2
  86. package/dist/functions/uniapp/waitForPages.js +3 -3
  87. package/dist/functions/uniapp/waitForPages.js.map +1 -1
  88. package/dist/functions/utils/AVLTree.d.ts +19 -0
  89. package/dist/functions/utils/AVLTree.js +197 -0
  90. package/dist/functions/utils/AVLTree.js.map +1 -0
  91. package/dist/functions/utils/BinarySearchTree.d.ts +19 -0
  92. package/dist/functions/utils/BinarySearchTree.js +150 -0
  93. package/dist/functions/utils/BinarySearchTree.js.map +1 -0
  94. package/dist/functions/utils/EventEmitter.d.ts +32 -0
  95. package/dist/functions/utils/EventEmitter.js +108 -0
  96. package/dist/functions/utils/EventEmitter.js.map +1 -0
  97. package/dist/functions/utils/Graph.d.ts +19 -0
  98. package/dist/functions/utils/Graph.js +190 -0
  99. package/dist/functions/utils/Graph.js.map +1 -0
  100. package/dist/functions/utils/HashMap.d.ts +13 -0
  101. package/dist/functions/utils/HashMap.js +128 -0
  102. package/dist/functions/utils/HashMap.js.map +1 -0
  103. package/dist/functions/utils/Heap.d.ts +11 -0
  104. package/dist/functions/utils/Heap.js +91 -0
  105. package/dist/functions/utils/Heap.js.map +1 -0
  106. package/dist/functions/utils/LRUCache.d.ts +41 -0
  107. package/dist/functions/utils/LRUCache.js +182 -0
  108. package/dist/functions/utils/LRUCache.js.map +1 -0
  109. package/dist/functions/utils/LinkedList.d.ts +18 -0
  110. package/dist/functions/utils/LinkedList.js +135 -0
  111. package/dist/functions/utils/LinkedList.js.map +1 -0
  112. package/dist/functions/utils/MyPromise.d.ts +32 -0
  113. package/dist/functions/utils/MyPromise.js +254 -0
  114. package/dist/functions/utils/MyPromise.js.map +1 -0
  115. package/dist/functions/utils/PriorityQueue.d.ts +14 -0
  116. package/dist/functions/utils/PriorityQueue.js +77 -0
  117. package/dist/functions/utils/PriorityQueue.js.map +1 -0
  118. package/dist/functions/utils/Queue.d.ts +10 -0
  119. package/dist/functions/utils/Queue.js +27 -0
  120. package/dist/functions/utils/Queue.js.map +1 -0
  121. package/dist/functions/utils/Stack.d.ts +10 -0
  122. package/dist/functions/utils/Stack.js +27 -0
  123. package/dist/functions/utils/Stack.js.map +1 -0
  124. package/dist/functions/utils/Trie.d.ts +16 -0
  125. package/dist/functions/utils/Trie.js +127 -0
  126. package/dist/functions/utils/Trie.js.map +1 -0
  127. package/dist/functions/utils/UnionFind.d.ts +8 -0
  128. package/dist/functions/utils/UnionFind.js +53 -0
  129. package/dist/functions/utils/UnionFind.js.map +1 -0
  130. package/dist/functions/utils/curryAdvanced.d.ts +8 -0
  131. package/dist/functions/utils/curryAdvanced.js +87 -0
  132. package/dist/functions/utils/curryAdvanced.js.map +1 -0
  133. package/dist/functions/utils/debounce.d.ts +5 -1
  134. package/dist/functions/utils/debounce.js +3 -4
  135. package/dist/functions/utils/debounce.js.map +1 -1
  136. package/dist/functions/utils/deepClone.d.ts +12 -0
  137. package/dist/functions/utils/deepClone.js +131 -0
  138. package/dist/functions/utils/deepClone.js.map +1 -0
  139. package/dist/functions/utils/flatten.d.ts +7 -0
  140. package/dist/functions/utils/flatten.js +60 -0
  141. package/dist/functions/utils/flatten.js.map +1 -0
  142. package/dist/functions/utils/flattenObject.d.ts +5 -0
  143. package/dist/functions/utils/flattenObject.js +102 -0
  144. package/dist/functions/utils/flattenObject.js.map +1 -0
  145. package/dist/functions/utils/functionBind.d.ts +4 -0
  146. package/dist/functions/utils/functionBind.js +33 -0
  147. package/dist/functions/utils/functionBind.js.map +1 -0
  148. package/dist/functions/utils/generateExports.d.ts +16 -6
  149. package/dist/functions/utils/generateExports.js +11 -11
  150. package/dist/functions/utils/generateExports.js.map +1 -1
  151. package/dist/functions/utils/generatorUtils.d.ts +16 -0
  152. package/dist/functions/utils/generatorUtils.js +139 -0
  153. package/dist/functions/utils/generatorUtils.js.map +1 -0
  154. package/dist/functions/utils/myInstanceof.d.ts +5 -0
  155. package/dist/functions/utils/myInstanceof.js +56 -0
  156. package/dist/functions/utils/myInstanceof.js.map +1 -0
  157. package/dist/functions/utils/myNew.d.ts +3 -0
  158. package/dist/functions/utils/myNew.js +19 -0
  159. package/dist/functions/utils/myNew.js.map +1 -0
  160. package/dist/functions/utils/promiseLimit.d.ts +10 -0
  161. package/dist/functions/utils/promiseLimit.js +125 -0
  162. package/dist/functions/utils/promiseLimit.js.map +1 -0
  163. package/dist/functions/utils/retryWithBackoff.d.ts +4 -1
  164. package/dist/functions/utils/retryWithBackoff.js +2 -3
  165. package/dist/functions/utils/retryWithBackoff.js.map +1 -1
  166. package/dist/functions/utils/unique.d.ts +10 -0
  167. package/dist/functions/utils/unique.js +85 -0
  168. package/dist/functions/utils/unique.js.map +1 -0
  169. package/dist/functions/utils/validate.d.ts +4 -1
  170. package/dist/functions/utils/validate.js +2 -3
  171. package/dist/functions/utils/validate.js.map +1 -1
  172. package/dist/functions/utils/walk.d.ts +8 -2
  173. package/dist/functions/utils/walk.js +9 -10
  174. package/dist/functions/utils/walk.js.map +1 -1
  175. package/dist/functions/vue/dynamicMount.d.ts +3 -2
  176. package/dist/functions/vue/dynamicMount.js +6 -6
  177. package/dist/functions/vue/dynamicMount.js.map +1 -1
  178. package/dist/functions/wechat/miniapp/downloadFile.d.ts +5 -1
  179. package/dist/functions/wechat/miniapp/downloadFile.js +3 -3
  180. package/dist/functions/wechat/miniapp/downloadFile.js.map +1 -1
  181. package/dist/functions/xml/modifyXml.d.ts +9 -2
  182. package/dist/functions/xml/modifyXml.js +4 -4
  183. package/dist/functions/xml/modifyXml.js.map +1 -1
  184. package/dist/hooks/createGlobalState.d.ts +2 -0
  185. package/dist/hooks/createGlobalState.js +11 -0
  186. package/dist/hooks/createGlobalState.js.map +1 -0
  187. package/dist/hooks/createInjectionState.d.ts +14 -0
  188. package/dist/hooks/createInjectionState.js +20 -0
  189. package/dist/hooks/createInjectionState.js.map +1 -0
  190. package/dist/hooks/createSharedComposable.d.ts +2 -0
  191. package/dist/hooks/createSharedComposable.js +13 -0
  192. package/dist/hooks/createSharedComposable.js.map +1 -0
  193. package/dist/hooks/injectLocal.d.ts +10 -0
  194. package/dist/hooks/injectLocal.js +12 -0
  195. package/dist/hooks/injectLocal.js.map +1 -0
  196. package/dist/hooks/provideLocal.d.ts +9 -0
  197. package/dist/hooks/provideLocal.js +7 -0
  198. package/dist/hooks/provideLocal.js.map +1 -0
  199. package/dist/hooks/useAltool.d.ts +1 -1
  200. package/dist/hooks/useAltool.js +13 -13
  201. package/dist/hooks/useAltool.js.map +1 -1
  202. package/dist/hooks/useAsyncState.d.ts +30 -0
  203. package/dist/hooks/useAsyncState.js +46 -0
  204. package/dist/hooks/useAsyncState.js.map +1 -0
  205. package/dist/hooks/useDebouncedRefHistory.d.ts +22 -0
  206. package/dist/hooks/useDebouncedRefHistory.js +46 -0
  207. package/dist/hooks/useDebouncedRefHistory.js.map +1 -0
  208. package/dist/hooks/useDraggable.d.ts +14 -11
  209. package/dist/hooks/useDraggable.js +60 -80
  210. package/dist/hooks/useDraggable.js.map +1 -1
  211. package/dist/hooks/useLocalStorage.d.ts +5 -1
  212. package/dist/hooks/useLocalStorage.js +5 -4
  213. package/dist/hooks/useLocalStorage.js.map +1 -1
  214. package/dist/hooks/useManualRefHistory.d.ts +26 -0
  215. package/dist/hooks/useManualRefHistory.js +80 -0
  216. package/dist/hooks/useManualRefHistory.js.map +1 -0
  217. package/dist/hooks/useRefHistory.d.ts +21 -0
  218. package/dist/hooks/useRefHistory.js +41 -0
  219. package/dist/hooks/useRefHistory.js.map +1 -0
  220. package/dist/hooks/useResizable.d.ts +14 -8
  221. package/dist/hooks/useResizable.js +40 -31
  222. package/dist/hooks/useResizable.js.map +1 -1
  223. package/dist/hooks/useSessionStorage.d.ts +5 -1
  224. package/dist/hooks/useSessionStorage.js +5 -4
  225. package/dist/hooks/useSessionStorage.js.map +1 -1
  226. package/dist/hooks/useStorage.d.ts +4 -1
  227. package/dist/hooks/useStorage.js +4 -4
  228. package/dist/hooks/useStorage.js.map +1 -1
  229. package/dist/hooks/useStorageWithIndexedDB.d.ts +5 -1
  230. package/dist/hooks/useStorageWithIndexedDB.js +24 -11
  231. package/dist/hooks/useStorageWithIndexedDB.js.map +1 -1
  232. package/dist/hooks/useWebWorker.d.ts +13 -13
  233. package/dist/hooks/useWebWorker.js +15 -17
  234. package/dist/hooks/useWebWorker.js.map +1 -1
  235. package/dist/hooks/useWorkerFunction.d.ts +15 -11
  236. package/dist/hooks/useWorkerFunction.js +16 -16
  237. package/dist/hooks/useWorkerFunction.js.map +1 -1
  238. package/dist/hooks/useWorkerPool.d.ts +15 -12
  239. package/dist/hooks/useWorkerPool.js +18 -13
  240. package/dist/hooks/useWorkerPool.js.map +1 -1
  241. package/package.json +40 -3
  242. package/references/browser.d.ts +28 -2
  243. package/references/dom.d.ts +45 -0
  244. package/references/indexeddb.d.ts +1 -0
  245. package/references/node.d.ts +42 -7
  246. package/references/vue.d.ts +161 -5
  247. package/types/android-build.d.ts +0 -22
  248. package/types/tencent-cloud.d.ts +1 -9
  249. package/types/uniapp-android-build.d.ts +0 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcw-shared",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "files": [
5
5
  "references",
6
6
  "dist",
@@ -22,13 +22,15 @@
22
22
  "publish:major": "npx tsx scripts/publish.ts major",
23
23
  "publish:prerelease": "npx tsx scripts/publish.ts prerelease",
24
24
  "docs:dev": "vitepress dev docs",
25
- "docs:build": "vitepress build docs",
25
+ "docs:build": "NODE_OPTIONS=--max-old-space-size=4096 vitepress build docs",
26
26
  "docs:preview": "vitepress preview docs"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsx": "^4.20.3",
30
30
  "typescript": "^5.8.3",
31
- "vitepress": "^1.6.4"
31
+ "vitepress": "^1.6.4",
32
+ "vue": "^3.5.22",
33
+ "zcw-vue-ui": "^1.9.0"
32
34
  },
33
35
  "exports": {
34
36
  "./constants/colorPatterns": "./dist/constants/colorPatterns.js",
@@ -40,6 +42,7 @@
40
42
  "./functions/android/modifyGradle": "./dist/functions/android/modifyGradle.js",
41
43
  "./functions/android/modifyManifest": "./dist/functions/android/modifyManifest.js",
42
44
  "./functions/android/permission": "./dist/functions/android/permission.js",
45
+ "./functions/async/createInterruptibleTask": "./dist/functions/async/createInterruptibleTask.js",
43
46
  "./functions/color/colorValidation": "./dist/functions/color/colorValidation.js",
44
47
  "./functions/color/convertColor": "./dist/functions/color/convertColor.js",
45
48
  "./functions/color/deduplicateColors": "./dist/functions/color/deduplicateColors.js",
@@ -47,6 +50,7 @@
47
50
  "./functions/color/extractColors": "./dist/functions/color/extractColors.js",
48
51
  "./functions/css/extractCssVariables": "./dist/functions/css/extractCssVariables.js",
49
52
  "./functions/debug/createDebugger": "./dist/functions/debug/createDebugger.js",
53
+ "./functions/dom/demonstrateResourceLoading": "./dist/functions/dom/demonstrateResourceLoading.js",
50
54
  "./functions/dom/detectOverflow": "./dist/functions/dom/detectOverflow.js",
51
55
  "./functions/dom/getElementRect": "./dist/functions/dom/getElementRect.js",
52
56
  "./functions/dom/getRelativePosition": "./dist/functions/dom/getRelativePosition.js",
@@ -80,21 +84,45 @@
80
84
  "./functions/uniapp/detectProjectType": "./dist/functions/uniapp/detectProjectType.js",
81
85
  "./functions/uniapp/parseManifest": "./dist/functions/uniapp/parseManifest.js",
82
86
  "./functions/uniapp/waitForPages": "./dist/functions/uniapp/waitForPages.js",
87
+ "./functions/utils/AVLTree": "./dist/functions/utils/AVLTree.js",
88
+ "./functions/utils/BinarySearchTree": "./dist/functions/utils/BinarySearchTree.js",
89
+ "./functions/utils/EventEmitter": "./dist/functions/utils/EventEmitter.js",
90
+ "./functions/utils/Graph": "./dist/functions/utils/Graph.js",
91
+ "./functions/utils/HashMap": "./dist/functions/utils/HashMap.js",
92
+ "./functions/utils/Heap": "./dist/functions/utils/Heap.js",
93
+ "./functions/utils/LRUCache": "./dist/functions/utils/LRUCache.js",
94
+ "./functions/utils/LinkedList": "./dist/functions/utils/LinkedList.js",
95
+ "./functions/utils/MyPromise": "./dist/functions/utils/MyPromise.js",
96
+ "./functions/utils/PriorityQueue": "./dist/functions/utils/PriorityQueue.js",
97
+ "./functions/utils/Queue": "./dist/functions/utils/Queue.js",
98
+ "./functions/utils/Stack": "./dist/functions/utils/Stack.js",
99
+ "./functions/utils/Trie": "./dist/functions/utils/Trie.js",
100
+ "./functions/utils/UnionFind": "./dist/functions/utils/UnionFind.js",
83
101
  "./functions/utils/compose": "./dist/functions/utils/compose.js",
84
102
  "./functions/utils/cond": "./dist/functions/utils/cond.js",
85
103
  "./functions/utils/curry": "./dist/functions/utils/curry.js",
104
+ "./functions/utils/curryAdvanced": "./dist/functions/utils/curryAdvanced.js",
86
105
  "./functions/utils/debounce": "./dist/functions/utils/debounce.js",
106
+ "./functions/utils/deepClone": "./dist/functions/utils/deepClone.js",
87
107
  "./functions/utils/evolve": "./dist/functions/utils/evolve.js",
108
+ "./functions/utils/flatten": "./dist/functions/utils/flatten.js",
109
+ "./functions/utils/flattenObject": "./dist/functions/utils/flattenObject.js",
88
110
  "./functions/utils/flow": "./dist/functions/utils/flow.js",
111
+ "./functions/utils/functionBind": "./dist/functions/utils/functionBind.js",
89
112
  "./functions/utils/generateExports": "./dist/functions/utils/generateExports.js",
113
+ "./functions/utils/generatorUtils": "./dist/functions/utils/generatorUtils.js",
90
114
  "./functions/utils/isType": "./dist/functions/utils/isType.js",
91
115
  "./functions/utils/memoize": "./dist/functions/utils/memoize.js",
116
+ "./functions/utils/myInstanceof": "./dist/functions/utils/myInstanceof.js",
117
+ "./functions/utils/myNew": "./dist/functions/utils/myNew.js",
92
118
  "./functions/utils/once": "./dist/functions/utils/once.js",
93
119
  "./functions/utils/partial": "./dist/functions/utils/partial.js",
94
120
  "./functions/utils/pipe": "./dist/functions/utils/pipe.js",
121
+ "./functions/utils/promiseLimit": "./dist/functions/utils/promiseLimit.js",
95
122
  "./functions/utils/retryWithBackoff": "./dist/functions/utils/retryWithBackoff.js",
96
123
  "./functions/utils/tap": "./dist/functions/utils/tap.js",
97
124
  "./functions/utils/throttle": "./dist/functions/utils/throttle.js",
125
+ "./functions/utils/unique": "./dist/functions/utils/unique.js",
98
126
  "./functions/utils/until": "./dist/functions/utils/until.js",
99
127
  "./functions/utils/validate": "./dist/functions/utils/validate.js",
100
128
  "./functions/utils/walk": "./dist/functions/utils/walk.js",
@@ -109,11 +137,20 @@
109
137
  "./functions/vue/parseVueFile": "./dist/functions/vue/parseVueFile.js",
110
138
  "./functions/wechat/miniapp/downloadFile": "./dist/functions/wechat/miniapp/downloadFile.js",
111
139
  "./functions/xml/modifyXml": "./dist/functions/xml/modifyXml.js",
140
+ "./hooks/createGlobalState": "./dist/hooks/createGlobalState.js",
141
+ "./hooks/createInjectionState": "./dist/hooks/createInjectionState.js",
142
+ "./hooks/createSharedComposable": "./dist/hooks/createSharedComposable.js",
143
+ "./hooks/injectLocal": "./dist/hooks/injectLocal.js",
144
+ "./hooks/provideLocal": "./dist/hooks/provideLocal.js",
112
145
  "./hooks/useAltool": "./dist/hooks/useAltool.js",
146
+ "./hooks/useAsyncState": "./dist/hooks/useAsyncState.js",
113
147
  "./hooks/useCache": "./dist/hooks/useCache.js",
148
+ "./hooks/useDebouncedRefHistory": "./dist/hooks/useDebouncedRefHistory.js",
114
149
  "./hooks/useDraggable": "./dist/hooks/useDraggable.js",
115
150
  "./hooks/useLocalStorage": "./dist/hooks/useLocalStorage.js",
151
+ "./hooks/useManualRefHistory": "./dist/hooks/useManualRefHistory.js",
116
152
  "./hooks/usePluginSystem": "./dist/hooks/usePluginSystem.js",
153
+ "./hooks/useRefHistory": "./dist/hooks/useRefHistory.js",
117
154
  "./hooks/useResizable": "./dist/hooks/useResizable.js",
118
155
  "./hooks/useSessionStorage": "./dist/hooks/useSessionStorage.js",
119
156
  "./hooks/useStorage": "./dist/hooks/useStorage.js",
@@ -4,7 +4,7 @@ import type { AbortController, Response, FetchFunction } from './fetch.d'
4
4
  import type { URLSearchParams } from './url.d'
5
5
  import type { Storage } from './storage.d'
6
6
  import type { WorkerConstructor } from './worker.d'
7
- import type { Document, HTMLElement, Element, HTMLImageElement } from './dom.d'
7
+ import type { Document, HTMLElement, Element, HTMLImageElement, CSSStyleDeclaration } from './dom.d'
8
8
  import type { IDBFactory } from './indexeddb.d'
9
9
  import type { Blob, BlobPart, BlobPropertyBag, MediaSource, ReadableStream } from './blob.d'
10
10
  import type { TextDecoderConstructor, TextEncoderConstructor } from './encoding.d'
@@ -88,9 +88,35 @@ export interface Window {
88
88
  // 动画API
89
89
  requestAnimationFrame: (callback: (time: number) => void) => number
90
90
  cancelAnimationFrame: (id: number) => void
91
-
91
+
92
+ // 空闲回调API
93
+ requestIdleCallback?: (callback: (deadline: IdleDeadline) => void, options?: IdleRequestOptions) => number
94
+ cancelIdleCallback?: (id: number) => void
95
+
96
+ // 性能API
97
+ performance: Performance
98
+
99
+ // 样式计算API
100
+ getComputedStyle: (element: Element, pseudoElement?: string | null) => CSSStyleDeclaration
101
+
92
102
  // 开发环境标识
93
103
  __DEV__?: boolean
94
104
 
95
105
 
106
+ }
107
+
108
+ // 空闲回调相关接口
109
+ export interface IdleDeadline {
110
+ timeRemaining(): number
111
+ didTimeout: boolean
112
+ }
113
+
114
+ export interface IdleRequestOptions {
115
+ timeout?: number
116
+ }
117
+
118
+ // 性能API接口
119
+ export interface Performance {
120
+ now(): number
121
+ timeOrigin: number
96
122
  }
@@ -21,6 +21,10 @@ export interface HTMLElement extends Element {
21
21
  removeEventListener(event: string, handler: (e: any) => void, options?: any): void
22
22
  clientWidth: number
23
23
  clientHeight: number
24
+ offsetLeft: number
25
+ offsetTop: number
26
+ offsetWidth: number
27
+ offsetHeight: number
24
28
  }
25
29
 
26
30
  export interface HTMLImageElement extends HTMLElement {
@@ -31,6 +35,29 @@ export interface HTMLImageElement extends HTMLElement {
31
35
  onerror: (() => void) | null
32
36
  }
33
37
 
38
+ export interface HTMLScriptElement extends HTMLElement {
39
+ src: string
40
+ async: boolean
41
+ defer: boolean
42
+ type: string
43
+ onload: (() => void) | null
44
+ onerror: (() => void) | null
45
+ }
46
+
47
+ export interface HTMLLinkElement extends HTMLElement {
48
+ href: string
49
+ rel: string
50
+ media: string
51
+ onload: (() => void) | null
52
+ onerror: (() => void) | null
53
+ }
54
+
55
+ export interface HTMLIFrameElement extends HTMLElement {
56
+ src: string
57
+ onload: (() => void) | null
58
+ onerror: (() => void) | null
59
+ }
60
+
34
61
  export interface CanvasRenderingContext2D {
35
62
  drawImage(image: HTMLImageElement, dx: number, dy: number, dWidth: number, dHeight: number): void
36
63
  }
@@ -44,11 +71,19 @@ export interface HTMLCanvasElement extends HTMLElement {
44
71
 
45
72
  export interface Document {
46
73
  createElement(tagName: 'canvas'): HTMLCanvasElement
74
+ createElement(tagName: 'script'): HTMLScriptElement
75
+ createElement(tagName: 'link'): HTMLLinkElement
76
+ createElement(tagName: 'img'): HTMLImageElement
77
+ createElement(tagName: 'iframe'): HTMLIFrameElement
47
78
  createElement(tagName: string): HTMLElement
48
79
  documentElement: {
49
80
  clientWidth: number
50
81
  clientHeight: number
51
82
  }
83
+ head: {
84
+ appendChild(element: HTMLElement): HTMLElement
85
+ }
86
+ body: HTMLElement
52
87
  addEventListener(event: string, handler: (e: any) => void, options?: any): void
53
88
  removeEventListener(event: string, handler: (e: any) => void, options?: any): void
54
89
  }
@@ -81,4 +116,14 @@ export interface DOMException {
81
116
 
82
117
  export interface DOMStringList {
83
118
  contains(string: string): boolean
119
+ }
120
+
121
+ export interface CSSStyleDeclaration {
122
+ position: string
123
+ left: string
124
+ top: string
125
+ width: string
126
+ height: string
127
+ transform: string
128
+ [property: string]: string
84
129
  }
@@ -23,6 +23,7 @@ export interface IDBObjectStore {
23
23
  put(value: any, key?: IDBValidKey): IDBRequest
24
24
  delete(key: IDBValidKey): IDBRequest
25
25
  clear(): IDBRequest
26
+ getAllKeys(): IDBRequest
26
27
  }
27
28
 
28
29
  export interface IDBTransaction {
@@ -25,21 +25,56 @@ export interface Buffer {
25
25
  toString(encoding?: string): string
26
26
  }
27
27
 
28
+ export type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'
29
+
28
30
  export interface FileSystem {
29
- readFile(path: string, encoding?: string): Promise<any>
30
- readFileSync(path: string, encoding?: string): string
31
- writeFile(path: string, data: any): Promise<void>
32
- writeFileSync(path: string, data: any, encoding?: string): void
33
- mkdir(path: string, options?: any): Promise<void>
34
- mkdirSync(path: string, options?: any): void
35
- copyFileSync(src: string, dest: string): void
31
+ /** 异步读取文件(回调版本) - 返回 Buffer */
32
+ readFile(path: string, callback: (err: Error | null, data: Buffer) => void): void
33
+ /** 异步读取文件(回调版本) - 返回 string */
34
+ readFile(path: string, encoding: BufferEncoding, callback: (err: Error | null, data: string) => void): void
35
+ readFile(path: string, options: { encoding: BufferEncoding, flag?: string }, callback: (err: Error | null, data: string) => void): void
36
+
37
+ /** 同步读取文件 - 返回 Buffer */
38
+ readFileSync(path: string): Buffer
39
+ /** 同步读取文件 - 返回 string */
40
+ readFileSync(path: string, encoding: BufferEncoding): string
41
+ readFileSync(path: string, options?: { encoding?: BufferEncoding, flag?: string } | BufferEncoding | null): string | Buffer
42
+
43
+ /** 异步写入文件(Promise 版本) */
44
+ writeFile(path: string, data: string | Buffer): Promise<void>
45
+
46
+ /** 同步写入文件 */
47
+ writeFileSync(path: string, data: string | Buffer, encoding?: BufferEncoding): void
48
+ writeFileSync(path: string, data: string | Buffer, options?: { encoding?: BufferEncoding, mode?: number, flag?: string }): void
49
+
50
+ /** 异步创建目录 */
51
+ mkdir(path: string, options?: { recursive?: boolean, mode?: number }): Promise<void>
52
+ /** 同步创建目录 */
53
+ mkdirSync(path: string, options?: { recursive?: boolean, mode?: number }): void
54
+ /** 同步复制文件 */
55
+ copyFileSync(src: string, dest: string, mode?: number): void
56
+ /** 检查文件是否存在 */
36
57
  existsSync(path: string): boolean
58
+ /** 读取目录内容 */
37
59
  readdirSync(path: string): string[]
60
+ /** 获取文件状态(跟随符号链接) */
38
61
  statSync(path: string): { isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }
62
+ /** 获取文件状态(不跟随符号链接) */
39
63
  lstatSync(path: string): { isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean }
64
+ /** 获取符号链接的真实路径 */
40
65
  realpathSync(path: string): string
66
+ /** Promise API */
41
67
  promises: {
68
+ /** 异步复制文件或目录 */
42
69
  cp(source: string, destination: string, options?: any): Promise<void>
70
+ /** 异步读取文件(Promise 版本) - 返回 Buffer */
71
+ readFile(path: string): Promise<Buffer>
72
+ /** 异步读取文件(Promise 版本) - 返回 string */
73
+ readFile(path: string, encoding: BufferEncoding): Promise<string>
74
+ readFile(path: string, options?: { encoding?: BufferEncoding, flag?: string } | BufferEncoding | null): Promise<string | Buffer>
75
+ /** 异步写入文件(Promise 版本) */
76
+ writeFile(path: string, data: string | Buffer, encoding?: BufferEncoding): Promise<void>
77
+ writeFile(path: string, data: string | Buffer, options?: { encoding?: BufferEncoding, mode?: number, flag?: string }): Promise<void>
43
78
  }
44
79
  }
45
80
 
@@ -1,4 +1,38 @@
1
- // Vue 类型定义
1
+ // Vue 3 类型定义
2
+
3
+ /**
4
+ * Vue 注入键类型
5
+ */
6
+ export type InjectionKey<T> = symbol
7
+
8
+ /**
9
+ * Vue 响应式引用
10
+ */
11
+ export interface Ref<T = any> {
12
+ value: T
13
+ readonly [Symbol.toStringTag]: 'Ref'
14
+ }
15
+
16
+ /**
17
+ * Vue 计算属性引用
18
+ */
19
+ export interface ComputedRef<T = any> extends WritableComputedRef<T> {
20
+ readonly value: T
21
+ }
22
+
23
+ /**
24
+ * Vue 可写计算属性引用
25
+ */
26
+ export interface WritableComputedRef<T> extends Ref<T> {
27
+ readonly effect: any
28
+ }
29
+
30
+ /**
31
+ * Vue 响应式对象
32
+ */
33
+ export type UnwrapRef<T> = {
34
+ [K in keyof T]: T[K] extends Ref<infer V> ? V : T[K]
35
+ }
2
36
 
3
37
  /**
4
38
  * Vue 虚拟节点
@@ -69,18 +103,140 @@ export interface AppConfig {
69
103
  }
70
104
 
71
105
  /**
72
- * Vue 响应式引用
106
+ * Vue 生命周期钩子函数类型
73
107
  */
74
- export interface Ref<T> {
75
- value: T
108
+ export type LifecycleHook = () => void
109
+
110
+ /**
111
+ * Vue 监听器选项
112
+ */
113
+ export interface WatchOptions {
114
+ immediate?: boolean
115
+ deep?: boolean
116
+ flush?: 'pre' | 'post' | 'sync'
76
117
  }
77
118
 
78
119
  /**
79
- * Vue 运行时函数
120
+ * Vue 监听器停止函数
121
+ */
122
+ export type WatchStopHandle = () => void
123
+
124
+ // Vue 3 Composition API 函数声明
125
+
126
+ /**
127
+ * 创建响应式引用
128
+ */
129
+ export declare function ref<T>(value: T): Ref<UnwrapRef<T>>
130
+ export declare function ref<T = any>(): Ref<T | undefined>
131
+
132
+ /**
133
+ * 创建响应式对象
134
+ */
135
+ export declare function reactive<T extends object>(target: T): UnwrapRef<T>
136
+
137
+ /**
138
+ * 创建计算属性
139
+ */
140
+ export declare function computed<T>(
141
+ getter: () => T,
142
+ debugOptions?: any
143
+ ): ComputedRef<T>
144
+ export declare function computed<T>(
145
+ options: {
146
+ get: () => T
147
+ set: (value: T) => void
148
+ },
149
+ debugOptions?: any
150
+ ): WritableComputedRef<T>
151
+
152
+ /**
153
+ * 监听响应式数据变化
154
+ */
155
+ export declare function watch<T>(
156
+ source: () => T,
157
+ callback: (newValue: T, oldValue: T) => void,
158
+ options?: WatchOptions
159
+ ): WatchStopHandle
160
+
161
+ export declare function watch<T>(
162
+ source: Ref<T>,
163
+ callback: (newValue: T, oldValue: T) => void,
164
+ options?: WatchOptions
165
+ ): WatchStopHandle
166
+
167
+ /**
168
+ * 立即监听响应式数据变化
169
+ */
170
+ export declare function watchEffect(
171
+ effect: () => void,
172
+ options?: {
173
+ flush?: 'pre' | 'post' | 'sync'
174
+ onTrack?: (event: any) => void
175
+ onTrigger?: (event: any) => void
176
+ }
177
+ ): WatchStopHandle
178
+
179
+ /**
180
+ * 组件挂载时执行
181
+ */
182
+ export declare function onMounted(hook: LifecycleHook): void
183
+
184
+ /**
185
+ * 组件卸载时执行
186
+ */
187
+ export declare function onUnmounted(hook: LifecycleHook): void
188
+
189
+ /**
190
+ * 组件更新前执行
191
+ */
192
+ export declare function onBeforeUpdate(hook: LifecycleHook): void
193
+
194
+ /**
195
+ * 组件更新后执行
196
+ */
197
+ export declare function onUpdated(hook: LifecycleHook): void
198
+
199
+ /**
200
+ * 组件挂载前执行
201
+ */
202
+ export declare function onBeforeMount(hook: LifecycleHook): void
203
+
204
+ /**
205
+ * 组件卸载前执行
206
+ */
207
+ export declare function onBeforeUnmount(hook: LifecycleHook): void
208
+
209
+ /**
210
+ * 获取当前组件实例
211
+ */
212
+ export declare function getCurrentInstance(): ComponentInstance | null
213
+
214
+ /**
215
+ * 下一个DOM更新周期
216
+ */
217
+ export declare function nextTick(fn?: () => void): Promise<void>
218
+
219
+ /**
220
+ * 创建Vue应用
221
+ */
222
+ export declare function createApp(rootComponent: Component, rootProps?: any): App
223
+
224
+ /**
225
+ * 定义组件
226
+ */
227
+ export declare function defineComponent<Props, RawBindings = object>(
228
+ setup: (props: Props, ctx: any) => RawBindings | (() => VNode | VNode[])
229
+ ): Component
230
+
231
+ export declare function defineComponent(options: Component): Component
232
+
233
+ /**
234
+ * Vue 运行时函数接口
80
235
  */
81
236
  export interface VueRuntime {
82
237
  createVNode: (type: any, props?: any, children?: any) => VNode
83
238
  render: (vnode: VNode | null, container: any) => void
84
239
  ref: <T>(value: T) => Ref<T>
240
+ onMounted: (fn: () => void) => void
85
241
  onUnmounted: (fn: () => void) => void
86
242
  }
@@ -8,11 +8,6 @@
8
8
  * @author Assistant
9
9
  */
10
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'
14
- import type { XPath } from '../references/xpath.d'
15
-
16
11
  /**
17
12
  * Android 工程编译选项(通用)
18
13
  */
@@ -43,20 +38,3 @@ export interface AndroidBuildResult {
43
38
  error?: string
44
39
  logs: string[]
45
40
  }
46
-
47
- /**
48
- * 系统依赖接口
49
- * 用于依赖注入,确保函数的环境无关性
50
- */
51
- export interface SystemDependencies {
52
- childProcess: ChildProcess
53
- fs: FileSystem
54
- path: Path
55
- process: Process
56
- setTimeout: (callback: () => void, delay: number) => any
57
- require: (id: string) => any
58
- json5: JSON5Parser
59
- xmlParser: XMLParserConstructor
60
- xmlSerializer: XMLSerializerConstructor
61
- xpath: XPath
62
- }
@@ -9,10 +9,7 @@
9
9
  * @author Assistant
10
10
  */
11
11
 
12
- import type {
13
- TencentCloudSystemDependencies,
14
- TencentCloudSecret
15
- } from '../references/tencent-cloud.d'
12
+ import type { TencentCloudSecret } from '../references/tencent-cloud.d'
16
13
 
17
14
  // 密钥类型
18
15
  export type SecretType = 'personal' | 'individual' | 'enterprise'
@@ -36,9 +33,4 @@ export interface DeployResult {
36
33
  success: boolean
37
34
  message?: string
38
35
  error?: string
39
- }
40
-
41
- // 部署函数依赖接口
42
- export interface DeployDependencies extends TencentCloudSystemDependencies {
43
- // 可以扩展特定于部署功能的依赖
44
36
  }
@@ -8,10 +8,6 @@
8
8
  * @author Assistant
9
9
  */
10
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'
14
- import type { XPath } from '../references/xpath.d'
15
11
  import type { AndroidBuildOptions, AndroidBuildResult } from './android-build.d'
16
12
 
17
13
  /**
@@ -31,21 +27,4 @@ export interface UniAppAndroidBuildOptions extends AndroidBuildOptions {
31
27
  */
32
28
  export interface UniAppAndroidBuildResult extends AndroidBuildResult {
33
29
  // 可以添加 UniApp 特有的结果属性
34
- }
35
-
36
- /**
37
- * UniApp 系统依赖接口
38
- * 用于依赖注入,确保函数的环境无关性
39
- */
40
- export interface UniAppSystemDependencies {
41
- childProcess: ChildProcess
42
- fs: FileSystem
43
- path: Path
44
- process: Process
45
- setTimeout: (callback: () => void, delay: number) => any
46
- require: (id: string) => any
47
- json5: JSON5Parser
48
- xmlParser: XMLParserConstructor
49
- xmlSerializer: XMLSerializerConstructor
50
- xpath: XPath
51
30
  }