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.
- package/dist/functions/algorithm/binarySearch.d.ts +3 -0
- package/dist/functions/algorithm/binarySearch.js +58 -0
- package/dist/functions/algorithm/binarySearch.js.map +1 -0
- package/dist/functions/algorithm/canJump.d.ts +2 -0
- package/dist/functions/algorithm/canJump.js +27 -0
- package/dist/functions/algorithm/canJump.js.map +1 -0
- package/dist/functions/algorithm/climbStairs.d.ts +2 -0
- package/dist/functions/algorithm/climbStairs.js +27 -0
- package/dist/functions/algorithm/climbStairs.js.map +1 -0
- package/dist/functions/algorithm/coinChange.d.ts +2 -0
- package/dist/functions/algorithm/coinChange.js +25 -0
- package/dist/functions/algorithm/coinChange.js.map +1 -0
- package/dist/functions/algorithm/combinationSum.d.ts +1 -0
- package/dist/functions/algorithm/combinationSum.js +24 -0
- package/dist/functions/algorithm/combinationSum.js.map +1 -0
- package/dist/functions/algorithm/editDistance.d.ts +2 -0
- package/dist/functions/algorithm/editDistance.js +96 -0
- package/dist/functions/algorithm/editDistance.js.map +1 -0
- package/dist/functions/algorithm/generateParenthesis.d.ts +1 -0
- package/dist/functions/algorithm/generateParenthesis.js +18 -0
- package/dist/functions/algorithm/generateParenthesis.js.map +1 -0
- package/dist/functions/algorithm/kmp.d.ts +2 -0
- package/dist/functions/algorithm/kmp.js +58 -0
- package/dist/functions/algorithm/kmp.js.map +1 -0
- package/dist/functions/algorithm/knapsack01.d.ts +2 -0
- package/dist/functions/algorithm/knapsack01.js +34 -0
- package/dist/functions/algorithm/knapsack01.js.map +1 -0
- package/dist/functions/algorithm/lengthOfLongestSubstring.d.ts +2 -0
- package/dist/functions/algorithm/lengthOfLongestSubstring.js +33 -0
- package/dist/functions/algorithm/lengthOfLongestSubstring.js.map +1 -0
- package/dist/functions/algorithm/longestCommonSubsequence.d.ts +2 -0
- package/dist/functions/algorithm/longestCommonSubsequence.js +37 -0
- package/dist/functions/algorithm/longestCommonSubsequence.js.map +1 -0
- package/dist/functions/algorithm/longestIncreasingSubsequence.d.ts +2 -0
- package/dist/functions/algorithm/longestIncreasingSubsequence.js +49 -0
- package/dist/functions/algorithm/longestIncreasingSubsequence.js.map +1 -0
- package/dist/functions/algorithm/maxArea.d.ts +1 -0
- package/dist/functions/algorithm/maxArea.js +19 -0
- package/dist/functions/algorithm/maxArea.js.map +1 -0
- package/dist/functions/algorithm/maxProfit.d.ts +2 -0
- package/dist/functions/algorithm/maxProfit.js +23 -0
- package/dist/functions/algorithm/maxProfit.js.map +1 -0
- package/dist/functions/algorithm/meetingRooms.d.ts +6 -0
- package/dist/functions/algorithm/meetingRooms.js +31 -0
- package/dist/functions/algorithm/meetingRooms.js.map +1 -0
- package/dist/functions/algorithm/mergeSort.d.ts +2 -0
- package/dist/functions/algorithm/mergeSort.js +72 -0
- package/dist/functions/algorithm/mergeSort.js.map +1 -0
- package/dist/functions/algorithm/minPathSum.d.ts +2 -0
- package/dist/functions/algorithm/minPathSum.js +39 -0
- package/dist/functions/algorithm/minPathSum.js.map +1 -0
- package/dist/functions/algorithm/minWindow.d.ts +1 -0
- package/dist/functions/algorithm/minWindow.js +40 -0
- package/dist/functions/algorithm/minWindow.js.map +1 -0
- package/dist/functions/algorithm/nQueens.d.ts +1 -0
- package/dist/functions/algorithm/nQueens.js +30 -0
- package/dist/functions/algorithm/nQueens.js.map +1 -0
- package/dist/functions/algorithm/numIslands.d.ts +2 -0
- package/dist/functions/algorithm/numIslands.js +59 -0
- package/dist/functions/algorithm/numIslands.js.map +1 -0
- package/dist/functions/algorithm/permutations.d.ts +1 -0
- package/dist/functions/algorithm/permutations.js +22 -0
- package/dist/functions/algorithm/permutations.js.map +1 -0
- package/dist/functions/algorithm/quickSort.d.ts +3 -0
- package/dist/functions/algorithm/quickSort.js +68 -0
- package/dist/functions/algorithm/quickSort.js.map +1 -0
- package/dist/functions/algorithm/rabinKarp.d.ts +1 -0
- package/dist/functions/algorithm/rabinKarp.js +40 -0
- package/dist/functions/algorithm/rabinKarp.js.map +1 -0
- package/dist/functions/algorithm/taskScheduler.d.ts +1 -0
- package/dist/functions/algorithm/taskScheduler.js +15 -0
- package/dist/functions/algorithm/taskScheduler.js.map +1 -0
- package/dist/functions/algorithm/threeSum.d.ts +2 -0
- package/dist/functions/algorithm/threeSum.js +56 -0
- package/dist/functions/algorithm/threeSum.js.map +1 -0
- package/dist/functions/algorithm/topologicalSort.d.ts +6 -0
- package/dist/functions/algorithm/topologicalSort.js +68 -0
- package/dist/functions/algorithm/topologicalSort.js.map +1 -0
- package/dist/functions/algorithm/trap.d.ts +2 -0
- package/dist/functions/algorithm/trap.js +51 -0
- package/dist/functions/algorithm/trap.js.map +1 -0
- package/dist/functions/array-object/chunk.d.ts +1 -0
- package/dist/functions/array-object/chunk.js +11 -0
- package/dist/functions/array-object/chunk.js.map +1 -0
- package/dist/functions/array-object/deepClone.d.ts +12 -0
- package/dist/functions/array-object/deepClone.js +131 -0
- package/dist/functions/array-object/deepClone.js.map +1 -0
- package/dist/functions/array-object/evolve.d.ts +3 -0
- package/dist/functions/array-object/evolve.js +15 -0
- package/dist/functions/array-object/evolve.js.map +1 -0
- package/dist/functions/array-object/flatten.d.ts +7 -0
- package/dist/functions/array-object/flatten.js +60 -0
- package/dist/functions/array-object/flatten.js.map +1 -0
- package/dist/functions/array-object/flattenObject.d.ts +5 -0
- package/dist/functions/array-object/flattenObject.js +102 -0
- package/dist/functions/array-object/flattenObject.js.map +1 -0
- package/dist/functions/array-object/groupBy.d.ts +1 -0
- package/dist/functions/array-object/groupBy.js +14 -0
- package/dist/functions/array-object/groupBy.js.map +1 -0
- package/dist/functions/array-object/omit.d.ts +1 -0
- package/dist/functions/array-object/omit.js +8 -0
- package/dist/functions/array-object/omit.js.map +1 -0
- package/dist/functions/array-object/pick.d.ts +1 -0
- package/dist/functions/array-object/pick.js +10 -0
- package/dist/functions/array-object/pick.js.map +1 -0
- package/dist/functions/array-object/shuffle.d.ts +1 -0
- package/dist/functions/array-object/shuffle.js +9 -0
- package/dist/functions/array-object/shuffle.js.map +1 -0
- package/dist/functions/array-object/sortBy.d.ts +1 -0
- package/dist/functions/array-object/sortBy.js +13 -0
- package/dist/functions/array-object/sortBy.js.map +1 -0
- package/dist/functions/array-object/unique.d.ts +10 -0
- package/dist/functions/array-object/unique.js +85 -0
- package/dist/functions/array-object/unique.js.map +1 -0
- package/dist/functions/async/cachedAsync.d.ts +27 -0
- package/dist/functions/async/cachedAsync.js +123 -0
- package/dist/functions/async/cachedAsync.js.map +1 -0
- package/dist/functions/async/promiseLimit.d.ts +10 -0
- package/dist/functions/async/promiseLimit.js +125 -0
- package/dist/functions/async/promiseLimit.js.map +1 -0
- package/dist/functions/async/retryWithBackoff.d.ts +12 -0
- package/dist/functions/async/retryWithBackoff.js +29 -0
- package/dist/functions/async/retryWithBackoff.js.map +1 -0
- package/dist/functions/browser/detectBrowser.d.ts +39 -0
- package/dist/functions/browser/detectBrowser.js +193 -0
- package/dist/functions/browser/detectBrowser.js.map +1 -0
- package/dist/functions/browser/detectOS.d.ts +5 -0
- package/dist/functions/browser/detectOS.js +20 -0
- package/dist/functions/browser/detectOS.js.map +1 -0
- package/dist/functions/browser/isMobile.d.ts +6 -0
- package/dist/functions/browser/isMobile.js +5 -0
- package/dist/functions/browser/isMobile.js.map +1 -0
- package/dist/functions/data-structures/AVLTree.d.ts +19 -0
- package/dist/functions/data-structures/AVLTree.js +197 -0
- package/dist/functions/data-structures/AVLTree.js.map +1 -0
- package/dist/functions/data-structures/BinarySearchTree.d.ts +19 -0
- package/dist/functions/data-structures/BinarySearchTree.js +150 -0
- package/dist/functions/data-structures/BinarySearchTree.js.map +1 -0
- package/dist/functions/data-structures/Graph.d.ts +19 -0
- package/dist/functions/data-structures/Graph.js +190 -0
- package/dist/functions/data-structures/Graph.js.map +1 -0
- package/dist/functions/data-structures/HashMap.d.ts +13 -0
- package/dist/functions/data-structures/HashMap.js +128 -0
- package/dist/functions/data-structures/HashMap.js.map +1 -0
- package/dist/functions/data-structures/Heap.d.ts +11 -0
- package/dist/functions/data-structures/Heap.js +91 -0
- package/dist/functions/data-structures/Heap.js.map +1 -0
- package/dist/functions/data-structures/LRUCache.d.ts +41 -0
- package/dist/functions/data-structures/LRUCache.js +182 -0
- package/dist/functions/data-structures/LRUCache.js.map +1 -0
- package/dist/functions/data-structures/LinkedList.d.ts +18 -0
- package/dist/functions/data-structures/LinkedList.js +135 -0
- package/dist/functions/data-structures/LinkedList.js.map +1 -0
- package/dist/functions/data-structures/PriorityQueue.d.ts +14 -0
- package/dist/functions/data-structures/PriorityQueue.js +77 -0
- package/dist/functions/data-structures/PriorityQueue.js.map +1 -0
- package/dist/functions/data-structures/Queue.d.ts +10 -0
- package/dist/functions/data-structures/Queue.js +27 -0
- package/dist/functions/data-structures/Queue.js.map +1 -0
- package/dist/functions/data-structures/Stack.d.ts +10 -0
- package/dist/functions/data-structures/Stack.js +27 -0
- package/dist/functions/data-structures/Stack.js.map +1 -0
- package/dist/functions/data-structures/Trie.d.ts +16 -0
- package/dist/functions/data-structures/Trie.js +127 -0
- package/dist/functions/data-structures/Trie.js.map +1 -0
- package/dist/functions/data-structures/UnionFind.d.ts +8 -0
- package/dist/functions/data-structures/UnionFind.js +53 -0
- package/dist/functions/data-structures/UnionFind.js.map +1 -0
- package/dist/functions/date/dateRange.d.ts +1 -0
- package/dist/functions/date/dateRange.js +18 -0
- package/dist/functions/date/dateRange.js.map +1 -0
- package/dist/functions/date/formatDate.d.ts +1 -0
- package/dist/functions/date/formatDate.js +21 -0
- package/dist/functions/date/formatDate.js.map +1 -0
- package/dist/functions/date/timeAgo.d.ts +1 -0
- package/dist/functions/date/timeAgo.js +49 -0
- package/dist/functions/date/timeAgo.js.map +1 -0
- package/dist/functions/design-tokens/buildTokens.d.ts +76 -0
- package/dist/functions/design-tokens/buildTokens.js +183 -0
- package/dist/functions/design-tokens/buildTokens.js.map +1 -0
- package/dist/functions/design-tokens/generateVariables.d.ts +7 -0
- package/dist/functions/design-tokens/generateVariables.js +135 -0
- package/dist/functions/design-tokens/generateVariables.js.map +1 -0
- package/dist/functions/design-tokens/mixColors.d.ts +1 -0
- package/dist/functions/design-tokens/mixColors.js +38 -0
- package/dist/functions/design-tokens/mixColors.js.map +1 -0
- package/dist/functions/design-tokens/parseDesignTokens.d.ts +10 -0
- package/dist/functions/design-tokens/parseDesignTokens.js +216 -0
- package/dist/functions/design-tokens/parseDesignTokens.js.map +1 -0
- package/dist/functions/file/formatFileSize.d.ts +1 -0
- package/dist/functions/file/formatFileSize.js +16 -0
- package/dist/functions/file/formatFileSize.js.map +1 -0
- package/dist/functions/file/getFileExtension.d.ts +5 -0
- package/dist/functions/file/getFileExtension.js +18 -0
- package/dist/functions/file/getFileExtension.js.map +1 -0
- package/dist/functions/functional/compose.d.ts +1 -0
- package/dist/functions/functional/compose.js +10 -0
- package/dist/functions/functional/compose.js.map +1 -0
- package/dist/functions/functional/cond.d.ts +1 -0
- package/dist/functions/functional/cond.js +15 -0
- package/dist/functions/functional/cond.js.map +1 -0
- package/dist/functions/functional/curry.d.ts +1 -0
- package/dist/functions/functional/curry.js +13 -0
- package/dist/functions/functional/curry.js.map +1 -0
- package/dist/functions/functional/curryAdvanced.d.ts +8 -0
- package/dist/functions/functional/curryAdvanced.js +87 -0
- package/dist/functions/functional/curryAdvanced.js.map +1 -0
- package/dist/functions/functional/flow.d.ts +1 -0
- package/dist/functions/functional/flow.js +14 -0
- package/dist/functions/functional/flow.js.map +1 -0
- package/dist/functions/functional/partial.d.ts +1 -0
- package/dist/functions/functional/partial.js +13 -0
- package/dist/functions/functional/partial.js.map +1 -0
- package/dist/functions/functional/pipe.d.ts +1 -0
- package/dist/functions/functional/pipe.js +10 -0
- package/dist/functions/functional/pipe.js.map +1 -0
- package/dist/functions/functional/tap.d.ts +1 -0
- package/dist/functions/functional/tap.js +14 -0
- package/dist/functions/functional/tap.js.map +1 -0
- package/dist/functions/functional/until.d.ts +1 -0
- package/dist/functions/functional/until.js +10 -0
- package/dist/functions/functional/until.js.map +1 -0
- package/dist/functions/math/average.d.ts +1 -0
- package/dist/functions/math/average.js +8 -0
- package/dist/functions/math/average.js.map +1 -0
- package/dist/functions/math/median.d.ts +1 -0
- package/dist/functions/math/median.js +14 -0
- package/dist/functions/math/median.js.map +1 -0
- package/dist/functions/math/percentile.d.ts +1 -0
- package/dist/functions/math/percentile.js +18 -0
- package/dist/functions/math/percentile.js.map +1 -0
- package/dist/functions/math/sum.d.ts +1 -0
- package/dist/functions/math/sum.js +4 -0
- package/dist/functions/math/sum.js.map +1 -0
- package/dist/functions/number/clamp.d.ts +1 -0
- package/dist/functions/number/clamp.js +7 -0
- package/dist/functions/number/clamp.js.map +1 -0
- package/dist/functions/number/formatNumber.d.ts +8 -0
- package/dist/functions/number/formatNumber.js +16 -0
- package/dist/functions/number/formatNumber.js.map +1 -0
- package/dist/functions/number/random.d.ts +4 -0
- package/dist/functions/number/random.js +9 -0
- package/dist/functions/number/random.js.map +1 -0
- package/dist/functions/number/range.d.ts +1 -0
- package/dist/functions/number/range.js +18 -0
- package/dist/functions/number/range.js.map +1 -0
- package/dist/functions/patterns/EventEmitter.d.ts +32 -0
- package/dist/functions/patterns/EventEmitter.js +108 -0
- package/dist/functions/patterns/EventEmitter.js.map +1 -0
- package/dist/functions/patterns/adapter.d.ts +8 -0
- package/dist/functions/patterns/adapter.js +14 -0
- package/dist/functions/patterns/adapter.js.map +1 -0
- package/dist/functions/patterns/builder.d.ts +9 -0
- package/dist/functions/patterns/builder.js +28 -0
- package/dist/functions/patterns/builder.js.map +1 -0
- package/dist/functions/patterns/chainOfResponsibility.d.ts +9 -0
- package/dist/functions/patterns/chainOfResponsibility.js +19 -0
- package/dist/functions/patterns/chainOfResponsibility.js.map +1 -0
- package/dist/functions/patterns/command.d.ts +15 -0
- package/dist/functions/patterns/command.js +49 -0
- package/dist/functions/patterns/command.js.map +1 -0
- package/dist/functions/patterns/decorator.d.ts +10 -0
- package/dist/functions/patterns/decorator.js +72 -0
- package/dist/functions/patterns/decorator.js.map +1 -0
- package/dist/functions/patterns/factory.d.ts +8 -0
- package/dist/functions/patterns/factory.js +25 -0
- package/dist/functions/patterns/factory.js.map +1 -0
- package/dist/functions/patterns/observer.d.ts +19 -0
- package/dist/functions/patterns/observer.js +89 -0
- package/dist/functions/patterns/observer.js.map +1 -0
- package/dist/functions/patterns/prototype.d.ts +4 -0
- package/dist/functions/patterns/prototype.js +30 -0
- package/dist/functions/patterns/prototype.js.map +1 -0
- package/dist/functions/patterns/proxy.d.ts +8 -0
- package/dist/functions/patterns/proxy.js +41 -0
- package/dist/functions/patterns/proxy.js.map +1 -0
- package/dist/functions/patterns/singleton.d.ts +11 -0
- package/dist/functions/patterns/singleton.js +32 -0
- package/dist/functions/patterns/singleton.js.map +1 -0
- package/dist/functions/patterns/strategy.d.ts +12 -0
- package/dist/functions/patterns/strategy.js +34 -0
- package/dist/functions/patterns/strategy.js.map +1 -0
- package/dist/functions/patterns/templateMethod.d.ts +8 -0
- package/dist/functions/patterns/templateMethod.js +19 -0
- package/dist/functions/patterns/templateMethod.js.map +1 -0
- package/dist/functions/patterns/usePluginSystem.d.ts +11 -0
- package/dist/functions/patterns/usePluginSystem.js +34 -0
- package/dist/functions/patterns/usePluginSystem.js.map +1 -0
- package/dist/functions/performance/debounce.d.ts +5 -0
- package/dist/functions/performance/debounce.js +12 -0
- package/dist/functions/performance/debounce.js.map +1 -0
- package/dist/functions/performance/memoize.d.ts +1 -0
- package/dist/functions/performance/memoize.js +13 -0
- package/dist/functions/performance/memoize.js.map +1 -0
- package/dist/functions/performance/once.d.ts +1 -0
- package/dist/functions/performance/once.js +13 -0
- package/dist/functions/performance/once.js.map +1 -0
- package/dist/functions/performance/throttle.d.ts +1 -0
- package/dist/functions/performance/throttle.js +11 -0
- package/dist/functions/performance/throttle.js.map +1 -0
- package/dist/functions/performance/useCache.d.ts +18 -0
- package/dist/functions/performance/useCache.js +82 -0
- package/dist/functions/performance/useCache.js.map +1 -0
- package/dist/functions/platform/tencent-cloud/deploy.tcb.d.ts +13 -0
- package/dist/functions/platform/tencent-cloud/deploy.tcb.js +46 -0
- package/dist/functions/platform/tencent-cloud/deploy.tcb.js.map +1 -0
- package/dist/functions/platform/tencent-cloud/getSecret.d.ts +4 -0
- package/dist/functions/platform/tencent-cloud/getSecret.js +19 -0
- package/dist/functions/platform/tencent-cloud/getSecret.js.map +1 -0
- package/dist/functions/platform/uniapp/app-plus/buildAndroidApp.d.ts +27 -0
- package/dist/functions/platform/uniapp/app-plus/buildAndroidApp.js +287 -0
- package/dist/functions/platform/uniapp/app-plus/buildAndroidApp.js.map +1 -0
- package/dist/functions/platform/uniapp/build.d.ts +21 -0
- package/dist/functions/platform/uniapp/build.js +83 -0
- package/dist/functions/platform/uniapp/build.js.map +1 -0
- package/dist/functions/platform/uniapp/detectAndroidProjectStructure.d.ts +11 -0
- package/dist/functions/platform/uniapp/detectAndroidProjectStructure.js +30 -0
- package/dist/functions/platform/uniapp/detectAndroidProjectStructure.js.map +1 -0
- package/dist/functions/platform/uniapp/detectProjectType.d.ts +20 -0
- package/dist/functions/platform/uniapp/detectProjectType.js +68 -0
- package/dist/functions/platform/uniapp/detectProjectType.js.map +1 -0
- package/dist/functions/platform/uniapp/parseManifest.d.ts +18 -0
- package/dist/functions/platform/uniapp/parseManifest.js +49 -0
- package/dist/functions/platform/uniapp/parseManifest.js.map +1 -0
- package/dist/functions/platform/uniapp/waitForPages.d.ts +7 -0
- package/dist/functions/platform/uniapp/waitForPages.js +20 -0
- package/dist/functions/platform/uniapp/waitForPages.js.map +1 -0
- package/dist/functions/principles/MyPromise.d.ts +32 -0
- package/dist/functions/principles/MyPromise.js +254 -0
- package/dist/functions/principles/MyPromise.js.map +1 -0
- package/dist/functions/principles/functionBind.d.ts +4 -0
- package/dist/functions/principles/functionBind.js +33 -0
- package/dist/functions/principles/functionBind.js.map +1 -0
- package/dist/functions/principles/myInstanceof.d.ts +5 -0
- package/dist/functions/principles/myInstanceof.js +56 -0
- package/dist/functions/principles/myInstanceof.js.map +1 -0
- package/dist/functions/principles/myNew.d.ts +3 -0
- package/dist/functions/principles/myNew.js +19 -0
- package/dist/functions/principles/myNew.js.map +1 -0
- package/dist/functions/promise/sleep.d.ts +5 -0
- package/dist/functions/promise/sleep.js +6 -0
- package/dist/functions/promise/sleep.js.map +1 -0
- package/dist/functions/promise/timeout.d.ts +6 -0
- package/dist/functions/promise/timeout.js +12 -0
- package/dist/functions/promise/timeout.js.map +1 -0
- package/dist/functions/storage/useLocalStorage.d.ts +8 -0
- package/dist/functions/storage/useLocalStorage.js +101 -0
- package/dist/functions/storage/useLocalStorage.js.map +1 -0
- package/dist/functions/storage/useSessionStorage.d.ts +8 -0
- package/dist/functions/storage/useSessionStorage.js +101 -0
- package/dist/functions/storage/useSessionStorage.js.map +1 -0
- package/dist/functions/storage/useStorage.d.ts +13 -0
- package/dist/functions/storage/useStorage.js +62 -0
- package/dist/functions/storage/useStorage.js.map +1 -0
- package/dist/functions/storage/useStorageWithIndexedDB.d.ts +8 -0
- package/dist/functions/storage/useStorageWithIndexedDB.js +132 -0
- package/dist/functions/storage/useStorageWithIndexedDB.js.map +1 -0
- package/dist/functions/tencent-cloud/upload.cos.d.ts +20 -0
- package/dist/functions/tencent-cloud/upload.cos.js +119 -0
- package/dist/functions/tencent-cloud/upload.cos.js.map +1 -0
- package/dist/functions/tree/buildTree.d.ts +7 -0
- package/dist/functions/tree/buildTree.js +27 -0
- package/dist/functions/tree/buildTree.js.map +1 -0
- package/dist/functions/tree/filterTree.d.ts +4 -0
- package/dist/functions/tree/filterTree.js +21 -0
- package/dist/functions/tree/filterTree.js.map +1 -0
- package/dist/functions/tree/findNode.d.ts +4 -0
- package/dist/functions/tree/findNode.js +21 -0
- package/dist/functions/tree/findNode.js.map +1 -0
- package/dist/functions/tree/flattenTree.d.ts +6 -0
- package/dist/functions/tree/flattenTree.js +21 -0
- package/dist/functions/tree/flattenTree.js.map +1 -0
- package/dist/functions/url/buildQueryString.d.ts +5 -0
- package/dist/functions/url/buildQueryString.js +15 -0
- package/dist/functions/url/buildQueryString.js.map +1 -0
- package/dist/functions/url/parseUrl.d.ts +11 -0
- package/dist/functions/url/parseUrl.js +34 -0
- package/dist/functions/url/parseUrl.js.map +1 -0
- package/dist/functions/utils/cachedAsync.d.ts +27 -0
- package/dist/functions/utils/cachedAsync.js +123 -0
- package/dist/functions/utils/cachedAsync.js.map +1 -0
- package/dist/functions/utils/createI18n.d.ts +2 -0
- package/dist/functions/utils/createI18n.js +97 -0
- package/dist/functions/utils/createI18n.js.map +1 -0
- package/dist/functions/utils/createReactive.d.ts +10 -0
- package/dist/functions/utils/createReactive.js +50 -0
- package/dist/functions/utils/createReactive.js.map +1 -0
- package/dist/functions/utils/diff.d.ts +25 -0
- package/dist/functions/utils/diff.js +316 -0
- package/dist/functions/utils/diff.js.map +1 -0
- package/dist/functions/utils/errorManager.d.ts +63 -0
- package/dist/functions/utils/errorManager.js +199 -0
- package/dist/functions/utils/errorManager.js.map +1 -0
- package/dist/functions/utils/formatString.d.ts +5 -0
- package/dist/functions/utils/formatString.js +9 -0
- package/dist/functions/utils/formatString.js.map +1 -0
- package/dist/functions/utils/i18n.d.ts +27 -0
- package/dist/functions/utils/i18n.js +119 -0
- package/dist/functions/utils/i18n.js.map +1 -0
- package/dist/functions/utils/permission.d.ts +40 -0
- package/dist/functions/utils/permission.js +189 -0
- package/dist/functions/utils/permission.js.map +1 -0
- package/dist/functions/utils/pinia.d.ts +52 -0
- package/dist/functions/utils/pinia.js +183 -0
- package/dist/functions/utils/pinia.js.map +1 -0
- package/dist/functions/utils/useAltool.d.ts +39 -0
- package/dist/functions/utils/useAltool.js +350 -0
- package/dist/functions/utils/useAltool.js.map +1 -0
- package/dist/functions/utils/vueDiff.d.ts +38 -0
- package/dist/functions/utils/vueDiff.js +333 -0
- package/dist/functions/utils/vueDiff.js.map +1 -0
- package/dist/functions/validation/isEmail.d.ts +1 -0
- package/dist/functions/validation/isEmail.js +8 -0
- package/dist/functions/validation/isEmail.js.map +1 -0
- package/dist/functions/validation/isIdCard.d.ts +1 -0
- package/dist/functions/validation/isIdCard.js +49 -0
- package/dist/functions/validation/isIdCard.js.map +1 -0
- package/dist/functions/validation/isIpAddress.d.ts +1 -0
- package/dist/functions/validation/isIpAddress.js +15 -0
- package/dist/functions/validation/isIpAddress.js.map +1 -0
- package/dist/functions/validation/isPhone.d.ts +1 -0
- package/dist/functions/validation/isPhone.js +12 -0
- package/dist/functions/validation/isPhone.js.map +1 -0
- package/dist/functions/validation/isUrl.d.ts +5 -0
- package/dist/functions/validation/isUrl.js +33 -0
- package/dist/functions/validation/isUrl.js.map +1 -0
- package/dist/hooks/usePermission.d.ts +7 -0
- package/dist/hooks/usePermission.js +123 -0
- package/dist/hooks/usePermission.js.map +1 -0
- package/dist/reactive/createReactive.d.ts +10 -0
- package/dist/reactive/createReactive.js +50 -0
- package/dist/reactive/createReactive.js.map +1 -0
- package/dist/reactive/createReactiveErrorManager.d.ts +63 -0
- package/dist/reactive/createReactiveErrorManager.js +199 -0
- package/dist/reactive/createReactiveErrorManager.js.map +1 -0
- package/dist/reactive/createReactiveI18n.d.ts +27 -0
- package/dist/reactive/createReactiveI18n.js +119 -0
- package/dist/reactive/createReactiveI18n.js.map +1 -0
- package/dist/reactive/createReactivePermission.d.ts +40 -0
- package/dist/reactive/createReactivePermission.js +189 -0
- package/dist/reactive/createReactivePermission.js.map +1 -0
- package/dist/reactive/createReactivePinia.d.ts +52 -0
- package/dist/reactive/createReactivePinia.js +183 -0
- package/dist/reactive/createReactivePinia.js.map +1 -0
- package/dist/reactive/useReactiveCookie.d.ts +19 -0
- package/dist/reactive/useReactiveCookie.js +84 -0
- package/dist/reactive/useReactiveCookie.js.map +1 -0
- package/dist/vue-hooks/browser/useBattery.d.ts +16 -0
- package/dist/vue-hooks/browser/useBattery.js +70 -0
- package/dist/vue-hooks/browser/useBattery.js.map +1 -0
- package/dist/vue-hooks/browser/useBluetooth.d.ts +25 -0
- package/dist/vue-hooks/browser/useBluetooth.js +72 -0
- package/dist/vue-hooks/browser/useBluetooth.js.map +1 -0
- package/dist/vue-hooks/browser/useCamera.d.ts +21 -0
- package/dist/vue-hooks/browser/useCamera.js +52 -0
- package/dist/vue-hooks/browser/useCamera.js.map +1 -0
- package/dist/vue-hooks/browser/useClipboard.d.ts +18 -0
- package/dist/vue-hooks/browser/useClipboard.js +33 -0
- package/dist/vue-hooks/browser/useClipboard.js.map +1 -0
- package/dist/vue-hooks/browser/useFullscreen.d.ts +20 -0
- package/dist/vue-hooks/browser/useFullscreen.js +73 -0
- package/dist/vue-hooks/browser/useFullscreen.js.map +1 -0
- package/dist/vue-hooks/browser/useGamepad.d.ts +25 -0
- package/dist/vue-hooks/browser/useGamepad.js +69 -0
- package/dist/vue-hooks/browser/useGamepad.js.map +1 -0
- package/dist/vue-hooks/browser/useGeolocation.d.ts +24 -0
- package/dist/vue-hooks/browser/useGeolocation.js +85 -0
- package/dist/vue-hooks/browser/useGeolocation.js.map +1 -0
- package/dist/vue-hooks/browser/useMediaSession.d.ts +19 -0
- package/dist/vue-hooks/browser/useMediaSession.js +71 -0
- package/dist/vue-hooks/browser/useMediaSession.js.map +1 -0
- package/dist/vue-hooks/browser/useMicrophone.d.ts +23 -0
- package/dist/vue-hooks/browser/useMicrophone.js +66 -0
- package/dist/vue-hooks/browser/useMicrophone.js.map +1 -0
- package/dist/vue-hooks/browser/useNetwork.d.ts +23 -0
- package/dist/vue-hooks/browser/useNetwork.js +57 -0
- package/dist/vue-hooks/browser/useNetwork.js.map +1 -0
- package/dist/vue-hooks/browser/useOrientation.d.ts +22 -0
- package/dist/vue-hooks/browser/useOrientation.js +54 -0
- package/dist/vue-hooks/browser/useOrientation.js.map +1 -0
- package/dist/vue-hooks/browser/usePageVisibility.d.ts +15 -0
- package/dist/vue-hooks/browser/usePageVisibility.js +25 -0
- package/dist/vue-hooks/browser/usePageVisibility.js.map +1 -0
- package/dist/vue-hooks/browser/useScreenOrientation.d.ts +24 -0
- package/dist/vue-hooks/browser/useScreenOrientation.js +67 -0
- package/dist/vue-hooks/browser/useScreenOrientation.js.map +1 -0
- package/dist/vue-hooks/browser/useScreenWakeLock.d.ts +15 -0
- package/dist/vue-hooks/browser/useScreenWakeLock.js +57 -0
- package/dist/vue-hooks/browser/useScreenWakeLock.js.map +1 -0
- package/dist/vue-hooks/browser/useShare.d.ts +21 -0
- package/dist/vue-hooks/browser/useShare.js +39 -0
- package/dist/vue-hooks/browser/useShare.js.map +1 -0
- package/dist/vue-hooks/browser/useVibration.d.ts +17 -0
- package/dist/vue-hooks/browser/useVibration.js +40 -0
- package/dist/vue-hooks/browser/useVibration.js.map +1 -0
- package/dist/vue-hooks/dom/useClickOutside.d.ts +9 -0
- package/dist/vue-hooks/dom/useClickOutside.js +16 -0
- package/dist/vue-hooks/dom/useClickOutside.js.map +1 -0
- package/dist/vue-hooks/dom/useDraggable.d.ts +33 -0
- package/dist/vue-hooks/dom/useDraggable.js +163 -0
- package/dist/vue-hooks/dom/useDraggable.js.map +1 -0
- package/dist/vue-hooks/dom/useEventListener.d.ts +11 -0
- package/dist/vue-hooks/dom/useEventListener.js +18 -0
- package/dist/vue-hooks/dom/useEventListener.js.map +1 -0
- package/dist/vue-hooks/dom/useResizable.d.ts +50 -0
- package/dist/vue-hooks/dom/useResizable.js +178 -0
- package/dist/vue-hooks/dom/useResizable.js.map +1 -0
- package/dist/vue-hooks/history/useDebouncedRefHistory.d.ts +17 -0
- package/dist/vue-hooks/history/useDebouncedRefHistory.js +46 -0
- package/dist/vue-hooks/history/useDebouncedRefHistory.js.map +1 -0
- package/dist/vue-hooks/history/useManualRefHistory.d.ts +26 -0
- package/dist/vue-hooks/history/useManualRefHistory.js +80 -0
- package/dist/vue-hooks/history/useManualRefHistory.js.map +1 -0
- package/dist/vue-hooks/history/useRefHistory.d.ts +15 -0
- package/dist/vue-hooks/history/useRefHistory.js +41 -0
- package/dist/vue-hooks/history/useRefHistory.js.map +1 -0
- package/dist/vue-hooks/state/createGlobalState.d.ts +2 -0
- package/dist/vue-hooks/state/createGlobalState.js +11 -0
- package/dist/vue-hooks/state/createGlobalState.js.map +1 -0
- package/dist/vue-hooks/state/createInjectionState.d.ts +10 -0
- package/dist/vue-hooks/state/createInjectionState.js +20 -0
- package/dist/vue-hooks/state/createInjectionState.js.map +1 -0
- package/dist/vue-hooks/state/createSharedComposable.d.ts +2 -0
- package/dist/vue-hooks/state/createSharedComposable.js +13 -0
- package/dist/vue-hooks/state/createSharedComposable.js.map +1 -0
- package/dist/vue-hooks/state/injectLocal.d.ts +8 -0
- package/dist/vue-hooks/state/injectLocal.js +12 -0
- package/dist/vue-hooks/state/injectLocal.js.map +1 -0
- package/dist/vue-hooks/state/provideLocal.d.ts +7 -0
- package/dist/vue-hooks/state/provideLocal.js +7 -0
- package/dist/vue-hooks/state/provideLocal.js.map +1 -0
- package/dist/vue-hooks/state/useAsyncState.d.ts +27 -0
- package/dist/vue-hooks/state/useAsyncState.js +46 -0
- package/dist/vue-hooks/state/useAsyncState.js.map +1 -0
- package/dist/vue-hooks/state/useCounter.d.ts +17 -0
- package/dist/vue-hooks/state/useCounter.js +44 -0
- package/dist/vue-hooks/state/useCounter.js.map +1 -0
- package/dist/vue-hooks/state/useToggle.d.ts +13 -0
- package/dist/vue-hooks/state/useToggle.js +23 -0
- package/dist/vue-hooks/state/useToggle.js.map +1 -0
- package/dist/vue-hooks/time/useInterval.d.ts +16 -0
- package/dist/vue-hooks/time/useInterval.js +33 -0
- package/dist/vue-hooks/time/useInterval.js.map +1 -0
- package/dist/vue-hooks/time/useTimeout.d.ts +17 -0
- package/dist/vue-hooks/time/useTimeout.js +40 -0
- package/dist/vue-hooks/time/useTimeout.js.map +1 -0
- package/dist/vue-hooks/worker/useWebWorker.d.ts +25 -0
- package/dist/vue-hooks/worker/useWebWorker.js +207 -0
- package/dist/vue-hooks/worker/useWebWorker.js.map +1 -0
- package/dist/vue-hooks/worker/useWorkerFunction.d.ts +26 -0
- package/dist/vue-hooks/worker/useWorkerFunction.js +191 -0
- package/dist/vue-hooks/worker/useWorkerFunction.js.map +1 -0
- package/dist/vue-hooks/worker/useWorkerPool.d.ts +33 -0
- package/dist/vue-hooks/worker/useWorkerPool.js +247 -0
- package/dist/vue-hooks/worker/useWorkerPool.js.map +1 -0
- package/package.json +175 -60
- package/references/browser.d.ts +12 -0
- package/references/device.d.ts +340 -0
- package/references/dom.d.ts +31 -6
- package/references/node.d.ts +2 -0
- package/references/tencent-cloud.d.ts +38 -0
- package/references/xlsx.d.ts +51 -0
- package/types/algorithm-visual.d.ts +79 -0
- package/types/algorithm.d.ts +85 -0
- package/types/reactive.d.ts +67 -0
- package/types/tencent-cloud.d.ts +29 -0
- 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
|
+
|
package/references/dom.d.ts
CHANGED
|
@@ -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:
|
|
21
|
-
removeEventListener(event: string, handler:
|
|
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
|
-
|
|
88
|
-
|
|
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 事件相关
|
package/references/node.d.ts
CHANGED
|
@@ -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
|
+
|