zcw-shared 1.20.0 → 1.22.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 (567) hide show
  1. package/dist/functions/algorithm/binarySearch.d.ts +3 -0
  2. package/dist/functions/algorithm/binarySearch.js +58 -0
  3. package/dist/functions/algorithm/binarySearch.js.map +1 -0
  4. package/dist/functions/algorithm/canJump.d.ts +2 -0
  5. package/dist/functions/algorithm/canJump.js +27 -0
  6. package/dist/functions/algorithm/canJump.js.map +1 -0
  7. package/dist/functions/algorithm/climbStairs.d.ts +2 -0
  8. package/dist/functions/algorithm/climbStairs.js +27 -0
  9. package/dist/functions/algorithm/climbStairs.js.map +1 -0
  10. package/dist/functions/algorithm/coinChange.d.ts +2 -0
  11. package/dist/functions/algorithm/coinChange.js +25 -0
  12. package/dist/functions/algorithm/coinChange.js.map +1 -0
  13. package/dist/functions/algorithm/combinationSum.d.ts +1 -0
  14. package/dist/functions/algorithm/combinationSum.js +24 -0
  15. package/dist/functions/algorithm/combinationSum.js.map +1 -0
  16. package/dist/functions/algorithm/editDistance.d.ts +2 -0
  17. package/dist/functions/algorithm/editDistance.js +96 -0
  18. package/dist/functions/algorithm/editDistance.js.map +1 -0
  19. package/dist/functions/algorithm/generateParenthesis.d.ts +1 -0
  20. package/dist/functions/algorithm/generateParenthesis.js +18 -0
  21. package/dist/functions/algorithm/generateParenthesis.js.map +1 -0
  22. package/dist/functions/algorithm/kmp.d.ts +2 -0
  23. package/dist/functions/algorithm/kmp.js +58 -0
  24. package/dist/functions/algorithm/kmp.js.map +1 -0
  25. package/dist/functions/algorithm/knapsack01.d.ts +2 -0
  26. package/dist/functions/algorithm/knapsack01.js +34 -0
  27. package/dist/functions/algorithm/knapsack01.js.map +1 -0
  28. package/dist/functions/algorithm/lengthOfLongestSubstring.d.ts +2 -0
  29. package/dist/functions/algorithm/lengthOfLongestSubstring.js +33 -0
  30. package/dist/functions/algorithm/lengthOfLongestSubstring.js.map +1 -0
  31. package/dist/functions/algorithm/longestCommonSubsequence.d.ts +2 -0
  32. package/dist/functions/algorithm/longestCommonSubsequence.js +37 -0
  33. package/dist/functions/algorithm/longestCommonSubsequence.js.map +1 -0
  34. package/dist/functions/algorithm/longestIncreasingSubsequence.d.ts +2 -0
  35. package/dist/functions/algorithm/longestIncreasingSubsequence.js +49 -0
  36. package/dist/functions/algorithm/longestIncreasingSubsequence.js.map +1 -0
  37. package/dist/functions/algorithm/maxArea.d.ts +1 -0
  38. package/dist/functions/algorithm/maxArea.js +19 -0
  39. package/dist/functions/algorithm/maxArea.js.map +1 -0
  40. package/dist/functions/algorithm/maxProfit.d.ts +2 -0
  41. package/dist/functions/algorithm/maxProfit.js +23 -0
  42. package/dist/functions/algorithm/maxProfit.js.map +1 -0
  43. package/dist/functions/algorithm/meetingRooms.d.ts +6 -0
  44. package/dist/functions/algorithm/meetingRooms.js +31 -0
  45. package/dist/functions/algorithm/meetingRooms.js.map +1 -0
  46. package/dist/functions/algorithm/mergeSort.d.ts +2 -0
  47. package/dist/functions/algorithm/mergeSort.js +72 -0
  48. package/dist/functions/algorithm/mergeSort.js.map +1 -0
  49. package/dist/functions/algorithm/minPathSum.d.ts +2 -0
  50. package/dist/functions/algorithm/minPathSum.js +39 -0
  51. package/dist/functions/algorithm/minPathSum.js.map +1 -0
  52. package/dist/functions/algorithm/minWindow.d.ts +1 -0
  53. package/dist/functions/algorithm/minWindow.js +40 -0
  54. package/dist/functions/algorithm/minWindow.js.map +1 -0
  55. package/dist/functions/algorithm/nQueens.d.ts +1 -0
  56. package/dist/functions/algorithm/nQueens.js +30 -0
  57. package/dist/functions/algorithm/nQueens.js.map +1 -0
  58. package/dist/functions/algorithm/numIslands.d.ts +2 -0
  59. package/dist/functions/algorithm/numIslands.js +59 -0
  60. package/dist/functions/algorithm/numIslands.js.map +1 -0
  61. package/dist/functions/algorithm/permutations.d.ts +1 -0
  62. package/dist/functions/algorithm/permutations.js +22 -0
  63. package/dist/functions/algorithm/permutations.js.map +1 -0
  64. package/dist/functions/algorithm/quickSort.d.ts +3 -0
  65. package/dist/functions/algorithm/quickSort.js +68 -0
  66. package/dist/functions/algorithm/quickSort.js.map +1 -0
  67. package/dist/functions/algorithm/rabinKarp.d.ts +1 -0
  68. package/dist/functions/algorithm/rabinKarp.js +40 -0
  69. package/dist/functions/algorithm/rabinKarp.js.map +1 -0
  70. package/dist/functions/algorithm/taskScheduler.d.ts +1 -0
  71. package/dist/functions/algorithm/taskScheduler.js +15 -0
  72. package/dist/functions/algorithm/taskScheduler.js.map +1 -0
  73. package/dist/functions/algorithm/threeSum.d.ts +2 -0
  74. package/dist/functions/algorithm/threeSum.js +56 -0
  75. package/dist/functions/algorithm/threeSum.js.map +1 -0
  76. package/dist/functions/algorithm/topologicalSort.d.ts +6 -0
  77. package/dist/functions/algorithm/topologicalSort.js +68 -0
  78. package/dist/functions/algorithm/topologicalSort.js.map +1 -0
  79. package/dist/functions/algorithm/trap.d.ts +2 -0
  80. package/dist/functions/algorithm/trap.js +51 -0
  81. package/dist/functions/algorithm/trap.js.map +1 -0
  82. package/dist/functions/array-object/chunk.d.ts +1 -0
  83. package/dist/functions/array-object/chunk.js +11 -0
  84. package/dist/functions/array-object/chunk.js.map +1 -0
  85. package/dist/functions/array-object/deepClone.d.ts +12 -0
  86. package/dist/functions/array-object/deepClone.js +131 -0
  87. package/dist/functions/array-object/deepClone.js.map +1 -0
  88. package/dist/functions/array-object/evolve.d.ts +3 -0
  89. package/dist/functions/array-object/evolve.js +15 -0
  90. package/dist/functions/array-object/evolve.js.map +1 -0
  91. package/dist/functions/array-object/flatten.d.ts +7 -0
  92. package/dist/functions/array-object/flatten.js +60 -0
  93. package/dist/functions/array-object/flatten.js.map +1 -0
  94. package/dist/functions/array-object/flattenObject.d.ts +5 -0
  95. package/dist/functions/array-object/flattenObject.js +102 -0
  96. package/dist/functions/array-object/flattenObject.js.map +1 -0
  97. package/dist/functions/array-object/groupBy.d.ts +1 -0
  98. package/dist/functions/array-object/groupBy.js +14 -0
  99. package/dist/functions/array-object/groupBy.js.map +1 -0
  100. package/dist/functions/array-object/omit.d.ts +1 -0
  101. package/dist/functions/array-object/omit.js +8 -0
  102. package/dist/functions/array-object/omit.js.map +1 -0
  103. package/dist/functions/array-object/pick.d.ts +1 -0
  104. package/dist/functions/array-object/pick.js +10 -0
  105. package/dist/functions/array-object/pick.js.map +1 -0
  106. package/dist/functions/array-object/shuffle.d.ts +1 -0
  107. package/dist/functions/array-object/shuffle.js +9 -0
  108. package/dist/functions/array-object/shuffle.js.map +1 -0
  109. package/dist/functions/array-object/sortBy.d.ts +1 -0
  110. package/dist/functions/array-object/sortBy.js +13 -0
  111. package/dist/functions/array-object/sortBy.js.map +1 -0
  112. package/dist/functions/array-object/unique.d.ts +10 -0
  113. package/dist/functions/array-object/unique.js +85 -0
  114. package/dist/functions/array-object/unique.js.map +1 -0
  115. package/dist/functions/async/cachedAsync.d.ts +27 -0
  116. package/dist/functions/async/cachedAsync.js +123 -0
  117. package/dist/functions/async/cachedAsync.js.map +1 -0
  118. package/dist/functions/async/promiseLimit.d.ts +10 -0
  119. package/dist/functions/async/promiseLimit.js +125 -0
  120. package/dist/functions/async/promiseLimit.js.map +1 -0
  121. package/dist/functions/async/retryWithBackoff.d.ts +12 -0
  122. package/dist/functions/async/retryWithBackoff.js +29 -0
  123. package/dist/functions/async/retryWithBackoff.js.map +1 -0
  124. package/dist/functions/browser/detectBrowser.d.ts +39 -0
  125. package/dist/functions/browser/detectBrowser.js +193 -0
  126. package/dist/functions/browser/detectBrowser.js.map +1 -0
  127. package/dist/functions/browser/detectOS.d.ts +5 -0
  128. package/dist/functions/browser/detectOS.js +20 -0
  129. package/dist/functions/browser/detectOS.js.map +1 -0
  130. package/dist/functions/browser/isMobile.d.ts +6 -0
  131. package/dist/functions/browser/isMobile.js +5 -0
  132. package/dist/functions/browser/isMobile.js.map +1 -0
  133. package/dist/functions/data-structures/AVLTree.d.ts +19 -0
  134. package/dist/functions/data-structures/AVLTree.js +197 -0
  135. package/dist/functions/data-structures/AVLTree.js.map +1 -0
  136. package/dist/functions/data-structures/BinarySearchTree.d.ts +19 -0
  137. package/dist/functions/data-structures/BinarySearchTree.js +150 -0
  138. package/dist/functions/data-structures/BinarySearchTree.js.map +1 -0
  139. package/dist/functions/data-structures/Graph.d.ts +19 -0
  140. package/dist/functions/data-structures/Graph.js +190 -0
  141. package/dist/functions/data-structures/Graph.js.map +1 -0
  142. package/dist/functions/data-structures/HashMap.d.ts +13 -0
  143. package/dist/functions/data-structures/HashMap.js +128 -0
  144. package/dist/functions/data-structures/HashMap.js.map +1 -0
  145. package/dist/functions/data-structures/Heap.d.ts +11 -0
  146. package/dist/functions/data-structures/Heap.js +91 -0
  147. package/dist/functions/data-structures/Heap.js.map +1 -0
  148. package/dist/functions/data-structures/LRUCache.d.ts +41 -0
  149. package/dist/functions/data-structures/LRUCache.js +182 -0
  150. package/dist/functions/data-structures/LRUCache.js.map +1 -0
  151. package/dist/functions/data-structures/LinkedList.d.ts +18 -0
  152. package/dist/functions/data-structures/LinkedList.js +135 -0
  153. package/dist/functions/data-structures/LinkedList.js.map +1 -0
  154. package/dist/functions/data-structures/PriorityQueue.d.ts +14 -0
  155. package/dist/functions/data-structures/PriorityQueue.js +77 -0
  156. package/dist/functions/data-structures/PriorityQueue.js.map +1 -0
  157. package/dist/functions/data-structures/Queue.d.ts +10 -0
  158. package/dist/functions/data-structures/Queue.js +27 -0
  159. package/dist/functions/data-structures/Queue.js.map +1 -0
  160. package/dist/functions/data-structures/Stack.d.ts +10 -0
  161. package/dist/functions/data-structures/Stack.js +27 -0
  162. package/dist/functions/data-structures/Stack.js.map +1 -0
  163. package/dist/functions/data-structures/Trie.d.ts +16 -0
  164. package/dist/functions/data-structures/Trie.js +127 -0
  165. package/dist/functions/data-structures/Trie.js.map +1 -0
  166. package/dist/functions/data-structures/UnionFind.d.ts +8 -0
  167. package/dist/functions/data-structures/UnionFind.js +53 -0
  168. package/dist/functions/data-structures/UnionFind.js.map +1 -0
  169. package/dist/functions/date/dateRange.d.ts +1 -0
  170. package/dist/functions/date/dateRange.js +18 -0
  171. package/dist/functions/date/dateRange.js.map +1 -0
  172. package/dist/functions/date/formatDate.d.ts +1 -0
  173. package/dist/functions/date/formatDate.js +21 -0
  174. package/dist/functions/date/formatDate.js.map +1 -0
  175. package/dist/functions/date/timeAgo.d.ts +1 -0
  176. package/dist/functions/date/timeAgo.js +49 -0
  177. package/dist/functions/date/timeAgo.js.map +1 -0
  178. package/dist/functions/design-tokens/buildTokens.d.ts +76 -0
  179. package/dist/functions/design-tokens/buildTokens.js +183 -0
  180. package/dist/functions/design-tokens/buildTokens.js.map +1 -0
  181. package/dist/functions/design-tokens/generateVariables.d.ts +7 -0
  182. package/dist/functions/design-tokens/generateVariables.js +135 -0
  183. package/dist/functions/design-tokens/generateVariables.js.map +1 -0
  184. package/dist/functions/design-tokens/mixColors.d.ts +1 -0
  185. package/dist/functions/design-tokens/mixColors.js +38 -0
  186. package/dist/functions/design-tokens/mixColors.js.map +1 -0
  187. package/dist/functions/design-tokens/parseDesignTokens.d.ts +10 -0
  188. package/dist/functions/design-tokens/parseDesignTokens.js +216 -0
  189. package/dist/functions/design-tokens/parseDesignTokens.js.map +1 -0
  190. package/dist/functions/file/formatFileSize.d.ts +1 -0
  191. package/dist/functions/file/formatFileSize.js +16 -0
  192. package/dist/functions/file/formatFileSize.js.map +1 -0
  193. package/dist/functions/file/getFileExtension.d.ts +5 -0
  194. package/dist/functions/file/getFileExtension.js +18 -0
  195. package/dist/functions/file/getFileExtension.js.map +1 -0
  196. package/dist/functions/functional/compose.d.ts +1 -0
  197. package/dist/functions/functional/compose.js +10 -0
  198. package/dist/functions/functional/compose.js.map +1 -0
  199. package/dist/functions/functional/cond.d.ts +1 -0
  200. package/dist/functions/functional/cond.js +15 -0
  201. package/dist/functions/functional/cond.js.map +1 -0
  202. package/dist/functions/functional/curry.d.ts +1 -0
  203. package/dist/functions/functional/curry.js +13 -0
  204. package/dist/functions/functional/curry.js.map +1 -0
  205. package/dist/functions/functional/curryAdvanced.d.ts +8 -0
  206. package/dist/functions/functional/curryAdvanced.js +87 -0
  207. package/dist/functions/functional/curryAdvanced.js.map +1 -0
  208. package/dist/functions/functional/flow.d.ts +1 -0
  209. package/dist/functions/functional/flow.js +14 -0
  210. package/dist/functions/functional/flow.js.map +1 -0
  211. package/dist/functions/functional/partial.d.ts +1 -0
  212. package/dist/functions/functional/partial.js +13 -0
  213. package/dist/functions/functional/partial.js.map +1 -0
  214. package/dist/functions/functional/pipe.d.ts +1 -0
  215. package/dist/functions/functional/pipe.js +10 -0
  216. package/dist/functions/functional/pipe.js.map +1 -0
  217. package/dist/functions/functional/tap.d.ts +1 -0
  218. package/dist/functions/functional/tap.js +14 -0
  219. package/dist/functions/functional/tap.js.map +1 -0
  220. package/dist/functions/functional/until.d.ts +1 -0
  221. package/dist/functions/functional/until.js +10 -0
  222. package/dist/functions/functional/until.js.map +1 -0
  223. package/dist/functions/math/average.d.ts +1 -0
  224. package/dist/functions/math/average.js +8 -0
  225. package/dist/functions/math/average.js.map +1 -0
  226. package/dist/functions/math/median.d.ts +1 -0
  227. package/dist/functions/math/median.js +14 -0
  228. package/dist/functions/math/median.js.map +1 -0
  229. package/dist/functions/math/percentile.d.ts +1 -0
  230. package/dist/functions/math/percentile.js +18 -0
  231. package/dist/functions/math/percentile.js.map +1 -0
  232. package/dist/functions/math/sum.d.ts +1 -0
  233. package/dist/functions/math/sum.js +4 -0
  234. package/dist/functions/math/sum.js.map +1 -0
  235. package/dist/functions/number/clamp.d.ts +1 -0
  236. package/dist/functions/number/clamp.js +7 -0
  237. package/dist/functions/number/clamp.js.map +1 -0
  238. package/dist/functions/number/formatNumber.d.ts +8 -0
  239. package/dist/functions/number/formatNumber.js +16 -0
  240. package/dist/functions/number/formatNumber.js.map +1 -0
  241. package/dist/functions/number/random.d.ts +4 -0
  242. package/dist/functions/number/random.js +9 -0
  243. package/dist/functions/number/random.js.map +1 -0
  244. package/dist/functions/number/range.d.ts +1 -0
  245. package/dist/functions/number/range.js +18 -0
  246. package/dist/functions/number/range.js.map +1 -0
  247. package/dist/functions/patterns/EventEmitter.d.ts +32 -0
  248. package/dist/functions/patterns/EventEmitter.js +108 -0
  249. package/dist/functions/patterns/EventEmitter.js.map +1 -0
  250. package/dist/functions/patterns/adapter.d.ts +8 -0
  251. package/dist/functions/patterns/adapter.js +14 -0
  252. package/dist/functions/patterns/adapter.js.map +1 -0
  253. package/dist/functions/patterns/builder.d.ts +9 -0
  254. package/dist/functions/patterns/builder.js +28 -0
  255. package/dist/functions/patterns/builder.js.map +1 -0
  256. package/dist/functions/patterns/chainOfResponsibility.d.ts +9 -0
  257. package/dist/functions/patterns/chainOfResponsibility.js +19 -0
  258. package/dist/functions/patterns/chainOfResponsibility.js.map +1 -0
  259. package/dist/functions/patterns/command.d.ts +15 -0
  260. package/dist/functions/patterns/command.js +49 -0
  261. package/dist/functions/patterns/command.js.map +1 -0
  262. package/dist/functions/patterns/decorator.d.ts +10 -0
  263. package/dist/functions/patterns/decorator.js +72 -0
  264. package/dist/functions/patterns/decorator.js.map +1 -0
  265. package/dist/functions/patterns/factory.d.ts +8 -0
  266. package/dist/functions/patterns/factory.js +25 -0
  267. package/dist/functions/patterns/factory.js.map +1 -0
  268. package/dist/functions/patterns/observer.d.ts +19 -0
  269. package/dist/functions/patterns/observer.js +89 -0
  270. package/dist/functions/patterns/observer.js.map +1 -0
  271. package/dist/functions/patterns/prototype.d.ts +4 -0
  272. package/dist/functions/patterns/prototype.js +30 -0
  273. package/dist/functions/patterns/prototype.js.map +1 -0
  274. package/dist/functions/patterns/proxy.d.ts +8 -0
  275. package/dist/functions/patterns/proxy.js +41 -0
  276. package/dist/functions/patterns/proxy.js.map +1 -0
  277. package/dist/functions/patterns/singleton.d.ts +11 -0
  278. package/dist/functions/patterns/singleton.js +32 -0
  279. package/dist/functions/patterns/singleton.js.map +1 -0
  280. package/dist/functions/patterns/strategy.d.ts +12 -0
  281. package/dist/functions/patterns/strategy.js +34 -0
  282. package/dist/functions/patterns/strategy.js.map +1 -0
  283. package/dist/functions/patterns/templateMethod.d.ts +8 -0
  284. package/dist/functions/patterns/templateMethod.js +19 -0
  285. package/dist/functions/patterns/templateMethod.js.map +1 -0
  286. package/dist/functions/patterns/usePluginSystem.d.ts +11 -0
  287. package/dist/functions/patterns/usePluginSystem.js +34 -0
  288. package/dist/functions/patterns/usePluginSystem.js.map +1 -0
  289. package/dist/functions/performance/debounce.d.ts +5 -0
  290. package/dist/functions/performance/debounce.js +12 -0
  291. package/dist/functions/performance/debounce.js.map +1 -0
  292. package/dist/functions/performance/memoize.d.ts +1 -0
  293. package/dist/functions/performance/memoize.js +13 -0
  294. package/dist/functions/performance/memoize.js.map +1 -0
  295. package/dist/functions/performance/once.d.ts +1 -0
  296. package/dist/functions/performance/once.js +13 -0
  297. package/dist/functions/performance/once.js.map +1 -0
  298. package/dist/functions/performance/throttle.d.ts +1 -0
  299. package/dist/functions/performance/throttle.js +11 -0
  300. package/dist/functions/performance/throttle.js.map +1 -0
  301. package/dist/functions/performance/useCache.d.ts +18 -0
  302. package/dist/functions/performance/useCache.js +82 -0
  303. package/dist/functions/performance/useCache.js.map +1 -0
  304. package/dist/functions/platform/tencent-cloud/deploy.tcb.d.ts +13 -0
  305. package/dist/functions/platform/tencent-cloud/deploy.tcb.js +46 -0
  306. package/dist/functions/platform/tencent-cloud/deploy.tcb.js.map +1 -0
  307. package/dist/functions/platform/tencent-cloud/getSecret.d.ts +4 -0
  308. package/dist/functions/platform/tencent-cloud/getSecret.js +19 -0
  309. package/dist/functions/platform/tencent-cloud/getSecret.js.map +1 -0
  310. package/dist/functions/platform/uniapp/app-plus/buildAndroidApp.d.ts +27 -0
  311. package/dist/functions/platform/uniapp/app-plus/buildAndroidApp.js +287 -0
  312. package/dist/functions/platform/uniapp/app-plus/buildAndroidApp.js.map +1 -0
  313. package/dist/functions/platform/uniapp/build.d.ts +21 -0
  314. package/dist/functions/platform/uniapp/build.js +83 -0
  315. package/dist/functions/platform/uniapp/build.js.map +1 -0
  316. package/dist/functions/platform/uniapp/detectAndroidProjectStructure.d.ts +11 -0
  317. package/dist/functions/platform/uniapp/detectAndroidProjectStructure.js +30 -0
  318. package/dist/functions/platform/uniapp/detectAndroidProjectStructure.js.map +1 -0
  319. package/dist/functions/platform/uniapp/detectProjectType.d.ts +20 -0
  320. package/dist/functions/platform/uniapp/detectProjectType.js +68 -0
  321. package/dist/functions/platform/uniapp/detectProjectType.js.map +1 -0
  322. package/dist/functions/platform/uniapp/parseManifest.d.ts +18 -0
  323. package/dist/functions/platform/uniapp/parseManifest.js +49 -0
  324. package/dist/functions/platform/uniapp/parseManifest.js.map +1 -0
  325. package/dist/functions/platform/uniapp/waitForPages.d.ts +7 -0
  326. package/dist/functions/platform/uniapp/waitForPages.js +20 -0
  327. package/dist/functions/platform/uniapp/waitForPages.js.map +1 -0
  328. package/dist/functions/principles/MyPromise.d.ts +32 -0
  329. package/dist/functions/principles/MyPromise.js +254 -0
  330. package/dist/functions/principles/MyPromise.js.map +1 -0
  331. package/dist/functions/principles/functionBind.d.ts +4 -0
  332. package/dist/functions/principles/functionBind.js +33 -0
  333. package/dist/functions/principles/functionBind.js.map +1 -0
  334. package/dist/functions/principles/myInstanceof.d.ts +5 -0
  335. package/dist/functions/principles/myInstanceof.js +56 -0
  336. package/dist/functions/principles/myInstanceof.js.map +1 -0
  337. package/dist/functions/principles/myNew.d.ts +3 -0
  338. package/dist/functions/principles/myNew.js +19 -0
  339. package/dist/functions/principles/myNew.js.map +1 -0
  340. package/dist/functions/promise/sleep.d.ts +5 -0
  341. package/dist/functions/promise/sleep.js +6 -0
  342. package/dist/functions/promise/sleep.js.map +1 -0
  343. package/dist/functions/promise/timeout.d.ts +6 -0
  344. package/dist/functions/promise/timeout.js +12 -0
  345. package/dist/functions/promise/timeout.js.map +1 -0
  346. package/dist/functions/storage/useLocalStorage.d.ts +8 -0
  347. package/dist/functions/storage/useLocalStorage.js +101 -0
  348. package/dist/functions/storage/useLocalStorage.js.map +1 -0
  349. package/dist/functions/storage/useSessionStorage.d.ts +8 -0
  350. package/dist/functions/storage/useSessionStorage.js +101 -0
  351. package/dist/functions/storage/useSessionStorage.js.map +1 -0
  352. package/dist/functions/storage/useStorage.d.ts +13 -0
  353. package/dist/functions/storage/useStorage.js +62 -0
  354. package/dist/functions/storage/useStorage.js.map +1 -0
  355. package/dist/functions/storage/useStorageWithIndexedDB.d.ts +8 -0
  356. package/dist/functions/storage/useStorageWithIndexedDB.js +132 -0
  357. package/dist/functions/storage/useStorageWithIndexedDB.js.map +1 -0
  358. package/dist/functions/tencent-cloud/upload.cos.d.ts +20 -0
  359. package/dist/functions/tencent-cloud/upload.cos.js +119 -0
  360. package/dist/functions/tencent-cloud/upload.cos.js.map +1 -0
  361. package/dist/functions/tree/buildTree.d.ts +7 -0
  362. package/dist/functions/tree/buildTree.js +27 -0
  363. package/dist/functions/tree/buildTree.js.map +1 -0
  364. package/dist/functions/tree/filterTree.d.ts +4 -0
  365. package/dist/functions/tree/filterTree.js +21 -0
  366. package/dist/functions/tree/filterTree.js.map +1 -0
  367. package/dist/functions/tree/findNode.d.ts +4 -0
  368. package/dist/functions/tree/findNode.js +21 -0
  369. package/dist/functions/tree/findNode.js.map +1 -0
  370. package/dist/functions/tree/flattenTree.d.ts +6 -0
  371. package/dist/functions/tree/flattenTree.js +21 -0
  372. package/dist/functions/tree/flattenTree.js.map +1 -0
  373. package/dist/functions/url/buildQueryString.d.ts +5 -0
  374. package/dist/functions/url/buildQueryString.js +15 -0
  375. package/dist/functions/url/buildQueryString.js.map +1 -0
  376. package/dist/functions/url/parseUrl.d.ts +11 -0
  377. package/dist/functions/url/parseUrl.js +34 -0
  378. package/dist/functions/url/parseUrl.js.map +1 -0
  379. package/dist/functions/utils/cachedAsync.d.ts +27 -0
  380. package/dist/functions/utils/cachedAsync.js +123 -0
  381. package/dist/functions/utils/cachedAsync.js.map +1 -0
  382. package/dist/functions/utils/createI18n.d.ts +2 -0
  383. package/dist/functions/utils/createI18n.js +97 -0
  384. package/dist/functions/utils/createI18n.js.map +1 -0
  385. package/dist/functions/utils/createReactive.d.ts +10 -0
  386. package/dist/functions/utils/createReactive.js +50 -0
  387. package/dist/functions/utils/createReactive.js.map +1 -0
  388. package/dist/functions/utils/diff.d.ts +25 -0
  389. package/dist/functions/utils/diff.js +316 -0
  390. package/dist/functions/utils/diff.js.map +1 -0
  391. package/dist/functions/utils/errorManager.d.ts +63 -0
  392. package/dist/functions/utils/errorManager.js +199 -0
  393. package/dist/functions/utils/errorManager.js.map +1 -0
  394. package/dist/functions/utils/formatString.d.ts +5 -0
  395. package/dist/functions/utils/formatString.js +9 -0
  396. package/dist/functions/utils/formatString.js.map +1 -0
  397. package/dist/functions/utils/i18n.d.ts +27 -0
  398. package/dist/functions/utils/i18n.js +119 -0
  399. package/dist/functions/utils/i18n.js.map +1 -0
  400. package/dist/functions/utils/permission.d.ts +40 -0
  401. package/dist/functions/utils/permission.js +189 -0
  402. package/dist/functions/utils/permission.js.map +1 -0
  403. package/dist/functions/utils/pinia.d.ts +52 -0
  404. package/dist/functions/utils/pinia.js +183 -0
  405. package/dist/functions/utils/pinia.js.map +1 -0
  406. package/dist/functions/utils/useAltool.d.ts +39 -0
  407. package/dist/functions/utils/useAltool.js +350 -0
  408. package/dist/functions/utils/useAltool.js.map +1 -0
  409. package/dist/functions/utils/vueDiff.d.ts +38 -0
  410. package/dist/functions/utils/vueDiff.js +333 -0
  411. package/dist/functions/utils/vueDiff.js.map +1 -0
  412. package/dist/functions/validation/isEmail.d.ts +1 -0
  413. package/dist/functions/validation/isEmail.js +8 -0
  414. package/dist/functions/validation/isEmail.js.map +1 -0
  415. package/dist/functions/validation/isIdCard.d.ts +1 -0
  416. package/dist/functions/validation/isIdCard.js +49 -0
  417. package/dist/functions/validation/isIdCard.js.map +1 -0
  418. package/dist/functions/validation/isIpAddress.d.ts +1 -0
  419. package/dist/functions/validation/isIpAddress.js +15 -0
  420. package/dist/functions/validation/isIpAddress.js.map +1 -0
  421. package/dist/functions/validation/isPhone.d.ts +1 -0
  422. package/dist/functions/validation/isPhone.js +12 -0
  423. package/dist/functions/validation/isPhone.js.map +1 -0
  424. package/dist/functions/validation/isUrl.d.ts +5 -0
  425. package/dist/functions/validation/isUrl.js +33 -0
  426. package/dist/functions/validation/isUrl.js.map +1 -0
  427. package/dist/hooks/usePermission.d.ts +7 -0
  428. package/dist/hooks/usePermission.js +123 -0
  429. package/dist/hooks/usePermission.js.map +1 -0
  430. package/dist/reactive/createReactive.d.ts +10 -0
  431. package/dist/reactive/createReactive.js +50 -0
  432. package/dist/reactive/createReactive.js.map +1 -0
  433. package/dist/reactive/createReactiveErrorManager.d.ts +63 -0
  434. package/dist/reactive/createReactiveErrorManager.js +199 -0
  435. package/dist/reactive/createReactiveErrorManager.js.map +1 -0
  436. package/dist/reactive/createReactiveI18n.d.ts +27 -0
  437. package/dist/reactive/createReactiveI18n.js +119 -0
  438. package/dist/reactive/createReactiveI18n.js.map +1 -0
  439. package/dist/reactive/createReactivePermission.d.ts +40 -0
  440. package/dist/reactive/createReactivePermission.js +189 -0
  441. package/dist/reactive/createReactivePermission.js.map +1 -0
  442. package/dist/reactive/createReactivePinia.d.ts +52 -0
  443. package/dist/reactive/createReactivePinia.js +183 -0
  444. package/dist/reactive/createReactivePinia.js.map +1 -0
  445. package/dist/reactive/useReactiveCookie.d.ts +19 -0
  446. package/dist/reactive/useReactiveCookie.js +84 -0
  447. package/dist/reactive/useReactiveCookie.js.map +1 -0
  448. package/dist/vue-hooks/browser/useBattery.d.ts +16 -0
  449. package/dist/vue-hooks/browser/useBattery.js +70 -0
  450. package/dist/vue-hooks/browser/useBattery.js.map +1 -0
  451. package/dist/vue-hooks/browser/useBluetooth.d.ts +25 -0
  452. package/dist/vue-hooks/browser/useBluetooth.js +72 -0
  453. package/dist/vue-hooks/browser/useBluetooth.js.map +1 -0
  454. package/dist/vue-hooks/browser/useCamera.d.ts +21 -0
  455. package/dist/vue-hooks/browser/useCamera.js +52 -0
  456. package/dist/vue-hooks/browser/useCamera.js.map +1 -0
  457. package/dist/vue-hooks/browser/useClipboard.d.ts +18 -0
  458. package/dist/vue-hooks/browser/useClipboard.js +33 -0
  459. package/dist/vue-hooks/browser/useClipboard.js.map +1 -0
  460. package/dist/vue-hooks/browser/useFullscreen.d.ts +20 -0
  461. package/dist/vue-hooks/browser/useFullscreen.js +73 -0
  462. package/dist/vue-hooks/browser/useFullscreen.js.map +1 -0
  463. package/dist/vue-hooks/browser/useGamepad.d.ts +25 -0
  464. package/dist/vue-hooks/browser/useGamepad.js +69 -0
  465. package/dist/vue-hooks/browser/useGamepad.js.map +1 -0
  466. package/dist/vue-hooks/browser/useGeolocation.d.ts +24 -0
  467. package/dist/vue-hooks/browser/useGeolocation.js +85 -0
  468. package/dist/vue-hooks/browser/useGeolocation.js.map +1 -0
  469. package/dist/vue-hooks/browser/useMediaSession.d.ts +19 -0
  470. package/dist/vue-hooks/browser/useMediaSession.js +71 -0
  471. package/dist/vue-hooks/browser/useMediaSession.js.map +1 -0
  472. package/dist/vue-hooks/browser/useMicrophone.d.ts +23 -0
  473. package/dist/vue-hooks/browser/useMicrophone.js +66 -0
  474. package/dist/vue-hooks/browser/useMicrophone.js.map +1 -0
  475. package/dist/vue-hooks/browser/useNetwork.d.ts +23 -0
  476. package/dist/vue-hooks/browser/useNetwork.js +57 -0
  477. package/dist/vue-hooks/browser/useNetwork.js.map +1 -0
  478. package/dist/vue-hooks/browser/useOrientation.d.ts +22 -0
  479. package/dist/vue-hooks/browser/useOrientation.js +54 -0
  480. package/dist/vue-hooks/browser/useOrientation.js.map +1 -0
  481. package/dist/vue-hooks/browser/usePageVisibility.d.ts +15 -0
  482. package/dist/vue-hooks/browser/usePageVisibility.js +25 -0
  483. package/dist/vue-hooks/browser/usePageVisibility.js.map +1 -0
  484. package/dist/vue-hooks/browser/useScreenOrientation.d.ts +24 -0
  485. package/dist/vue-hooks/browser/useScreenOrientation.js +67 -0
  486. package/dist/vue-hooks/browser/useScreenOrientation.js.map +1 -0
  487. package/dist/vue-hooks/browser/useScreenWakeLock.d.ts +15 -0
  488. package/dist/vue-hooks/browser/useScreenWakeLock.js +57 -0
  489. package/dist/vue-hooks/browser/useScreenWakeLock.js.map +1 -0
  490. package/dist/vue-hooks/browser/useShare.d.ts +21 -0
  491. package/dist/vue-hooks/browser/useShare.js +39 -0
  492. package/dist/vue-hooks/browser/useShare.js.map +1 -0
  493. package/dist/vue-hooks/browser/useVibration.d.ts +17 -0
  494. package/dist/vue-hooks/browser/useVibration.js +40 -0
  495. package/dist/vue-hooks/browser/useVibration.js.map +1 -0
  496. package/dist/vue-hooks/dom/useClickOutside.d.ts +9 -0
  497. package/dist/vue-hooks/dom/useClickOutside.js +16 -0
  498. package/dist/vue-hooks/dom/useClickOutside.js.map +1 -0
  499. package/dist/vue-hooks/dom/useDraggable.d.ts +33 -0
  500. package/dist/vue-hooks/dom/useDraggable.js +163 -0
  501. package/dist/vue-hooks/dom/useDraggable.js.map +1 -0
  502. package/dist/vue-hooks/dom/useEventListener.d.ts +11 -0
  503. package/dist/vue-hooks/dom/useEventListener.js +18 -0
  504. package/dist/vue-hooks/dom/useEventListener.js.map +1 -0
  505. package/dist/vue-hooks/dom/useResizable.d.ts +50 -0
  506. package/dist/vue-hooks/dom/useResizable.js +178 -0
  507. package/dist/vue-hooks/dom/useResizable.js.map +1 -0
  508. package/dist/vue-hooks/history/useDebouncedRefHistory.d.ts +17 -0
  509. package/dist/vue-hooks/history/useDebouncedRefHistory.js +46 -0
  510. package/dist/vue-hooks/history/useDebouncedRefHistory.js.map +1 -0
  511. package/dist/vue-hooks/history/useManualRefHistory.d.ts +26 -0
  512. package/dist/vue-hooks/history/useManualRefHistory.js +80 -0
  513. package/dist/vue-hooks/history/useManualRefHistory.js.map +1 -0
  514. package/dist/vue-hooks/history/useRefHistory.d.ts +15 -0
  515. package/dist/vue-hooks/history/useRefHistory.js +41 -0
  516. package/dist/vue-hooks/history/useRefHistory.js.map +1 -0
  517. package/dist/vue-hooks/state/createGlobalState.d.ts +2 -0
  518. package/dist/vue-hooks/state/createGlobalState.js +11 -0
  519. package/dist/vue-hooks/state/createGlobalState.js.map +1 -0
  520. package/dist/vue-hooks/state/createInjectionState.d.ts +10 -0
  521. package/dist/vue-hooks/state/createInjectionState.js +20 -0
  522. package/dist/vue-hooks/state/createInjectionState.js.map +1 -0
  523. package/dist/vue-hooks/state/createSharedComposable.d.ts +2 -0
  524. package/dist/vue-hooks/state/createSharedComposable.js +13 -0
  525. package/dist/vue-hooks/state/createSharedComposable.js.map +1 -0
  526. package/dist/vue-hooks/state/injectLocal.d.ts +8 -0
  527. package/dist/vue-hooks/state/injectLocal.js +12 -0
  528. package/dist/vue-hooks/state/injectLocal.js.map +1 -0
  529. package/dist/vue-hooks/state/provideLocal.d.ts +7 -0
  530. package/dist/vue-hooks/state/provideLocal.js +7 -0
  531. package/dist/vue-hooks/state/provideLocal.js.map +1 -0
  532. package/dist/vue-hooks/state/useAsyncState.d.ts +27 -0
  533. package/dist/vue-hooks/state/useAsyncState.js +46 -0
  534. package/dist/vue-hooks/state/useAsyncState.js.map +1 -0
  535. package/dist/vue-hooks/state/useCounter.d.ts +17 -0
  536. package/dist/vue-hooks/state/useCounter.js +44 -0
  537. package/dist/vue-hooks/state/useCounter.js.map +1 -0
  538. package/dist/vue-hooks/state/useToggle.d.ts +13 -0
  539. package/dist/vue-hooks/state/useToggle.js +23 -0
  540. package/dist/vue-hooks/state/useToggle.js.map +1 -0
  541. package/dist/vue-hooks/time/useInterval.d.ts +16 -0
  542. package/dist/vue-hooks/time/useInterval.js +33 -0
  543. package/dist/vue-hooks/time/useInterval.js.map +1 -0
  544. package/dist/vue-hooks/time/useTimeout.d.ts +17 -0
  545. package/dist/vue-hooks/time/useTimeout.js +40 -0
  546. package/dist/vue-hooks/time/useTimeout.js.map +1 -0
  547. package/dist/vue-hooks/worker/useWebWorker.d.ts +25 -0
  548. package/dist/vue-hooks/worker/useWebWorker.js +207 -0
  549. package/dist/vue-hooks/worker/useWebWorker.js.map +1 -0
  550. package/dist/vue-hooks/worker/useWorkerFunction.d.ts +26 -0
  551. package/dist/vue-hooks/worker/useWorkerFunction.js +191 -0
  552. package/dist/vue-hooks/worker/useWorkerFunction.js.map +1 -0
  553. package/dist/vue-hooks/worker/useWorkerPool.d.ts +33 -0
  554. package/dist/vue-hooks/worker/useWorkerPool.js +247 -0
  555. package/dist/vue-hooks/worker/useWorkerPool.js.map +1 -0
  556. package/package.json +175 -60
  557. package/references/browser.d.ts +12 -0
  558. package/references/device.d.ts +340 -0
  559. package/references/dom.d.ts +31 -6
  560. package/references/node.d.ts +2 -0
  561. package/references/tencent-cloud.d.ts +38 -0
  562. package/references/xlsx.d.ts +51 -0
  563. package/types/algorithm-visual.d.ts +79 -0
  564. package/types/algorithm.d.ts +85 -0
  565. package/types/reactive.d.ts +67 -0
  566. package/types/tencent-cloud.d.ts +29 -0
  567. package/types/vue.d.ts +22 -0
@@ -0,0 +1,340 @@
1
+ /**
2
+ * 设备 API 类型定义
3
+ * 包含浏览器端设备相关的 Web API 接口
4
+ */
5
+
6
+ // 蓝牙相关类型
7
+ export interface BluetoothDevice {
8
+ id: string
9
+ name?: string
10
+ gatt?: BluetoothRemoteGATTServer
11
+ watchAdvertisements(): Promise<void>
12
+ unwatchAdvertisements(): void
13
+ addEventListener(type: string, listener: EventListener): void
14
+ removeEventListener(type: string, listener: EventListener): void
15
+ }
16
+
17
+ export interface BluetoothRemoteGATTServer {
18
+ device: BluetoothDevice
19
+ connected: boolean
20
+ connect(): Promise<BluetoothRemoteGATTServer>
21
+ disconnect(): void
22
+ getPrimaryService(service: string): Promise<BluetoothRemoteGATTService>
23
+ getPrimaryServices(service?: string): Promise<BluetoothRemoteGATTService[]>
24
+ }
25
+
26
+ export interface BluetoothRemoteGATTService {
27
+ device: BluetoothDevice
28
+ uuid: string
29
+ isPrimary: boolean
30
+ getCharacteristic(characteristic: string): Promise<BluetoothRemoteGATTCharacteristic>
31
+ getCharacteristics(characteristic?: string): Promise<BluetoothRemoteGATTCharacteristic[]>
32
+ }
33
+
34
+ export interface BluetoothRemoteGATTCharacteristic {
35
+ service: BluetoothRemoteGATTService
36
+ uuid: string
37
+ value?: DataView
38
+ readValue(): Promise<DataView>
39
+ writeValue(value: BufferSource): Promise<void>
40
+ startNotifications(): Promise<BluetoothRemoteGATTCharacteristic>
41
+ stopNotifications(): Promise<BluetoothRemoteGATTCharacteristic>
42
+ addEventListener(type: string, listener: EventListener): void
43
+ removeEventListener(type: string, listener: EventListener): void
44
+ }
45
+
46
+ export interface Bluetooth {
47
+ requestDevice(options?: {
48
+ filters?: Array<{ name?: string; namePrefix?: string; services?: string[] }>
49
+ optionalServices?: string[]
50
+ acceptAllDevices?: boolean
51
+ }): Promise<BluetoothDevice>
52
+ getAvailability(): Promise<boolean>
53
+ addEventListener(type: string, listener: EventListener): void
54
+ removeEventListener(type: string, listener: EventListener): void
55
+ }
56
+
57
+ // 地理位置相关类型
58
+ export interface GeolocationPosition {
59
+ coords: {
60
+ latitude: number
61
+ longitude: number
62
+ altitude: number | null
63
+ accuracy: number
64
+ altitudeAccuracy: number | null
65
+ heading: number | null
66
+ speed: number | null
67
+ }
68
+ timestamp: number
69
+ }
70
+
71
+ export interface GeolocationPositionError {
72
+ code: number
73
+ message: string
74
+ PERMISSION_DENIED: 1
75
+ POSITION_UNAVAILABLE: 2
76
+ TIMEOUT: 3
77
+ }
78
+
79
+ export interface Geolocation {
80
+ getCurrentPosition(
81
+ successCallback: (position: GeolocationPosition) => void,
82
+ errorCallback?: (error: GeolocationPositionError) => void,
83
+ options?: {
84
+ enableHighAccuracy?: boolean
85
+ timeout?: number
86
+ maximumAge?: number
87
+ }
88
+ ): void
89
+ watchPosition(
90
+ successCallback: (position: GeolocationPosition) => void,
91
+ errorCallback?: (error: GeolocationPositionError) => void,
92
+ options?: {
93
+ enableHighAccuracy?: boolean
94
+ timeout?: number
95
+ maximumAge?: number
96
+ }
97
+ ): number
98
+ clearWatch(watchId: number): void
99
+ }
100
+
101
+ // 媒体设备相关类型
102
+ export interface MediaStream {
103
+ id: string
104
+ active: boolean
105
+ getTracks(): MediaStreamTrack[]
106
+ getVideoTracks(): MediaStreamTrack[]
107
+ getAudioTracks(): MediaStreamTrack[]
108
+ addTrack(track: MediaStreamTrack): void
109
+ removeTrack(track: MediaStreamTrack): void
110
+ addEventListener(type: string, listener: EventListener): void
111
+ removeEventListener(type: string, listener: EventListener): void
112
+ }
113
+
114
+ export interface MediaStreamTrack {
115
+ id: string
116
+ kind: 'audio' | 'video'
117
+ label: string
118
+ enabled: boolean
119
+ muted: boolean
120
+ readyState: 'live' | 'ended'
121
+ stop(): void
122
+ getSettings(): MediaTrackSettings
123
+ getCapabilities(): MediaTrackCapabilities
124
+ addEventListener(type: string, listener: EventListener): void
125
+ removeEventListener(type: string, listener: EventListener): void
126
+ }
127
+
128
+ export interface MediaTrackSettings {
129
+ width?: number
130
+ height?: number
131
+ aspectRatio?: number
132
+ frameRate?: number
133
+ facingMode?: string
134
+ deviceId?: string
135
+ sampleRate?: number
136
+ sampleSize?: number
137
+ echoCancellation?: boolean
138
+ noiseSuppression?: boolean
139
+ autoGainControl?: boolean
140
+ }
141
+
142
+ export interface MediaTrackCapabilities {
143
+ width?: { min: number; max: number }
144
+ height?: { min: number; max: number }
145
+ aspectRatio?: { min: number; max: number }
146
+ frameRate?: { min: number; max: number }
147
+ facingMode?: string[]
148
+ deviceId?: string
149
+ }
150
+
151
+ export interface MediaDevices {
152
+ getUserMedia(constraints?: {
153
+ video?: boolean | { facingMode?: string; width?: number; height?: number }
154
+ audio?: boolean | { echoCancellation?: boolean; noiseSuppression?: boolean }
155
+ }): Promise<MediaStream>
156
+ enumerateDevices(): Promise<MediaDeviceInfo[]>
157
+ getSupportedConstraints(): MediaTrackSupportedConstraints
158
+ addEventListener(type: string, listener: EventListener): void
159
+ removeEventListener(type: string, listener: EventListener): void
160
+ }
161
+
162
+ export interface MediaDeviceInfo {
163
+ deviceId: string
164
+ kind: 'audioinput' | 'audiooutput' | 'videoinput'
165
+ label: string
166
+ groupId: string
167
+ }
168
+
169
+ export interface MediaTrackSupportedConstraints {
170
+ width?: boolean
171
+ height?: boolean
172
+ aspectRatio?: boolean
173
+ frameRate?: boolean
174
+ facingMode?: boolean
175
+ volume?: boolean
176
+ sampleRate?: boolean
177
+ sampleSize?: boolean
178
+ echoCancellation?: boolean
179
+ noiseSuppression?: boolean
180
+ autoGainControl?: boolean
181
+ }
182
+
183
+ export interface MediaStreamConstraints {
184
+ video?: boolean | { facingMode?: string; width?: number; height?: number }
185
+ audio?: boolean | { echoCancellation?: boolean; noiseSuppression?: boolean; autoGainControl?: boolean }
186
+ }
187
+
188
+ // 电池相关类型
189
+ export interface BatteryManager {
190
+ charging: boolean
191
+ chargingTime: number
192
+ dischargingTime: number
193
+ level: number
194
+ addEventListener(type: string, listener: EventListener): void
195
+ removeEventListener(type: string, listener: EventListener): void
196
+ }
197
+
198
+ export interface Navigator {
199
+ getBattery(): Promise<BatteryManager>
200
+ }
201
+
202
+ // 网络相关类型
203
+ export interface NetworkInformation {
204
+ type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown'
205
+ effectiveType?: 'slow-2g' | '2g' | '3g' | '4g'
206
+ downlink?: number
207
+ downlinkMax?: number
208
+ rtt?: number
209
+ saveData?: boolean
210
+ addEventListener(type: string, listener: EventListener): void
211
+ removeEventListener(type: string, listener: EventListener): void
212
+ }
213
+
214
+ export interface NavigatorConnection extends Navigator {
215
+ connection?: NetworkInformation
216
+ }
217
+
218
+ // 设备方向相关类型
219
+ export interface DeviceOrientationEvent {
220
+ alpha: number | null
221
+ beta: number | null
222
+ gamma: number | null
223
+ absolute: boolean
224
+ }
225
+
226
+ export interface DeviceMotionEvent {
227
+ acceleration: {
228
+ x: number | null
229
+ y: number | null
230
+ z: number | null
231
+ } | null
232
+ accelerationIncludingGravity: {
233
+ x: number | null
234
+ y: number | null
235
+ z: number | null
236
+ } | null
237
+ rotationRate: {
238
+ alpha: number | null
239
+ beta: number | null
240
+ gamma: number | null
241
+ } | null
242
+ interval: number
243
+ }
244
+
245
+ // 震动相关类型
246
+ export interface NavigatorVibration extends Navigator {
247
+ vibrate(pattern: number | number[]): boolean
248
+ }
249
+
250
+ // 屏幕相关类型
251
+ export interface ScreenOrientation {
252
+ type: 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary'
253
+ angle: number
254
+ lock(orientation: OrientationLockType): Promise<void>
255
+ unlock(): void
256
+ addEventListener(type: string, listener: EventListener): void
257
+ removeEventListener(type: string, listener: EventListener): void
258
+ }
259
+
260
+ export type OrientationLockType =
261
+ | 'any'
262
+ | 'natural'
263
+ | 'landscape'
264
+ | 'portrait'
265
+ | 'portrait-primary'
266
+ | 'portrait-secondary'
267
+ | 'landscape-primary'
268
+ | 'landscape-secondary'
269
+
270
+ export interface Screen {
271
+ orientation?: ScreenOrientation
272
+ }
273
+
274
+ // 游戏手柄相关类型
275
+ export interface GamepadButton {
276
+ pressed: boolean
277
+ touched: boolean
278
+ value: number
279
+ }
280
+
281
+ export interface Gamepad {
282
+ id: string
283
+ index: number
284
+ connected: boolean
285
+ timestamp: number
286
+ mapping: 'standard' | ''
287
+ axes: readonly number[]
288
+ buttons: readonly GamepadButton[]
289
+ hapticActuators?: readonly GamepadHapticActuator[]
290
+ vibrationActuator?: GamepadHapticActuator
291
+ }
292
+
293
+ export interface GamepadHapticActuator {
294
+ type: 'vibration' | 'dual-rumble'
295
+ playEffect(
296
+ type: 'dual-rumble',
297
+ params: {
298
+ duration?: number
299
+ startDelay?: number
300
+ strongMagnitude?: number
301
+ weakMagnitude?: number
302
+ }
303
+ ): Promise<'complete' | 'preempted'>
304
+ reset(): Promise<'complete' | 'preempted'>
305
+ }
306
+
307
+ // Wake Lock 相关类型
308
+ export interface WakeLockSentinel {
309
+ readonly type: 'screen'
310
+ readonly released: boolean
311
+ release(): Promise<void>
312
+ addEventListener(type: 'release', listener: () => void): void
313
+ removeEventListener(type: 'release', listener: () => void): void
314
+ }
315
+
316
+ export interface WakeLock {
317
+ request(type: 'screen'): Promise<WakeLockSentinel>
318
+ }
319
+
320
+ // Media Session 相关类型
321
+ export interface MediaMetadataInit {
322
+ title?: string
323
+ artist?: string
324
+ album?: string
325
+ artwork?: Array<{
326
+ src: string
327
+ sizes?: string
328
+ type?: string
329
+ }>
330
+ }
331
+
332
+ export interface MediaSession {
333
+ metadata: any
334
+ playbackState: 'none' | 'paused' | 'playing'
335
+ setActionHandler(
336
+ action: 'play' | 'pause' | 'stop' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack' | 'seekto',
337
+ handler: ((details?: any) => void) | null
338
+ ): void
339
+ }
340
+
@@ -1,8 +1,31 @@
1
1
  // DOM 相关类型声明
2
2
  import type { Blob } from './blob.d'
3
3
 
4
+ // 事件监听器类型
5
+ export type EventListener = (event: Event) => void
6
+
7
+ // 事件监听选项
8
+ export interface AddEventListenerOptions {
9
+ capture?: boolean
10
+ once?: boolean
11
+ passive?: boolean
12
+ }
13
+
14
+ export interface EventListenerOptions {
15
+ capture?: boolean
16
+ }
17
+
18
+ // Node 接口
19
+ export interface Node {
20
+ nodeType: number
21
+ nodeName: string
22
+ parentNode: Node | null
23
+ childNodes: Node[]
24
+ contains(other: Node | null): boolean
25
+ }
26
+
4
27
  // DOM 元素接口 - 按继承关系组织
5
- export interface Element {
28
+ export interface Element extends Node {
6
29
  parentNode?: Element | null
7
30
  }
8
31
 
@@ -17,14 +40,15 @@ export interface HTMLElement extends Element {
17
40
  right: number
18
41
  bottom: number
19
42
  }
20
- addEventListener(event: string, handler: (e: any) => void, options?: any): void
21
- removeEventListener(event: string, handler: (e: any) => void, options?: any): void
43
+ addEventListener(event: string, handler: EventListener, options?: boolean | AddEventListenerOptions): void
44
+ removeEventListener(event: string, handler: EventListener, options?: boolean | EventListenerOptions): void
22
45
  clientWidth: number
23
46
  clientHeight: number
24
47
  offsetLeft: number
25
48
  offsetTop: number
26
49
  offsetWidth: number
27
50
  offsetHeight: number
51
+ contains(other: Node | null): boolean
28
52
  }
29
53
 
30
54
  export interface HTMLImageElement extends HTMLElement {
@@ -69,7 +93,7 @@ export interface HTMLCanvasElement extends HTMLElement {
69
93
  toBlob(callback: (blob: Blob | null) => void, type?: string, quality?: number): void
70
94
  }
71
95
 
72
- export interface Document {
96
+ export interface Document extends Node {
73
97
  createElement(tagName: 'canvas'): HTMLCanvasElement
74
98
  createElement(tagName: 'script'): HTMLScriptElement
75
99
  createElement(tagName: 'link'): HTMLLinkElement
@@ -84,8 +108,9 @@ export interface Document {
84
108
  appendChild(element: HTMLElement): HTMLElement
85
109
  }
86
110
  body: HTMLElement
87
- addEventListener(event: string, handler: (e: any) => void, options?: any): void
88
- removeEventListener(event: string, handler: (e: any) => void, options?: any): void
111
+ cookie: string
112
+ addEventListener(event: string, handler: EventListener, options?: boolean | AddEventListenerOptions): void
113
+ removeEventListener(event: string, handler: EventListener, options?: boolean | EventListenerOptions): void
89
114
  }
90
115
 
91
116
  // DOM 事件相关
@@ -84,6 +84,8 @@ export interface Path {
84
84
  dirname(path: string): string
85
85
  basename(path: string, ext?: string): string
86
86
  extname(path: string): string
87
+ relative(from: string, to: string): string
88
+ normalize(path: string): string
87
89
  sep: string
88
90
  posix: {
89
91
  join(...paths: string[]): string
@@ -62,4 +62,42 @@ export interface TencentCloudSystemDependencies {
62
62
  process: Process
63
63
  console: Console
64
64
  getSecret: (type: string) => TencentCloudSecret
65
+ }
66
+
67
+ // COS 上传进度回调参数
68
+ export interface COSUploadProgressData {
69
+ percent: number
70
+ loaded: number
71
+ total: number
72
+ }
73
+
74
+ // COS 上传文件参数
75
+ export interface COSPutObjectParams {
76
+ Bucket: string
77
+ Region: string
78
+ Key: string
79
+ Body: Buffer | string
80
+ onProgress?: (progressData: COSUploadProgressData) => void
81
+ }
82
+
83
+ // COS 上传结果
84
+ export interface COSPutObjectResult {
85
+ statusCode: number
86
+ headers: Record<string, string>
87
+ }
88
+
89
+ // COS SDK 接口
90
+ export interface COSSDK {
91
+ putObject(params: COSPutObjectParams, callback?: (err: Error | null, data: COSPutObjectResult) => void): void
92
+ }
93
+
94
+ // COS 构造函数参数
95
+ export interface COSConstructorParams {
96
+ SecretId: string
97
+ SecretKey: string
98
+ }
99
+
100
+ // COS 构造函数接口
101
+ export interface COSConstructor {
102
+ new (params: COSConstructorParams): COSSDK
65
103
  }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * XLSX 库类型声明
3
+ * 用于 Excel 文件读取和解析
4
+ * 与 import type { XLSXLibrary } from '...' 兼容
5
+ */
6
+
7
+ export interface WorkBook {
8
+ /** 工作表名称数组 */
9
+ SheetNames: string[]
10
+ /** 工作表对象映射 */
11
+ Sheets: { [sheetName: string]: WorkSheet }
12
+ }
13
+
14
+ export interface WorkSheet {
15
+ [cellRef: string]: CellObject
16
+ }
17
+
18
+ export interface CellObject {
19
+ /** 单元格值 */
20
+ v?: string | number | boolean | Date
21
+ /** 值类型 */
22
+ t?: 's' | 'n' | 'b' | 'd'
23
+ }
24
+
25
+ export interface XLSXUtils {
26
+ /** 将工作表转换为 JSON 数组 */
27
+ sheet_to_json(sheet: WorkSheet, options?: { header: number }): any[][]
28
+ }
29
+
30
+ export interface XLSXLibrary {
31
+ /** 读取 Excel 文件 */
32
+ readFile(filePath: string): WorkBook
33
+ /** 读取文件缓冲区 */
34
+ read(buffer: Buffer, options?: any): WorkBook
35
+ /** 全局工具对象 */
36
+ utils: XLSXUtils
37
+ }
38
+
39
+ /**
40
+ * XLSX 库默认导出
41
+ * 兼容 import * as XLSX from 'xlsx' 的使用
42
+ */
43
+ declare module 'xlsx' {
44
+ export = XLSXLibrary
45
+ }
46
+
47
+ /**
48
+ * 全局类型声明
49
+ * 兼容 import type { XLSXLibrary } from '../../../references/xlsx.d'
50
+ */
51
+ export type XLSX = XLSXLibrary
@@ -0,0 +1,79 @@
1
+ /**
2
+ * 算法可视化相关类型定义
3
+ */
4
+
5
+ /**
6
+ * 可视化步骤基础接口
7
+ */
8
+ export interface VisualStep {
9
+ /** 步骤描述 */
10
+ description: string
11
+ /** 步骤编号 */
12
+ stepNumber: number
13
+ }
14
+
15
+ /**
16
+ * 数组可视化步骤
17
+ */
18
+ export interface ArrayVisualStep extends VisualStep {
19
+ /** 当前数组状态 */
20
+ array: number[]
21
+ /** 高亮的索引 */
22
+ highlights: {
23
+ /** 主要元素 */
24
+ primary?: number[]
25
+ /** 次要元素 */
26
+ secondary?: number[]
27
+ /** 比较中的元素 */
28
+ comparing?: number[]
29
+ /** 已完成的元素 */
30
+ completed?: number[]
31
+ }
32
+ /** 当前操作范围 */
33
+ range?: { left: number; right: number }
34
+ }
35
+
36
+ /**
37
+ * DP表可视化步骤
38
+ */
39
+ export interface DPTableVisualStep extends VisualStep {
40
+ /** 当前DP表状态 */
41
+ dpTable: number[][]
42
+ /** 当前处理的单元格 */
43
+ currentCell?: { row: number; col: number }
44
+ /** 依赖的单元格 */
45
+ dependencies?: Array<{ row: number; col: number }>
46
+ /** 当前计算的值 */
47
+ currentValue?: number
48
+ }
49
+
50
+ /**
51
+ * 回溯算法可视化步骤
52
+ */
53
+ export interface BacktrackVisualStep extends VisualStep {
54
+ /** 当前路径 */
55
+ path: any[]
56
+ /** 可选项 */
57
+ choices?: any[]
58
+ /** 当前选择 */
59
+ currentChoice?: any
60
+ /** 是否回溯 */
61
+ isBacktracking?: boolean
62
+ /** 已使用的元素 */
63
+ used?: boolean[]
64
+ }
65
+
66
+ /**
67
+ * 图算法可视化步骤
68
+ */
69
+ export interface GraphVisualStep extends VisualStep {
70
+ /** 图的状态 */
71
+ graph: any[][]
72
+ /** 已访问的节点 */
73
+ visited: Set<string> | boolean[]
74
+ /** 当前节点 */
75
+ current?: number | string
76
+ /** 队列/栈状态 */
77
+ queue?: any[]
78
+ }
79
+
@@ -0,0 +1,85 @@
1
+ /**
2
+ * 算法相关类型定义
3
+ */
4
+
5
+ /**
6
+ * 背包物品接口
7
+ */
8
+ export interface KnapsackItem {
9
+ /** 物品名称 */
10
+ name?: string
11
+ /** 物品重量 */
12
+ weight: number
13
+ /** 物品价值 */
14
+ value: number
15
+ }
16
+
17
+ /**
18
+ * 背包问题结果
19
+ */
20
+ export interface KnapsackResult {
21
+ /** 最大价值 */
22
+ maxValue: number
23
+ /** 选中的物品索引 */
24
+ selectedItems: number[]
25
+ /** DP表(用于调试) */
26
+ dpTable?: number[][]
27
+ }
28
+
29
+ /**
30
+ * 最长公共子序列结果
31
+ */
32
+ export interface LCSResult {
33
+ /** 最长公共子序列长度 */
34
+ length: number
35
+ /** 最长公共子序列字符串 */
36
+ sequence: string
37
+ /** DP表(用于调试) */
38
+ dpTable?: number[][]
39
+ }
40
+
41
+ /**
42
+ * 最长递增子序列结果
43
+ */
44
+ export interface LISResult {
45
+ /** 最长递增子序列长度 */
46
+ length: number
47
+ /** 最长递增子序列 */
48
+ sequence: number[]
49
+ /** DP数组(用于调试) */
50
+ dp?: number[]
51
+ }
52
+
53
+ /**
54
+ * 编辑距离结果
55
+ */
56
+ export interface EditDistanceResult {
57
+ /** 最小编辑距离 */
58
+ distance: number
59
+ /** 操作步骤 */
60
+ operations: EditOperation[]
61
+ /** DP表(用于调试) */
62
+ dpTable?: number[][]
63
+ }
64
+
65
+ /**
66
+ * 编辑操作类型
67
+ */
68
+ export type EditOperationType = 'insert' | 'delete' | 'replace' | 'keep'
69
+
70
+ /**
71
+ * 编辑操作
72
+ */
73
+ export interface EditOperation {
74
+ /** 操作类型 */
75
+ type: EditOperationType
76
+ /** 源字符串位置 */
77
+ sourceIndex: number
78
+ /** 目标字符串位置 */
79
+ targetIndex: number
80
+ /** 源字符 */
81
+ sourceChar?: string
82
+ /** 目标字符 */
83
+ targetChar?: string
84
+ }
85
+