zcw-shared 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +610 -0
- package/assets/logo-colorful.svg +18 -0
- package/assets/logo-name.svg +7 -0
- package/assets/logo-transparent.svg +14 -0
- package/assets/logo.svg +8 -0
- package/dist/functions/ag-grid/generateLicense.d.ts +4 -0
- package/dist/functions/ag-grid/generateLicense.js +12 -0
- package/dist/functions/ag-grid/generateLicense.js.map +1 -0
- package/dist/functions/altool/createAltoolClient.d.ts +21 -0
- package/dist/functions/altool/createAltoolClient.js +59 -0
- package/dist/functions/altool/createAltoolClient.js.map +1 -0
- package/dist/functions/altool/getAppInfo.d.ts +13 -0
- package/dist/functions/altool/getAppInfo.js +92 -0
- package/dist/functions/altool/getAppInfo.js.map +1 -0
- package/dist/functions/altool/index.d.ts +10 -0
- package/dist/functions/altool/index.js +6 -0
- package/dist/functions/altool/index.js.map +1 -0
- package/dist/functions/altool/isApiKeyAuth.d.ts +2 -0
- package/dist/functions/altool/isApiKeyAuth.js +4 -0
- package/dist/functions/altool/isApiKeyAuth.js.map +1 -0
- package/dist/functions/altool/isCredentialsAuth.d.ts +2 -0
- package/dist/functions/altool/isCredentialsAuth.js +4 -0
- package/dist/functions/altool/isCredentialsAuth.js.map +1 -0
- package/dist/functions/altool/types.d.ts +26 -0
- package/dist/functions/altool/types.js +7 -0
- package/dist/functions/altool/types.js.map +1 -0
- package/dist/functions/altool/uploadApp.d.ts +6 -0
- package/dist/functions/altool/uploadApp.js +36 -0
- package/dist/functions/altool/uploadApp.js.map +1 -0
- package/dist/functions/altool/validateApp.d.ts +17 -0
- package/dist/functions/altool/validateApp.js +59 -0
- package/dist/functions/altool/validateApp.js.map +1 -0
- package/dist/functions/base64/strToBase64.d.ts +2 -0
- package/dist/functions/base64/strToBase64.js +6 -0
- package/dist/functions/base64/strToBase64.js.map +1 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.d.ts +2 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.js +9 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.js.map +1 -0
- package/dist/functions/color-converter/colorPatterns.d.ts +4 -0
- package/dist/functions/color-converter/colorPatterns.js +41 -0
- package/dist/functions/color-converter/colorPatterns.js.map +1 -0
- package/dist/functions/color-converter/convertColor.d.ts +6 -0
- package/dist/functions/color-converter/convertColor.js +238 -0
- package/dist/functions/color-converter/convertColor.js.map +1 -0
- package/dist/functions/color-converter/detectColorFormat.d.ts +2 -0
- package/dist/functions/color-converter/detectColorFormat.js +19 -0
- package/dist/functions/color-converter/detectColorFormat.js.map +1 -0
- package/dist/functions/color-converter/getColorPatterns.d.ts +2 -0
- package/dist/functions/color-converter/getColorPatterns.js +11 -0
- package/dist/functions/color-converter/getColorPatterns.js.map +1 -0
- package/dist/functions/color-converter/getNamedColorMap.d.ts +2 -0
- package/dist/functions/color-converter/getNamedColorMap.js +19 -0
- package/dist/functions/color-converter/getNamedColorMap.js.map +1 -0
- package/dist/functions/color-converter/hexToRgb.d.ts +2 -0
- package/dist/functions/color-converter/hexToRgb.js +42 -0
- package/dist/functions/color-converter/hexToRgb.js.map +1 -0
- package/dist/functions/color-converter/hslToRgb.d.ts +2 -0
- package/dist/functions/color-converter/hslToRgb.js +78 -0
- package/dist/functions/color-converter/hslToRgb.js.map +1 -0
- package/dist/functions/color-converter/hueToRgb.d.ts +1 -0
- package/dist/functions/color-converter/hueToRgb.js +14 -0
- package/dist/functions/color-converter/hueToRgb.js.map +1 -0
- package/dist/functions/color-converter/isColorValue.d.ts +2 -0
- package/dist/functions/color-converter/isColorValue.js +79 -0
- package/dist/functions/color-converter/isColorValue.js.map +1 -0
- package/dist/functions/color-converter/normalizeColor.d.ts +1 -0
- package/dist/functions/color-converter/normalizeColor.js +49 -0
- package/dist/functions/color-converter/normalizeColor.js.map +1 -0
- package/dist/functions/color-converter/parseColorString.d.ts +15 -0
- package/dist/functions/color-converter/parseColorString.js +116 -0
- package/dist/functions/color-converter/parseColorString.js.map +1 -0
- package/dist/functions/color-converter/rgbToHex.d.ts +2 -0
- package/dist/functions/color-converter/rgbToHex.js +65 -0
- package/dist/functions/color-converter/rgbToHex.js.map +1 -0
- package/dist/functions/color-converter/standardizeColor.d.ts +1 -0
- package/dist/functions/color-converter/standardizeColor.js +147 -0
- package/dist/functions/color-converter/standardizeColor.js.map +1 -0
- package/dist/functions/debug/createDebugger.d.ts +20 -0
- package/dist/functions/debug/createDebugger.js +79 -0
- package/dist/functions/debug/createDebugger.js.map +1 -0
- package/dist/functions/desensitize/desensitizeName.d.ts +1 -0
- package/dist/functions/desensitize/desensitizeName.js +8 -0
- package/dist/functions/desensitize/desensitizeName.js.map +1 -0
- package/dist/functions/desensitize/desensitizePhone.d.ts +1 -0
- package/dist/functions/desensitize/desensitizePhone.js +8 -0
- package/dist/functions/desensitize/desensitizePhone.js.map +1 -0
- package/dist/functions/dom/detectOverflow.d.ts +8 -0
- package/dist/functions/dom/detectOverflow.js +17 -0
- package/dist/functions/dom/detectOverflow.js.map +1 -0
- package/dist/functions/dom/getElementRect.d.ts +3 -0
- package/dist/functions/dom/getElementRect.js +14 -0
- package/dist/functions/dom/getElementRect.js.map +1 -0
- package/dist/functions/dom/getRelativePosition.d.ts +3 -0
- package/dist/functions/dom/getRelativePosition.js +14 -0
- package/dist/functions/dom/getRelativePosition.js.map +1 -0
- package/dist/functions/dom/getViewportRect.d.ts +3 -0
- package/dist/functions/dom/getViewportRect.js +15 -0
- package/dist/functions/dom/getViewportRect.js.map +1 -0
- package/dist/functions/dom/getViewportSize.d.ts +5 -0
- package/dist/functions/dom/getViewportSize.js +7 -0
- package/dist/functions/dom/getViewportSize.js.map +1 -0
- package/dist/functions/image/generateMacIcons.d.ts +6 -0
- package/dist/functions/image/generateMacIcons.js +15 -0
- package/dist/functions/image/generateMacIcons.js.map +1 -0
- package/dist/functions/image/generateMacTrayIcon.d.ts +7 -0
- package/dist/functions/image/generateMacTrayIcon.js +15 -0
- package/dist/functions/image/generateMacTrayIcon.js.map +1 -0
- package/dist/functions/image/generatePaddedImage.d.ts +3 -0
- package/dist/functions/image/generatePaddedImage.js +14 -0
- package/dist/functions/image/generatePaddedImage.js.map +1 -0
- package/dist/functions/image/generatePwaIcons.d.ts +6 -0
- package/dist/functions/image/generatePwaIcons.js +15 -0
- package/dist/functions/image/generatePwaIcons.js.map +1 -0
- package/dist/functions/image/generateRoundedImage.d.ts +3 -0
- package/dist/functions/image/generateRoundedImage.js +17 -0
- package/dist/functions/image/generateRoundedImage.js.map +1 -0
- package/dist/functions/ipc/dispatchIpcRequest.d.ts +6 -0
- package/dist/functions/ipc/dispatchIpcRequest.js +10 -0
- package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -0
- package/dist/functions/software/buildPathExecutables.d.ts +1 -0
- package/dist/functions/software/buildPathExecutables.js +4 -0
- package/dist/functions/software/buildPathExecutables.js.map +1 -0
- package/dist/functions/software/buildSoftwarePaths.d.ts +2 -0
- package/dist/functions/software/buildSoftwarePaths.js +22 -0
- package/dist/functions/software/buildSoftwarePaths.js.map +1 -0
- package/dist/functions/software/createConfigGenerator.d.ts +8 -0
- package/dist/functions/software/createConfigGenerator.js +13 -0
- package/dist/functions/software/createConfigGenerator.js.map +1 -0
- package/dist/functions/software/detectPlatform.d.ts +2 -0
- package/dist/functions/software/detectPlatform.js +4 -0
- package/dist/functions/software/detectPlatform.js.map +1 -0
- package/dist/functions/software/find.d.ts +2 -0
- package/dist/functions/software/find.js +12 -0
- package/dist/functions/software/find.js.map +1 -0
- package/dist/functions/software/findSoftware.d.ts +14 -0
- package/dist/functions/software/findSoftware.js +29 -0
- package/dist/functions/software/findSoftware.js.map +1 -0
- package/dist/functions/software/findSoftwareWithGenerator.d.ts +3 -0
- package/dist/functions/software/findSoftwareWithGenerator.js +8 -0
- package/dist/functions/software/findSoftwareWithGenerator.js.map +1 -0
- package/dist/functions/software/getConfigGenerator.d.ts +2 -0
- package/dist/functions/software/getConfigGenerator.js +10 -0
- package/dist/functions/software/getConfigGenerator.js.map +1 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.d.ts +1 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.js +4 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.js.map +1 -0
- package/dist/functions/software/getSupportedSoftware.d.ts +1 -0
- package/dist/functions/software/getSupportedSoftware.js +5 -0
- package/dist/functions/software/getSupportedSoftware.js.map +1 -0
- package/dist/functions/software/parseEnvironmentPaths.d.ts +1 -0
- package/dist/functions/software/parseEnvironmentPaths.js +7 -0
- package/dist/functions/software/parseEnvironmentPaths.js.map +1 -0
- package/dist/functions/software/softwareConfigs.d.ts +2 -0
- package/dist/functions/software/softwareConfigs.js +148 -0
- package/dist/functions/software/softwareConfigs.js.map +1 -0
- package/dist/functions/software/softwareNameMap.d.ts +1 -0
- package/dist/functions/software/softwareNameMap.js +9 -0
- package/dist/functions/software/softwareNameMap.js.map +1 -0
- package/dist/functions/software/types.d.ts +11 -0
- package/dist/functions/software/types.js +2 -0
- package/dist/functions/software/types.js.map +1 -0
- package/dist/functions/string/camelCase.d.ts +1 -0
- package/dist/functions/string/camelCase.js +8 -0
- package/dist/functions/string/camelCase.js.map +1 -0
- package/dist/functions/string/capitalize.d.ts +1 -0
- package/dist/functions/string/capitalize.js +6 -0
- package/dist/functions/string/capitalize.js.map +1 -0
- package/dist/functions/string/escape.d.ts +1 -0
- package/dist/functions/string/escape.js +13 -0
- package/dist/functions/string/escape.js.map +1 -0
- package/dist/functions/string/kebabCase.d.ts +1 -0
- package/dist/functions/string/kebabCase.js +10 -0
- package/dist/functions/string/kebabCase.js.map +1 -0
- package/dist/functions/string/levenshtein.d.ts +1 -0
- package/dist/functions/string/levenshtein.js +27 -0
- package/dist/functions/string/levenshtein.js.map +1 -0
- package/dist/functions/string/mask.d.ts +1 -0
- package/dist/functions/string/mask.js +40 -0
- package/dist/functions/string/mask.js.map +1 -0
- package/dist/functions/string/normalize.d.ts +8 -0
- package/dist/functions/string/normalize.js +37 -0
- package/dist/functions/string/normalize.js.map +1 -0
- package/dist/functions/string/padEnd.d.ts +1 -0
- package/dist/functions/string/padEnd.js +8 -0
- package/dist/functions/string/padEnd.js.map +1 -0
- package/dist/functions/string/padStart.d.ts +1 -0
- package/dist/functions/string/padStart.js +8 -0
- package/dist/functions/string/padStart.js.map +1 -0
- package/dist/functions/string/palindrome.d.ts +3 -0
- package/dist/functions/string/palindrome.js +15 -0
- package/dist/functions/string/palindrome.js.map +1 -0
- package/dist/functions/string/pascalCase.d.ts +1 -0
- package/dist/functions/string/pascalCase.js +8 -0
- package/dist/functions/string/pascalCase.js.map +1 -0
- package/dist/functions/string/similarity.d.ts +1 -0
- package/dist/functions/string/similarity.js +38 -0
- package/dist/functions/string/similarity.js.map +1 -0
- package/dist/functions/string/snakeCase.d.ts +1 -0
- package/dist/functions/string/snakeCase.js +10 -0
- package/dist/functions/string/snakeCase.js.map +1 -0
- package/dist/functions/string/template.d.ts +4 -0
- package/dist/functions/string/template.js +21 -0
- package/dist/functions/string/template.js.map +1 -0
- package/dist/functions/string/unescape.d.ts +1 -0
- package/dist/functions/string/unescape.js +13 -0
- package/dist/functions/string/unescape.js.map +1 -0
- package/dist/functions/string/wordCount.d.ts +5 -0
- package/dist/functions/string/wordCount.js +11 -0
- package/dist/functions/string/wordCount.js.map +1 -0
- package/dist/functions/tencent-cloud/getSecret.d.ts +7 -0
- package/dist/functions/tencent-cloud/getSecret.js +19 -0
- package/dist/functions/tencent-cloud/getSecret.js.map +1 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.d.ts +13 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js +175 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js.map +1 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +33 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +60 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +75 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js +60 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js +51 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js +63 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +9 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js +57 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js +34 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureStrings.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureStrings.js +42 -0
- package/dist/functions/uniapp/app-plus/configureStrings.js.map +1 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +8 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.js +25 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.js.map +1 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.js +18 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.js.map +1 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js +35 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js.map +1 -0
- package/dist/functions/uniapp/app-plus/parseManifest.d.ts +14 -0
- package/dist/functions/uniapp/app-plus/parseManifest.js +44 -0
- package/dist/functions/uniapp/app-plus/parseManifest.js.map +1 -0
- package/dist/functions/uniapp/app-plus/validateOptions.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/validateOptions.js +10 -0
- package/dist/functions/uniapp/app-plus/validateOptions.js.map +1 -0
- package/dist/functions/uniapp/waitForPages.d.ts +2 -0
- package/dist/functions/uniapp/waitForPages.js +19 -0
- package/dist/functions/uniapp/waitForPages.js.map +1 -0
- package/dist/functions/utils/compose.d.ts +1 -0
- package/dist/functions/utils/compose.js +10 -0
- package/dist/functions/utils/compose.js.map +1 -0
- package/dist/functions/utils/cond.d.ts +1 -0
- package/dist/functions/utils/cond.js +15 -0
- package/dist/functions/utils/cond.js.map +1 -0
- package/dist/functions/utils/curry.d.ts +1 -0
- package/dist/functions/utils/curry.js +13 -0
- package/dist/functions/utils/curry.js.map +1 -0
- package/dist/functions/utils/debounce.d.ts +1 -0
- package/dist/functions/utils/debounce.js +13 -0
- package/dist/functions/utils/debounce.js.map +1 -0
- package/dist/functions/utils/evolve.d.ts +3 -0
- package/dist/functions/utils/evolve.js +15 -0
- package/dist/functions/utils/evolve.js.map +1 -0
- package/dist/functions/utils/flow.d.ts +1 -0
- package/dist/functions/utils/flow.js +10 -0
- package/dist/functions/utils/flow.js.map +1 -0
- package/dist/functions/utils/isType.d.ts +11 -0
- package/dist/functions/utils/isType.js +30 -0
- package/dist/functions/utils/isType.js.map +1 -0
- package/dist/functions/utils/memoize.d.ts +1 -0
- package/dist/functions/utils/memoize.js +13 -0
- package/dist/functions/utils/memoize.js.map +1 -0
- package/dist/functions/utils/once.d.ts +1 -0
- package/dist/functions/utils/once.js +13 -0
- package/dist/functions/utils/once.js.map +1 -0
- package/dist/functions/utils/partial.d.ts +1 -0
- package/dist/functions/utils/partial.js +13 -0
- package/dist/functions/utils/partial.js.map +1 -0
- package/dist/functions/utils/pipe.d.ts +1 -0
- package/dist/functions/utils/pipe.js +10 -0
- package/dist/functions/utils/pipe.js.map +1 -0
- package/dist/functions/utils/retryWithBackoff.d.ts +9 -0
- package/dist/functions/utils/retryWithBackoff.js +30 -0
- package/dist/functions/utils/retryWithBackoff.js.map +1 -0
- package/dist/functions/utils/tap.d.ts +1 -0
- package/dist/functions/utils/tap.js +14 -0
- package/dist/functions/utils/tap.js.map +1 -0
- package/dist/functions/utils/throttle.d.ts +1 -0
- package/dist/functions/utils/throttle.js +11 -0
- package/dist/functions/utils/throttle.js.map +1 -0
- package/dist/functions/utils/until.d.ts +1 -0
- package/dist/functions/utils/until.js +10 -0
- package/dist/functions/utils/until.js.map +1 -0
- package/dist/functions/utils/validate.d.ts +8 -0
- package/dist/functions/utils/validate.js +45 -0
- package/dist/functions/utils/validate.js.map +1 -0
- package/dist/functions/vue/dynamicMount.d.ts +15 -0
- package/dist/functions/vue/dynamicMount.js +23 -0
- package/dist/functions/vue/dynamicMount.js.map +1 -0
- package/dist/functions/vue/isVNode.d.ts +2 -0
- package/dist/functions/vue/isVNode.js +4 -0
- package/dist/functions/vue/isVNode.js.map +1 -0
- package/dist/functions/vue/isVueComponent.d.ts +2 -0
- package/dist/functions/vue/isVueComponent.js +6 -0
- package/dist/functions/vue/isVueComponent.js.map +1 -0
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +2 -0
- package/dist/functions/wechat/miniapp/downloadFile.js +39 -0
- package/dist/functions/wechat/miniapp/downloadFile.js.map +1 -0
- package/dist/hooks/useAi.d.ts +27 -0
- package/dist/hooks/useAi.js +163 -0
- package/dist/hooks/useAi.js.map +1 -0
- package/dist/hooks/useCache.d.ts +18 -0
- package/dist/hooks/useCache.js +82 -0
- package/dist/hooks/useCache.js.map +1 -0
- package/dist/hooks/useFetch.d.ts +3 -0
- package/dist/hooks/useFetch.js +154 -0
- package/dist/hooks/useFetch.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +4 -0
- package/dist/hooks/useLocalStorage.js +67 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/usePluginSystem.d.ts +11 -0
- package/dist/hooks/usePluginSystem.js +34 -0
- package/dist/hooks/usePluginSystem.js.map +1 -0
- package/dist/hooks/useRequest.d.ts +3 -0
- package/dist/hooks/useRequest.js +139 -0
- package/dist/hooks/useRequest.js.map +1 -0
- package/dist/hooks/useSessionStorage.d.ts +4 -0
- package/dist/hooks/useSessionStorage.js +67 -0
- package/dist/hooks/useSessionStorage.js.map +1 -0
- package/dist/hooks/useStorage.d.ts +3 -0
- package/dist/hooks/useStorage.js +64 -0
- package/dist/hooks/useStorage.js.map +1 -0
- package/dist/hooks/useStorageWithIndexedDB.d.ts +4 -0
- package/dist/hooks/useStorageWithIndexedDB.js +109 -0
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -0
- package/dist/hooks/useWASM.d.ts +4 -0
- package/dist/hooks/useWASM.js +267 -0
- package/dist/hooks/useWASM.js.map +1 -0
- package/dist/hooks/useWebWorker.d.ts +4 -0
- package/dist/hooks/useWebWorker.js +209 -0
- package/dist/hooks/useWebWorker.js.map +1 -0
- package/dist/hooks/useWorkerFunction.d.ts +4 -0
- package/dist/hooks/useWorkerFunction.js +191 -0
- package/dist/hooks/useWorkerFunction.js.map +1 -0
- package/dist/hooks/useWorkerPool.d.ts +4 -0
- package/dist/hooks/useWorkerPool.js +242 -0
- package/dist/hooks/useWorkerPool.js.map +1 -0
- package/package.json +145 -0
- package/references/browser.d.ts +175 -0
- package/references/browser.extension.d.ts +14 -0
- package/references/console.d.ts +164 -0
- package/references/crypto.d.ts +57 -0
- package/references/fetch.d.ts +269 -0
- package/references/json5.d.ts +28 -0
- package/references/node.d.ts +111 -0
- package/references/sharp.d.ts +19 -0
- package/references/storage.d.ts +112 -0
- package/references/timer.d.ts +46 -0
- package/references/uniapp.d.ts +9 -0
- package/references/url.d.ts +161 -0
- package/references/vue.d.ts +113 -0
- package/references/webassembly.d.ts +127 -0
- package/references/wechat.d.ts +49 -0
- package/references/worker.d.ts +207 -0
- package/references/xml.d.ts +56 -0
- package/types/altool.d.ts +65 -0
- package/types/android-build.d.ts +85 -0
- package/types/color.d.ts +115 -0
- package/types/geometry.d.ts +64 -0
- package/types/network.d.ts +184 -0
- package/types/storage.d.ts +49 -0
- package/types/util.d.ts +27 -0
- package/types/wasm.d.ts +217 -0
- package/types/worker.d.ts +364 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Node.js 类型定义文件
|
|
2
|
+
// 仅包含必要的 Node.js 类型,避免全局污染
|
|
3
|
+
import type { ConsoleInterface } from './console.d'
|
|
4
|
+
|
|
5
|
+
export namespace Node {
|
|
6
|
+
interface ReadableStream {
|
|
7
|
+
[key: string]: any
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface WritableStream {
|
|
11
|
+
[key: string]: any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Process {
|
|
15
|
+
env: Record<string, string | undefined>
|
|
16
|
+
argv: string[]
|
|
17
|
+
cwd(): string
|
|
18
|
+
exit(code?: number): never
|
|
19
|
+
[key: string]: any
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Buffer {
|
|
23
|
+
length: number
|
|
24
|
+
toString(encoding?: string): string
|
|
25
|
+
[key: string]: any
|
|
26
|
+
}
|
|
27
|
+
interface FileSystem {
|
|
28
|
+
readFile(path: string): Promise<any>
|
|
29
|
+
writeFile(path: string, data: any): Promise<void>
|
|
30
|
+
mkdir(path: string, options?: any): Promise<void>
|
|
31
|
+
[key: string]: any
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface Path {
|
|
35
|
+
join(...paths: string[]): string
|
|
36
|
+
resolve(...paths: string[]): string
|
|
37
|
+
dirname(path: string): string
|
|
38
|
+
basename(path: string, ext?: string): string
|
|
39
|
+
extname(path: string): string
|
|
40
|
+
[key: string]: any
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface ChildProcess {
|
|
44
|
+
exec(command: string, callback?: (error: any, stdout: string, stderr: string) => void): any
|
|
45
|
+
[key: string]: any
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface Util {
|
|
49
|
+
promisify<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => Promise<any>
|
|
50
|
+
[key: string]: any
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface BufferConstructor {
|
|
54
|
+
from(str: string, encoding?: string): Buffer
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// NodeJS 命名空间
|
|
59
|
+
export namespace NodeJS {
|
|
60
|
+
interface Timeout {
|
|
61
|
+
ref(): this
|
|
62
|
+
unref(): this
|
|
63
|
+
hasRef(): boolean
|
|
64
|
+
refresh(): this
|
|
65
|
+
[Symbol.toPrimitive](): number
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface Immediate {
|
|
69
|
+
ref(): this
|
|
70
|
+
unref(): this
|
|
71
|
+
hasRef(): boolean
|
|
72
|
+
_onImmediate: Function
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 定时器函数
|
|
77
|
+
export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate
|
|
78
|
+
export function clearImmediate(immediateId: NodeJS.Immediate): void
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
// 导出 Node.js 相关类型
|
|
82
|
+
export type NodeFileSystem = Node.FileSystem
|
|
83
|
+
export type NodePath = Node.Path
|
|
84
|
+
export type NodeChildProcess = Node.ChildProcess
|
|
85
|
+
export type NodeUtil = Node.Util
|
|
86
|
+
export type NodeProcess = Node.Process
|
|
87
|
+
export type NodeBuffer = Node.Buffer
|
|
88
|
+
export type NodeBufferConstructor = Node.BufferConstructor
|
|
89
|
+
export type NodeReadableStream = Node.ReadableStream
|
|
90
|
+
export type NodeWritableStream = Node.WritableStream
|
|
91
|
+
|
|
92
|
+
// 导出 NodeJS 命名空间类型
|
|
93
|
+
export type NodeTimeout = NodeJS.Timeout
|
|
94
|
+
export type NodeImmediate = NodeJS.Immediate
|
|
95
|
+
|
|
96
|
+
// 重新导出函数类型
|
|
97
|
+
export { setImmediate, clearImmediate }
|
|
98
|
+
|
|
99
|
+
// Node.js 调试环境接口
|
|
100
|
+
export interface NodeEnvironment {
|
|
101
|
+
process: NodeProcess
|
|
102
|
+
fs: NodeFileSystem
|
|
103
|
+
path: NodePath
|
|
104
|
+
childProcess: NodeChildProcess
|
|
105
|
+
util: NodeUtil
|
|
106
|
+
Buffer: NodeBufferConstructor
|
|
107
|
+
console: ConsoleInterface
|
|
108
|
+
setImmediate: typeof setImmediate
|
|
109
|
+
clearImmediate: typeof clearImmediate
|
|
110
|
+
__DEV__?: boolean
|
|
111
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NodeBuffer } from './node.d'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sharp 图像处理库的类型定义
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface SharpInstance {
|
|
8
|
+
metadata(): Promise<{ width?: number; height?: number }>;
|
|
9
|
+
resize(width: number, height: number): SharpInstance;
|
|
10
|
+
composite(images: Array<{ input: NodeBuffer; top: number; left: number; blend?: string }>): SharpInstance;
|
|
11
|
+
extend(options: { top: number; bottom: number; left: number; right: number; background: { r: number; g: number; b: number; alpha: number } }): SharpInstance;
|
|
12
|
+
flatten(options?: { background?: string | { r: number; g: number; b: number } }): SharpInstance;
|
|
13
|
+
negate(options?: boolean): SharpInstance;
|
|
14
|
+
toBuffer(): Promise<NodeBuffer>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface Sharp {
|
|
18
|
+
(input: NodeBuffer): SharpInstance;
|
|
19
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 存储环境类型定义
|
|
3
|
+
* 包含浏览器和其他环境的存储 API 类型支持
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 基础存储接口
|
|
8
|
+
* 对应浏览器的 localStorage 和 sessionStorage API
|
|
9
|
+
*/
|
|
10
|
+
export interface StorageInterface {
|
|
11
|
+
getItem(key: string): string | null
|
|
12
|
+
setItem(key: string, value: string): void
|
|
13
|
+
removeItem(key: string): void
|
|
14
|
+
clear(): void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* IndexedDB 工厂接口
|
|
19
|
+
* 已在 browser.d.ts 中定义,这里重新导出以保持一致性
|
|
20
|
+
*/
|
|
21
|
+
export interface IDBFactory {
|
|
22
|
+
open(name: string, version?: number): IDBOpenDBRequest
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* IndexedDB 请求接口
|
|
27
|
+
*/
|
|
28
|
+
export interface IDBOpenDBRequest extends EventTarget {
|
|
29
|
+
result: IDBDatabase
|
|
30
|
+
error: DOMException | null
|
|
31
|
+
onsuccess: ((event: Event) => void) | null
|
|
32
|
+
onerror: ((event: Event) => void) | null
|
|
33
|
+
onupgradeneeded: ((event: IDBVersionChangeEvent) => void) | null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* IndexedDB 数据库接口
|
|
38
|
+
*/
|
|
39
|
+
export interface IDBDatabase {
|
|
40
|
+
objectStoreNames: DOMStringList
|
|
41
|
+
createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore
|
|
42
|
+
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* IndexedDB 对象存储接口
|
|
47
|
+
*/
|
|
48
|
+
export interface IDBObjectStore {
|
|
49
|
+
get(key: IDBValidKey): IDBRequest
|
|
50
|
+
put(value: any, key?: IDBValidKey): IDBRequest
|
|
51
|
+
delete(key: IDBValidKey): IDBRequest
|
|
52
|
+
clear(): IDBRequest
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* IndexedDB 事务接口
|
|
57
|
+
*/
|
|
58
|
+
export interface IDBTransaction {
|
|
59
|
+
objectStore(name: string): IDBObjectStore
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* IndexedDB 请求接口
|
|
64
|
+
*/
|
|
65
|
+
export interface IDBRequest {
|
|
66
|
+
result: any
|
|
67
|
+
error: DOMException | null
|
|
68
|
+
onsuccess: ((event: Event) => void) | null
|
|
69
|
+
onerror: ((event: Event) => void) | null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* IndexedDB 版本变更事件接口
|
|
74
|
+
*/
|
|
75
|
+
export interface IDBVersionChangeEvent extends Event {
|
|
76
|
+
target: IDBOpenDBRequest
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* DOM 字符串列表接口
|
|
81
|
+
*/
|
|
82
|
+
export interface DOMStringList {
|
|
83
|
+
contains(string: string): boolean
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* IndexedDB 有效键类型
|
|
88
|
+
*/
|
|
89
|
+
export type IDBValidKey = string | number | Date | ArrayBuffer | IDBValidKey[]
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* IndexedDB 事务模式类型
|
|
93
|
+
*/
|
|
94
|
+
export type IDBTransactionMode = 'readonly' | 'readwrite' | 'versionchange'
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* IndexedDB 对象存储参数接口
|
|
98
|
+
*/
|
|
99
|
+
export interface IDBObjectStoreParameters {
|
|
100
|
+
keyPath?: string | string[]
|
|
101
|
+
autoIncrement?: boolean
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 存储环境接口
|
|
106
|
+
* 包含所有存储相关的环境 API
|
|
107
|
+
*/
|
|
108
|
+
export interface StorageEnvironment {
|
|
109
|
+
localStorage?: StorageInterface
|
|
110
|
+
sessionStorage?: StorageInterface
|
|
111
|
+
indexedDB?: IDBFactory
|
|
112
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 定时器 API 类型定义
|
|
3
|
+
* 包含浏览器和 Node.js 环境都支持的定时器相关 API
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 设置定时器
|
|
8
|
+
* @param callback 回调函数
|
|
9
|
+
* @param ms 延迟时间(毫秒)
|
|
10
|
+
* @param args 传递给回调函数的参数
|
|
11
|
+
* @returns 定时器 ID
|
|
12
|
+
*/
|
|
13
|
+
export declare const setTimeout: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => any
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 清除定时器
|
|
17
|
+
* @param timeoutId 定时器 ID
|
|
18
|
+
*/
|
|
19
|
+
export declare const clearTimeout: (timeoutId: any) => void
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 设置间隔定时器
|
|
23
|
+
* @param callback 回调函数
|
|
24
|
+
* @param ms 间隔时间(毫秒)
|
|
25
|
+
* @param args 传递给回调函数的参数
|
|
26
|
+
* @returns 间隔定时器 ID
|
|
27
|
+
*/
|
|
28
|
+
export declare const setInterval: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => any
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 清除间隔定时器
|
|
32
|
+
* @param intervalId 间隔定时器 ID
|
|
33
|
+
*/
|
|
34
|
+
export declare const clearInterval: (intervalId: any) => void
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 定时器环境类型定义
|
|
38
|
+
*/
|
|
39
|
+
export interface TimerEnvironment {
|
|
40
|
+
setTimeout: typeof setTimeout
|
|
41
|
+
clearTimeout: typeof clearTimeout
|
|
42
|
+
setInterval: typeof setInterval
|
|
43
|
+
clearInterval: typeof clearInterval
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 定时器函数已在上面导出
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL API 类型定义
|
|
3
|
+
* 包含浏览器和 Node.js 环境都支持的 URL 相关 API
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* URL 类
|
|
8
|
+
* 用于解析和构造 URL
|
|
9
|
+
*/
|
|
10
|
+
declare class URL {
|
|
11
|
+
/**
|
|
12
|
+
* 构造函数
|
|
13
|
+
* @param url URL 字符串
|
|
14
|
+
* @param base 基础 URL(可选)
|
|
15
|
+
*/
|
|
16
|
+
constructor(url: string, base?: string | URL)
|
|
17
|
+
|
|
18
|
+
/** 完整的 URL 字符串 */
|
|
19
|
+
href: string
|
|
20
|
+
|
|
21
|
+
/** URL 的源(协议 + 主机名 + 端口) */
|
|
22
|
+
origin: string
|
|
23
|
+
|
|
24
|
+
/** URL 的协议部分 */
|
|
25
|
+
protocol: string
|
|
26
|
+
|
|
27
|
+
/** URL 的主机名部分 */
|
|
28
|
+
hostname: string
|
|
29
|
+
|
|
30
|
+
/** URL 的端口部分 */
|
|
31
|
+
port: string
|
|
32
|
+
|
|
33
|
+
/** URL 的路径部分 */
|
|
34
|
+
pathname: string
|
|
35
|
+
|
|
36
|
+
/** URL 的查询字符串部分 */
|
|
37
|
+
search: string
|
|
38
|
+
|
|
39
|
+
/** URL 的哈希部分 */
|
|
40
|
+
hash: string
|
|
41
|
+
|
|
42
|
+
/** URL 的用户名部分 */
|
|
43
|
+
username: string
|
|
44
|
+
|
|
45
|
+
/** URL 的密码部分 */
|
|
46
|
+
password: string
|
|
47
|
+
|
|
48
|
+
/** URL 的主机部分(主机名 + 端口) */
|
|
49
|
+
host: string
|
|
50
|
+
|
|
51
|
+
/** URL 的搜索参数对象 */
|
|
52
|
+
searchParams: URLSearchParams
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 返回 URL 的字符串表示
|
|
56
|
+
*/
|
|
57
|
+
toString(): string
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 返回 URL 的 JSON 表示
|
|
61
|
+
*/
|
|
62
|
+
toJSON(): string
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* URLSearchParams 类
|
|
67
|
+
* 用于处理 URL 查询参数
|
|
68
|
+
*/
|
|
69
|
+
declare class URLSearchParams {
|
|
70
|
+
/**
|
|
71
|
+
* 构造函数
|
|
72
|
+
* @param init 初始化参数
|
|
73
|
+
*/
|
|
74
|
+
constructor(init?: string | string[][] | Record<string, string> | URLSearchParams)
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 添加参数
|
|
78
|
+
* @param name 参数名
|
|
79
|
+
* @param value 参数值
|
|
80
|
+
*/
|
|
81
|
+
append(name: string, value: string): void
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 删除参数
|
|
85
|
+
* @param name 参数名
|
|
86
|
+
*/
|
|
87
|
+
delete(name: string): void
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 获取参数值
|
|
91
|
+
* @param name 参数名
|
|
92
|
+
*/
|
|
93
|
+
get(name: string): string | null
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 获取所有同名参数值
|
|
97
|
+
* @param name 参数名
|
|
98
|
+
*/
|
|
99
|
+
getAll(name: string): string[]
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 检查是否存在参数
|
|
103
|
+
* @param name 参数名
|
|
104
|
+
*/
|
|
105
|
+
has(name: string): boolean
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 设置参数值
|
|
109
|
+
* @param name 参数名
|
|
110
|
+
* @param value 参数值
|
|
111
|
+
*/
|
|
112
|
+
set(name: string, value: string): void
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 排序参数
|
|
116
|
+
*/
|
|
117
|
+
sort(): void
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 返回字符串表示
|
|
121
|
+
*/
|
|
122
|
+
toString(): string
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 返回迭代器
|
|
126
|
+
*/
|
|
127
|
+
[Symbol.iterator](): IterableIterator<[string, string]>
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 返回键的迭代器
|
|
131
|
+
*/
|
|
132
|
+
keys(): IterableIterator<string>
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 返回值的迭代器
|
|
136
|
+
*/
|
|
137
|
+
values(): IterableIterator<string>
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 返回键值对的迭代器
|
|
141
|
+
*/
|
|
142
|
+
entries(): IterableIterator<[string, string]>
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 遍历参数
|
|
146
|
+
* @param callback 回调函数
|
|
147
|
+
* @param thisArg this 上下文
|
|
148
|
+
*/
|
|
149
|
+
forEach(callback: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* URL 环境类型定义
|
|
154
|
+
*/
|
|
155
|
+
export interface URLEnvironment {
|
|
156
|
+
URL: typeof URL
|
|
157
|
+
URLSearchParams: typeof URLSearchParams
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// 导出 URL 相关类
|
|
161
|
+
export { URL, URLSearchParams }
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Vue 类型定义文件
|
|
2
|
+
// 仅包含必要的 Vue 类型,避免全局污染
|
|
3
|
+
|
|
4
|
+
export interface VueRuntimeFunctions {
|
|
5
|
+
createVNode: (type: any, props?: any, children?: any) => VNode
|
|
6
|
+
render: (vnode: VNode | null, container: any, isSVG?: boolean) => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export namespace Vue {
|
|
10
|
+
interface VNode {
|
|
11
|
+
__v_isVNode: true
|
|
12
|
+
type: Component | string | symbol
|
|
13
|
+
props: Record<string, any> | null
|
|
14
|
+
children: VNode[] | string | null
|
|
15
|
+
key: string | number | symbol | null
|
|
16
|
+
ref: ((el: any) => void) | string | null
|
|
17
|
+
scopeId: string | null
|
|
18
|
+
slotScopeIds: string[] | null
|
|
19
|
+
dirs: Array<{ dir: any; instance: any; value: any; oldValue: any; arg: string; modifiers: Record<string, boolean> }> | null
|
|
20
|
+
transition: any | null
|
|
21
|
+
component: ComponentInstance | null
|
|
22
|
+
suspense: any | null
|
|
23
|
+
ssContent: VNode | null
|
|
24
|
+
ssFallback: VNode | null
|
|
25
|
+
el: Element | null
|
|
26
|
+
anchor: Element | null
|
|
27
|
+
target: Element | null
|
|
28
|
+
targetAnchor: Element | null
|
|
29
|
+
staticCount: number
|
|
30
|
+
shapeFlag: number
|
|
31
|
+
patchFlag: number
|
|
32
|
+
dynamicProps: string[] | null
|
|
33
|
+
dynamicChildren: VNode[] | null
|
|
34
|
+
appContext: AppContext | null
|
|
35
|
+
ctx: ComponentInstance | null
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Component {
|
|
39
|
+
__v_isVue?: true
|
|
40
|
+
name?: string
|
|
41
|
+
setup?: (props: any, ctx: any) => any
|
|
42
|
+
render?: (ctx: any) => VNode | VNode[]
|
|
43
|
+
template?: string
|
|
44
|
+
components?: Record<string, Component>
|
|
45
|
+
directives?: Record<string, any>
|
|
46
|
+
props?: string[] | Record<string, any>
|
|
47
|
+
emits?: string[] | Record<string, any>
|
|
48
|
+
[key: string]: any
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface ComponentInstance {
|
|
52
|
+
type: Component
|
|
53
|
+
parent: ComponentInstance | null
|
|
54
|
+
appContext: AppContext
|
|
55
|
+
[key: string]: any
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface AppContext {
|
|
59
|
+
app: App
|
|
60
|
+
config: AppConfig
|
|
61
|
+
mixins: Component[]
|
|
62
|
+
components: Record<string, Component>
|
|
63
|
+
directives: Record<string, any>
|
|
64
|
+
provides: Record<string | symbol, any>
|
|
65
|
+
optionsCache: WeakMap<Component, any>
|
|
66
|
+
propsCache: WeakMap<Component, any>
|
|
67
|
+
emitsCache: WeakMap<Component, any>
|
|
68
|
+
reload?: () => void
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface App {
|
|
72
|
+
version: string
|
|
73
|
+
config: AppConfig
|
|
74
|
+
use(plugin: any, ...options: any[]): App
|
|
75
|
+
mixin(mixin: Component): App
|
|
76
|
+
component(name: string): Component | undefined
|
|
77
|
+
component(name: string, component: Component): App
|
|
78
|
+
directive(name: string): any | undefined
|
|
79
|
+
directive(name: string, directive: any): App
|
|
80
|
+
mount(rootContainer: Element | string): ComponentInstance
|
|
81
|
+
unmount(): void
|
|
82
|
+
provide<T>(key: string | symbol, value: T): App
|
|
83
|
+
[key: string]: any
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface AppConfig {
|
|
87
|
+
errorHandler?: (err: any, instance: ComponentInstance | null, info: string) => void
|
|
88
|
+
warnHandler?: (msg: string, instance: ComponentInstance | null, trace: string) => void
|
|
89
|
+
performance?: boolean
|
|
90
|
+
compilerOptions?: any
|
|
91
|
+
globalProperties?: Record<string, any>
|
|
92
|
+
optionMergeStrategies?: Record<string, any>
|
|
93
|
+
[key: string]: any
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Vue 响应式 API 类型定义
|
|
98
|
+
export interface Ref<T> {
|
|
99
|
+
value: T
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface VueReactivityAPI {
|
|
103
|
+
ref: <T>(value: T) => Ref<T>
|
|
104
|
+
onUnmounted: (fn: () => void) => void
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 导出类型
|
|
108
|
+
export type VNode = Vue.VNode
|
|
109
|
+
export type Component = Vue.Component
|
|
110
|
+
export type ComponentInstance = Vue.ComponentInstance
|
|
111
|
+
export type AppContext = Vue.AppContext
|
|
112
|
+
export type App = Vue.App
|
|
113
|
+
export type AppConfig = Vue.AppConfig
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebAssembly 环境类型定义
|
|
3
|
+
* 用于在不同环境下提供 WebAssembly API 的类型支持
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export namespace WebAssembly {
|
|
7
|
+
interface Module {}
|
|
8
|
+
|
|
9
|
+
interface Instance {
|
|
10
|
+
exports: Exports
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Memory {
|
|
14
|
+
buffer: ArrayBuffer
|
|
15
|
+
grow(pages: number): number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Exports {
|
|
19
|
+
[key: string]: any
|
|
20
|
+
memory?: Memory
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface CompileError extends Error {
|
|
24
|
+
name: 'CompileError'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface LinkError extends Error {
|
|
28
|
+
name: 'LinkError'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface RuntimeError extends Error {
|
|
32
|
+
name: 'RuntimeError'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Global {
|
|
36
|
+
value: any
|
|
37
|
+
valueOf(): any
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface Table {
|
|
41
|
+
length: number
|
|
42
|
+
get(index: number): any
|
|
43
|
+
set(index: number, value: any): void
|
|
44
|
+
grow(delta: number, value?: any): number
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 构造函数和静态方法
|
|
48
|
+
function compile(bytes: BufferSource): Promise<Module>
|
|
49
|
+
function instantiate(bytes: BufferSource, imports?: Imports): Promise<WebAssemblyInstantiatedSource>
|
|
50
|
+
function instantiate(module: Module, imports?: Imports): Promise<Instance>
|
|
51
|
+
function validate(bytes: BufferSource): boolean
|
|
52
|
+
|
|
53
|
+
// 类构造函数
|
|
54
|
+
class Module {
|
|
55
|
+
constructor(bytes: BufferSource)
|
|
56
|
+
static customSections(module: Module, sectionName: string): ArrayBuffer[]
|
|
57
|
+
static exports(module: Module): ModuleExportDescriptor[]
|
|
58
|
+
static imports(module: Module): ModuleImportDescriptor[]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
class Instance {
|
|
62
|
+
constructor(module: Module, imports?: Imports)
|
|
63
|
+
exports: Exports
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
class Memory {
|
|
67
|
+
constructor(descriptor: MemoryDescriptor)
|
|
68
|
+
buffer: ArrayBuffer
|
|
69
|
+
grow(pages: number): number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
class Table {
|
|
73
|
+
constructor(descriptor: TableDescriptor, value?: any)
|
|
74
|
+
length: number
|
|
75
|
+
get(index: number): any
|
|
76
|
+
set(index: number, value: any): void
|
|
77
|
+
grow(delta: number, value?: any): number
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
class Global {
|
|
81
|
+
constructor(descriptor: GlobalDescriptor, value?: any)
|
|
82
|
+
value: any
|
|
83
|
+
valueOf(): any
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 描述符接口
|
|
87
|
+
interface MemoryDescriptor {
|
|
88
|
+
initial: number
|
|
89
|
+
maximum?: number
|
|
90
|
+
shared?: boolean
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface TableDescriptor {
|
|
94
|
+
element: TableKind
|
|
95
|
+
initial: number
|
|
96
|
+
maximum?: number
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface GlobalDescriptor {
|
|
100
|
+
value: ValueType
|
|
101
|
+
mutable?: boolean
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface ModuleExportDescriptor {
|
|
105
|
+
name: string
|
|
106
|
+
kind: ImportExportKind
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface ModuleImportDescriptor {
|
|
110
|
+
module: string
|
|
111
|
+
name: string
|
|
112
|
+
kind: ImportExportKind
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface WebAssemblyInstantiatedSource {
|
|
116
|
+
module: Module
|
|
117
|
+
instance: Instance
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// 类型别名
|
|
121
|
+
type Imports = Record<string, ModuleImports>
|
|
122
|
+
type ModuleImports = Record<string, ExportValue>
|
|
123
|
+
type ExportValue = Function | Global | Memory | Table
|
|
124
|
+
type ValueType = 'i32' | 'i64' | 'f32' | 'f64' | 'v128' | 'funcref' | 'externref'
|
|
125
|
+
type TableKind = 'funcref' | 'externref'
|
|
126
|
+
type ImportExportKind = 'function' | 'table' | 'memory' | 'global'
|
|
127
|
+
}
|