├── .editorconfig ├── .github └── workflows │ ├── ci.yml │ └── release.yml ├── .gitignore ├── .markdownlint.json ├── .npmrc ├── .nvmrc ├── .simple-git-hooks.cjs ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.config.ts ├── commitlint.config.mjs ├── eslint.config.mjs ├── lint-staged.config.mjs ├── package.json ├── playground ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── main.ts │ ├── manifest.json │ ├── pages.json │ ├── pages │ │ └── index │ │ │ └── index.vue │ └── static │ │ └── logo.png ├── tsconfig.json └── vite.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── prettier.config.mjs ├── src ├── index.ts ├── template.ts ├── uni-badge.ts ├── uni-breadcrumb-item.ts ├── uni-breadcrumb.ts ├── uni-calendar.ts ├── uni-card.ts ├── uni-col.ts ├── uni-collapse-item.ts ├── uni-collapse.ts ├── uni-combox.ts ├── uni-countdown.ts ├── uni-data-checkbox.ts ├── uni-data-picker.ts ├── uni-data-select.ts ├── uni-dateformat.ts ├── uni-datetime-picker.ts ├── uni-drawer.ts ├── uni-easyinput.ts ├── uni-fab.ts ├── uni-fav.ts ├── uni-file-picker.ts ├── uni-forms-item.ts ├── uni-forms.ts ├── uni-goods-nav.ts ├── uni-grid-item.ts ├── uni-grid.ts ├── uni-group.ts ├── uni-icons.ts ├── uni-indexed-list.ts ├── uni-link.ts ├── uni-list-ad.ts ├── uni-list-chat.ts ├── uni-list-item.ts ├── uni-list.ts ├── uni-load-more.ts ├── uni-nav-bar.ts ├── uni-notice-bar.ts ├── uni-number-box.ts ├── uni-pagination.ts ├── uni-popup-dialog.ts ├── uni-popup-message.ts ├── uni-popup-share.ts ├── uni-popup.ts ├── uni-rate.ts ├── uni-row.ts ├── uni-search-bar.ts ├── uni-section.ts ├── uni-segmented-control.ts ├── uni-steps.ts ├── uni-swipe-action-item.ts ├── uni-swipe-action.ts ├── uni-swiper-dot.ts ├── uni-table.ts ├── uni-tag.ts ├── uni-td.ts ├── uni-th.ts ├── uni-title.ts ├── uni-tooltip.ts ├── uni-tr.ts └── uni-transition.ts ├── tests ├── uni-badge.test-d.ts ├── uni-breadcrumb-item.test-d.ts ├── uni-breadcrumb.test-d.ts ├── uni-calendar.test-d.ts ├── uni-card.test-d.ts ├── uni-col.test-d.ts ├── uni-collapse-item.test-d.ts ├── uni-collapse.test-d.ts ├── uni-combox.test-d.ts ├── uni-countdown.test-d.ts ├── uni-data-checkbox.test-d.ts ├── uni-data-picker.test-d.ts ├── uni-data-select.test-d.ts ├── uni-dateformat.test-d.ts ├── uni-datetime-picker.test-d.ts ├── uni-drawer.test-d.ts ├── uni-easyinput.test-d.ts ├── uni-fab.test-d.ts ├── uni-fav.test-d.ts ├── uni-file-picker.test-d.ts ├── uni-forms-item.test-d.ts ├── uni-forms.test-d.ts ├── uni-goods-nav.test-d.ts ├── uni-grid-item.test-d.ts ├── uni-grid.test-d.ts ├── uni-group.test-d.ts ├── uni-icons.test-d.ts ├── uni-indexed-list.test-d.ts ├── uni-link.test-d.ts ├── uni-list-ad.test-d.ts ├── uni-list-chat.test-d.ts ├── uni-list-item.test-d.ts ├── uni-list.test-d.ts ├── uni-load-more.test-d.ts ├── uni-nav-bar.test-d.ts ├── uni-notice-bar.test-d.ts ├── uni-number-box.test-d.ts ├── uni-pagination.test-d.ts ├── uni-popup-dialog.test-d.ts ├── uni-popup-message.test-d.ts ├── uni-popup-share.test-d.ts ├── uni-popup.test-d.ts ├── uni-rate.test-d.ts ├── uni-row.test-d.ts ├── uni-search-bar.test-d.ts ├── uni-section.test-d.ts ├── uni-segmented-control.test-d.ts ├── uni-steps.test-d.ts ├── uni-swipe-action-item.test-d.ts ├── uni-swipe-action.test-d.ts ├── uni-swiper-dot.test-d.ts ├── uni-table.test-d.ts ├── uni-tag.test-d.ts ├── uni-td.test-d.ts ├── uni-th.test-d.ts ├── uni-title.test-d.ts ├── uni-tooltip.test-d.ts ├── uni-tr.test-d.ts └── uni-transition.test-d.ts ├── tsconfig.json └── vitest.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | lint: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - uses: pnpm/action-setup@v3 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version-file: '.nvmrc' 20 | cache: pnpm 21 | registry-url: https://registry.npmjs.org 22 | - run: corepack enable 23 | - run: pnpm install 24 | - run: pnpm run build 25 | - run: pnpm run lint 26 | 27 | typecheck: 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v4 31 | - uses: pnpm/action-setup@v3 32 | - uses: actions/setup-node@v4 33 | with: 34 | node-version-file: '.nvmrc' 35 | cache: pnpm 36 | registry-url: https://registry.npmjs.org 37 | - run: corepack enable 38 | - run: pnpm install 39 | - run: pnpm run typecheck 40 | 41 | test: 42 | runs-on: ubuntu-latest 43 | steps: 44 | - uses: actions/checkout@v4 45 | - uses: pnpm/action-setup@v3 46 | - uses: actions/setup-node@v4 47 | with: 48 | node-version-file: '.nvmrc' 49 | cache: pnpm 50 | registry-url: https://registry.npmjs.org 51 | - run: corepack enable 52 | - run: pnpm install 53 | - run: pnpm run test 54 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v4 14 | with: 15 | fetch-depth: 0 16 | - uses: pnpm/action-setup@v3 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version-file: .nvmrc 20 | cache: pnpm 21 | registry-url: https://registry.npmjs.org 22 | - run: corepack enable 23 | - run: pnpm install 24 | - run: pnpm publish --access public --no-git-checks 25 | env: 26 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 27 | - run: pnpx changelogithub 28 | env: 29 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | pnpm-debug.log* 9 | run 10 | 11 | # Diagnostic reports (https://nodejs.org/api/report.html) 12 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | *.lcov 26 | 27 | # nyc test coverage 28 | .nyc_output 29 | 30 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 31 | .grunt 32 | 33 | # Bower dependency directory (https://bower.io/) 34 | bower_components 35 | 36 | # node-waf configuration 37 | .lock-wscript 38 | 39 | # Compiled binary addons (https://nodejs.org/api/addons.html) 40 | build/Release 41 | 42 | # Dependency directories 43 | node_modules 44 | jspm_packages 45 | 46 | # Snowpack dependency directory (https://snowpack.dev/) 47 | web_modules 48 | 49 | # Temp directory 50 | .temp 51 | .tmp 52 | 53 | # TypeScript cache 54 | *.tsbuildinfo 55 | 56 | # Optional npm cache directory 57 | .npm 58 | 59 | # Optional eslint cache 60 | .eslintcache 61 | 62 | # Microbundle cache 63 | .rpt2_cache 64 | .rts2_cache_cjs 65 | .rts2_cache_es 66 | .rts2_cache_umd 67 | 68 | # Optional REPL history 69 | .node_repl_history 70 | 71 | # Output of 'npm pack' 72 | *.tgz 73 | 74 | # Yarn Integrity file 75 | .yarn-integrity 76 | 77 | # dotenv environment variables file 78 | .env 79 | .env.test 80 | .env.*.test 81 | .env.local 82 | .env.*.local 83 | *.local 84 | 85 | # parcel-bundler cache (https://parceljs.org/) 86 | .cache 87 | .parcel-cache 88 | 89 | # Electron 90 | dist-electron 91 | dist_electron 92 | 93 | # Tauri 94 | dist-tauri 95 | dist_tauri 96 | 97 | # Cordova 98 | dist-cordova 99 | dist_cordova 100 | 101 | # Capacitor 102 | dist-capacitor 103 | dist_capacitor 104 | 105 | # Next.js build output 106 | .next 107 | out 108 | 109 | # Umi.js build output 110 | .umi 111 | .umi-production 112 | .umi-test 113 | 114 | # Nuxt.js build / generate output 115 | .nuxt 116 | dist 117 | 118 | # Rax.js build 119 | .rax 120 | 121 | # Vuepress build output 122 | .vuepress/dist 123 | 124 | # SSR 125 | dist-ssr 126 | dist_ssr 127 | 128 | # SSG 129 | dist-ssg 130 | dist_ssg 131 | 132 | # Serverless 133 | .serverless 134 | .dynamodb 135 | .s3 136 | .buckets 137 | .seeds 138 | 139 | # FuseBox cache 140 | .fusebox 141 | 142 | # TernJS port file 143 | .tern-port 144 | 145 | # Cypress 146 | /cypress/videos/ 147 | /cypress/screenshots/ 148 | 149 | # Editor 150 | .vscode-test 151 | .vscode/** 152 | !.vscode/extensions.json 153 | !.vscode/settings.json 154 | *.vsix 155 | .idea 156 | .hbuilder 157 | .hbuilderx 158 | *.suo 159 | *.ntvs* 160 | *.njsproj 161 | *.sln 162 | *.sw? 163 | 164 | # yarn v2 165 | .yarn/cache 166 | .yarn/unplugged 167 | .yarn/build-state.yml 168 | .yarn/install-state.gz 169 | .pnp.* 170 | 171 | # Apple 172 | .DS_Store 173 | *.p12 174 | *.mobileprovision 175 | 176 | # Android 177 | *.keystore 178 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json", 3 | "extends": "@modyqyw/fabric/markdownlint.json" 4 | } 5 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist=true 2 | registry=https://registry.npmjs.org/ 3 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /.simple-git-hooks.cjs: -------------------------------------------------------------------------------- 1 | require('esbuild-register'); 2 | const { simpleGitHooks } = require('@modyqyw/fabric'); 3 | 4 | module.exports = simpleGitHooks(); 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "DavidAnson.vscode-markdownlint", 4 | "dbaeumer.vscode-eslint", 5 | "EditorConfig.EditorConfig", 6 | "esbenp.prettier-vscode" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[javascript][javascriptreact][typescript][typescriptreact][vue][markdown][json][jsonc][yaml]": { 3 | "editor.codeActionsOnSave": { 4 | "source.fixAll.eslint": "explicit" 5 | } 6 | }, 7 | "[markdown]": { 8 | "editor.codeActionsOnSave": { 9 | "source.fixAll.markdownlint": "explicit" 10 | } 11 | }, 12 | "editor.defaultFormatter": "esbenp.prettier-vscode", 13 | "editor.formatOnSave": true, 14 | "eslint.experimental.useFlatConfig": true, 15 | "eslint.validate": [ 16 | "javascript", 17 | "javascriptreact", 18 | "typescript", 19 | "typescriptreact", 20 | "vue", 21 | "markdown", 22 | "json", 23 | "jsonc", 24 | "yaml" 25 | ], 26 | "prettier.enable": true 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-present uni-helper 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.config.ts: -------------------------------------------------------------------------------- 1 | import { unlink } from 'node:fs/promises'; 2 | import { resolve } from 'node:path'; 3 | import { defineBuildConfig } from 'unbuild'; 4 | 5 | export default defineBuildConfig({ 6 | clean: true, 7 | declaration: true, 8 | entries: ['./src/index'], 9 | hooks: { 10 | 'build:done': async (ctx) => { 11 | const outDir = ctx.options.outDir; 12 | const emptyBuildEntries = ctx.buildEntries.filter( 13 | (entry) => entry.exports?.length === 0, 14 | ); 15 | await Promise.all( 16 | emptyBuildEntries.map((entry) => { 17 | return unlink(resolve(outDir, entry.path)); 18 | }), 19 | ); 20 | }, 21 | }, 22 | rollup: { 23 | emitCJS: true, 24 | inlineDependencies: true, 25 | }, 26 | }); 27 | -------------------------------------------------------------------------------- /commitlint.config.mjs: -------------------------------------------------------------------------------- 1 | import { commitlint } from '@modyqyw/fabric'; 2 | 3 | export default commitlint(); 4 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { eslint } from '@modyqyw/fabric'; 2 | 3 | export default eslint({ 4 | perfectionist: false, 5 | typescript: { 6 | rules: { 7 | '@typescript-eslint/no-namespace': 'off', 8 | }, 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /lint-staged.config.mjs: -------------------------------------------------------------------------------- 1 | import { lintStaged } from '@modyqyw/fabric'; 2 | 3 | export default lintStaged(); 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@uni-helper/uni-ui-types", 3 | "version": "0.5.15", 4 | "description": "uni-ui 组件类型", 5 | "keywords": [ 6 | "uni-app", 7 | "uniapp", 8 | "uni-ui", 9 | "uniui", 10 | "type" 11 | ], 12 | "homepage": "https://github.com/uni-helper/uni-ui-types#readme", 13 | "bugs": { 14 | "url": "https://github.com/uni-helper/uni-ui-types/issues" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/uni-helper/uni-ui-types.git" 19 | }, 20 | "license": "MIT", 21 | "author": { 22 | "name": "ModyQyW", 23 | "email": "wurui.dev@gmail.com", 24 | "url": "https://modyqyw.top" 25 | }, 26 | "type": "module", 27 | "exports": { 28 | ".": { 29 | "import": { 30 | "types": "./dist/index.d.mts" 31 | }, 32 | "require": { 33 | "types": "./dist/index.d.cts" 34 | } 35 | } 36 | }, 37 | "types": "./dist/index.d.ts", 38 | "typesVersions": { 39 | "*": { 40 | "*": [ 41 | "./dist/*", 42 | "./dist/index.d.ts" 43 | ] 44 | } 45 | }, 46 | "files": [ 47 | "dist" 48 | ], 49 | "scripts": { 50 | "build": "unbuild", 51 | "depupdate": "taze -fw", 52 | "dev": "unbuild --stub", 53 | "format": "prettier . \"!**/package-lock.json*\" \"!**/yarn.lock\" \"!**/pnpm-lock.yaml\" --ignore-unknown --write --cache --log-level=warn", 54 | "lint": "conc \"pnpm:lint:eslint\" \"pnpm:lint:markdownlint\" \"pnpm:lint:publint\"", 55 | "lint:eslint": "eslint ./src --fix --cache", 56 | "lint:markdownlint": "markdownlint . --fix --ignore-path=.gitignore", 57 | "lint:publint": "publint", 58 | "prepare": "is-ci || simple-git-hooks", 59 | "prepublishOnly": "pnpm run build", 60 | "release": "pnpm install && pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run test && bumpp", 61 | "test": "vitest --typecheck --run", 62 | "test:coverage": "vitest --typecheck --run --coverage", 63 | "typecheck": "tsc --noEmit" 64 | }, 65 | "dependencies": { 66 | "@dcloudio/types": "^3.4.8", 67 | "@uni-helper/uni-app-types": "^0.5.13", 68 | "vue3": "npm:vue@^3.4.27" 69 | }, 70 | "devDependencies": { 71 | "@commitlint/cli": "^19.3.0", 72 | "@modyqyw/fabric": "^10.9.5", 73 | "@tsconfig/node20": "^20.1.4", 74 | "@types/node": "^20.12.12", 75 | "@vitest/coverage-v8": "^1.6.0", 76 | "bumpp": "^9.4.1", 77 | "concurrently": "^8.2.2", 78 | "esbuild-register": "^3.5.0", 79 | "eslint": "^8.57.0", 80 | "is-ci": "^3.0.1", 81 | "lint-staged": "^15.2.2", 82 | "markdownlint-cli": "^0.40.0", 83 | "prettier": "^3.2.5", 84 | "publint": "^0.2.7", 85 | "simple-git-hooks": "^2.11.1", 86 | "taze": "^0.13.8", 87 | "typescript": "^5.4.5", 88 | "unbuild": "^2.0.0", 89 | "vitest": "^1.6.0" 90 | }, 91 | "peerDependencies": { 92 | "@uni-helper/uni-app-types": "^0.5.13", 93 | "typescript": "^4.8.0 || ^5.0.0" 94 | }, 95 | "peerDependenciesMeta": { 96 | "@uni-helper/uni-app-types": { 97 | "optional": true 98 | } 99 | }, 100 | "packageManager": "pnpm@9.1.1", 101 | "engines": { 102 | "node": ">=14.18" 103 | }, 104 | "publishConfig": { 105 | "access": "public", 106 | "registry": "https://registry.npmjs.org/" 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /playground/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /playground/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uni-preset-vue", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "build:app": "uni build -p app", 6 | "build:app-android": "uni build -p app-android", 7 | "build:app-ios": "uni build -p app-ios", 8 | "build:custom": "uni build -p", 9 | "build:h5": "uni build", 10 | "build:h5:ssr": "uni build --ssr", 11 | "build:mp-alipay": "uni build -p mp-alipay", 12 | "build:mp-baidu": "uni build -p mp-baidu", 13 | "build:mp-kuaishou": "uni build -p mp-kuaishou", 14 | "build:mp-lark": "uni build -p mp-lark", 15 | "build:mp-qq": "uni build -p mp-qq", 16 | "build:mp-toutiao": "uni build -p mp-toutiao", 17 | "build:mp-weixin": "uni build -p mp-weixin", 18 | "build:quickapp-webview": "uni build -p quickapp-webview", 19 | "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", 20 | "build:quickapp-webview-union": "uni build -p quickapp-webview-union", 21 | "dev:app": "uni -p app", 22 | "dev:app-android": "uni -p app-android", 23 | "dev:app-ios": "uni -p app-ios", 24 | "dev:custom": "uni -p", 25 | "dev:h5": "uni", 26 | "dev:h5:ssr": "uni --ssr", 27 | "dev:mp-alipay": "uni -p mp-alipay", 28 | "dev:mp-baidu": "uni -p mp-baidu", 29 | "dev:mp-kuaishou": "uni -p mp-kuaishou", 30 | "dev:mp-lark": "uni -p mp-lark", 31 | "dev:mp-qq": "uni -p mp-qq", 32 | "dev:mp-toutiao": "uni -p mp-toutiao", 33 | "dev:mp-weixin": "uni -p mp-weixin", 34 | "dev:quickapp-webview": "uni -p quickapp-webview", 35 | "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei", 36 | "dev:quickapp-webview-union": "uni -p quickapp-webview-union" 37 | }, 38 | "dependencies": { 39 | "@dcloudio/uni-app": "3.0.0-4010520240507001", 40 | "@dcloudio/uni-app-plus": "3.0.0-4010520240507001", 41 | "@dcloudio/uni-components": "3.0.0-4010520240507001", 42 | "@dcloudio/uni-h5": "3.0.0-4010520240507001", 43 | "@dcloudio/uni-mp-alipay": "3.0.0-4010520240507001", 44 | "@dcloudio/uni-mp-baidu": "3.0.0-4010520240507001", 45 | "@dcloudio/uni-mp-kuaishou": "3.0.0-4010520240507001", 46 | "@dcloudio/uni-mp-lark": "3.0.0-4010520240507001", 47 | "@dcloudio/uni-mp-qq": "3.0.0-4010520240507001", 48 | "@dcloudio/uni-mp-toutiao": "3.0.0-4010520240507001", 49 | "@dcloudio/uni-mp-weixin": "3.0.0-4010520240507001", 50 | "@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001", 51 | "@dcloudio/uni-ui": "1.5.5", 52 | "vue": "3.4.27", 53 | "vue-i18n": "9.13.1" 54 | }, 55 | "devDependencies": { 56 | "@dcloudio/types": "3.4.8", 57 | "@dcloudio/uni-automator": "3.0.0-4010520240507001", 58 | "@dcloudio/uni-cli-shared": "3.0.0-4010520240507001", 59 | "@dcloudio/uni-stacktracey": "3.0.0-4010520240507001", 60 | "@dcloudio/vite-plugin-uni": "3.0.0-4010520240507001", 61 | "@uni-helper/uni-app-types": "0.5.13", 62 | "@uni-helper/uni-ui-types": "workspace:*", 63 | "sass": "1.77.1", 64 | "typescript": "5.4.5", 65 | "vite": "5.2.11" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /playground/src/App.vue: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /playground/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createSSRApp } from 'vue'; 2 | import App from './App.vue'; 3 | export function createApp() { 4 | const app = createSSRApp(App); 5 | return { 6 | app, 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /playground/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "", 3 | "appid" : "", 4 | "description" : "", 5 | "versionName" : "1.0.0", 6 | "versionCode" : "100", 7 | "transformPx" : false, 8 | /* 5+App特有相关 */ 9 | "app-plus" : { 10 | "usingComponents" : true, 11 | "nvueStyleCompiler" : "uni-app", 12 | "compilerVersion" : 3, 13 | "splashscreen" : { 14 | "alwaysShowBeforeRender" : true, 15 | "waiting" : true, 16 | "autoclose" : true, 17 | "delay" : 0 18 | }, 19 | /* 模块配置 */ 20 | "modules" : {}, 21 | /* 应用发布信息 */ 22 | "distribute" : { 23 | /* android打包配置 */ 24 | "android" : { 25 | "permissions" : [ 26 | "", 27 | "", 28 | "", 29 | "", 30 | "", 31 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | "", 37 | "", 38 | "", 39 | "", 40 | "" 41 | ] 42 | }, 43 | /* ios打包配置 */ 44 | "ios" : {}, 45 | /* SDK配置 */ 46 | "sdkConfigs" : {} 47 | } 48 | }, 49 | /* 快应用特有相关 */ 50 | "quickapp" : {}, 51 | /* 小程序特有相关 */ 52 | "mp-weixin" : { 53 | "appid" : "", 54 | "setting" : { 55 | "urlCheck" : false 56 | }, 57 | "usingComponents" : true 58 | }, 59 | "mp-alipay" : { 60 | "usingComponents" : true 61 | }, 62 | "mp-baidu" : { 63 | "usingComponents" : true 64 | }, 65 | "mp-toutiao" : { 66 | "usingComponents" : true 67 | }, 68 | "uniStatistics": { 69 | "enable": false 70 | }, 71 | "vueVersion" : "3" 72 | } 73 | -------------------------------------------------------------------------------- /playground/src/pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "easycom": { 3 | "autoscan": true, 4 | "custom": { 5 | // uni-ui 规则如下配置 6 | "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" 7 | } 8 | }, 9 | "pages": [ 10 | //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages 11 | { 12 | "path": "pages/index/index", 13 | "style": { 14 | "navigationBarTitleText": "uni-app" 15 | } 16 | } 17 | ], 18 | "globalStyle": { 19 | "navigationBarTextStyle": "black", 20 | "navigationBarTitleText": "uni-app", 21 | "navigationBarBackgroundColor": "#F8F8F8", 22 | "backgroundColor": "#F8F8F8" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /playground/src/pages/index/index.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 14 | 15 | 42 | -------------------------------------------------------------------------------- /playground/src/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uni-helper/uni-ui-types/67e07d61d4344e904a0fb2b45967ac77c1b48ac8/playground/src/static/logo.png -------------------------------------------------------------------------------- /playground/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"], 13 | "types": [ 14 | "vite/client", 15 | "@dcloudio/types", 16 | "@uni-helper/uni-app-types", 17 | "@uni-helper/uni-ui-types" 18 | ] 19 | }, 20 | "vueCompilerOptions": { 21 | "experimentalRuntimeMode": "runtime-uni-app", 22 | "nativeTags": ["block", "component", "template", "slot"], 23 | "plugins": ["@uni-helper/uni-app-types/volar-plugin"] 24 | }, 25 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 26 | } 27 | -------------------------------------------------------------------------------- /playground/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import uni from '@dcloudio/vite-plugin-uni'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [uni()], 7 | }); 8 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - playground 3 | - '!**/tests/**' 4 | -------------------------------------------------------------------------------- /prettier.config.mjs: -------------------------------------------------------------------------------- 1 | import { prettier } from '@modyqyw/fabric'; 2 | 3 | export default prettier(); 4 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './uni-badge'; 2 | export * from './uni-breadcrumb'; 3 | export * from './uni-breadcrumb-item'; 4 | export * from './uni-calendar'; 5 | export * from './uni-card'; 6 | export * from './uni-col'; 7 | export * from './uni-collapse'; 8 | export * from './uni-collapse-item'; 9 | export * from './uni-combox'; 10 | export * from './uni-countdown'; 11 | export * from './uni-data-checkbox'; 12 | export * from './uni-data-picker'; 13 | export * from './uni-data-select'; 14 | export * from './uni-dateformat'; 15 | export * from './uni-datetime-picker'; 16 | export * from './uni-drawer'; 17 | export * from './uni-easyinput'; 18 | export * from './uni-fab'; 19 | export * from './uni-fav'; 20 | export * from './uni-file-picker'; 21 | export * from './uni-forms'; 22 | export * from './uni-forms-item'; 23 | export * from './uni-goods-nav'; 24 | export * from './uni-grid'; 25 | export * from './uni-grid-item'; 26 | export * from './uni-group'; 27 | export * from './uni-icons'; 28 | export * from './uni-indexed-list'; 29 | export * from './uni-link'; 30 | export * from './uni-list'; 31 | export * from './uni-list-ad'; 32 | export * from './uni-list-chat'; 33 | export * from './uni-list-item'; 34 | export * from './uni-load-more'; 35 | export * from './uni-nav-bar'; 36 | export * from './uni-notice-bar'; 37 | export * from './uni-number-box'; 38 | export * from './uni-pagination'; 39 | export * from './uni-popup'; 40 | export * from './uni-popup-dialog'; 41 | export * from './uni-popup-message'; 42 | export * from './uni-popup-share'; 43 | export * from './uni-rate'; 44 | export * from './uni-row'; 45 | export * from './uni-search-bar'; 46 | export * from './uni-section'; 47 | export * from './uni-segmented-control'; 48 | export * from './uni-steps'; 49 | export * from './uni-swipe-action'; 50 | export * from './uni-swipe-action-item'; 51 | export * from './uni-swiper-dot'; 52 | export * from './uni-table'; 53 | export * from './uni-tag'; 54 | export * from './uni-tr'; 55 | export * from './uni-td'; 56 | export * from './uni-th'; 57 | export * from './uni-title'; 58 | export * from './uni-tooltip'; 59 | export * from './uni-transition'; 60 | -------------------------------------------------------------------------------- /src/template.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | // eslint-disable-next-line @typescript-eslint/ban-types 4 | type _TemplateProps = Partial<{}>; 5 | 6 | type _Template = Component<_TemplateProps>; 7 | 8 | type _TemplateInstance = InstanceType<_Template>; 9 | 10 | export { 11 | _TemplateProps as TemplateProps, 12 | _Template as Template, 13 | _TemplateInstance as TemplateInstance, 14 | }; 15 | 16 | // declare global { 17 | // namespace UniHelper { 18 | // export type TemplateProps = _TemplateProps; 19 | // export type Template = _Template; 20 | // export type TemplateInstance = _TemplateInstance; 21 | // } 22 | // } 23 | 24 | // declare module '@vue/runtime-core' { 25 | // export interface GlobalComponents { 26 | // Template: _Template; 27 | // } 28 | // } 29 | -------------------------------------------------------------------------------- /src/uni-breadcrumb-item.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniBreadcrumbItemProps = Partial<{ 4 | /** 路由跳转页面路径 */ 5 | to: string; 6 | /** 7 | * 在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录 8 | * 9 | * 默认为 false 10 | */ 11 | replace: boolean; 12 | }>; 13 | 14 | type _UniBreadcrumbItem = Component<_UniBreadcrumbItemProps>; 15 | 16 | type _UniBreadcrumbItemInstance = InstanceType<_UniBreadcrumbItem>; 17 | 18 | export { 19 | _UniBreadcrumbItemProps as UniBreadcrumbItemProps, 20 | _UniBreadcrumbItem as UniBreadcrumbItem, 21 | _UniBreadcrumbItemInstance as UniBreadcrumbItemInstance, 22 | }; 23 | 24 | declare global { 25 | namespace UniHelper { 26 | export type UniBreadcrumbItemProps = _UniBreadcrumbItemProps; 27 | export type UniBreadcrumbItem = _UniBreadcrumbItem; 28 | export type UniBreadcrumbItemInstance = _UniBreadcrumbItemInstance; 29 | } 30 | } 31 | 32 | declare module '@vue/runtime-core' { 33 | export interface GlobalComponents { 34 | UniBreadcrumbItem: _UniBreadcrumbItem; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/uni-breadcrumb.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 面包屑属性 */ 4 | type _UniBreadcrumbProps = Partial<{ 5 | /** 6 | * 分隔符 7 | * 8 | * 默认为 / 9 | */ 10 | separator: string; 11 | /** 分隔符类名 */ 12 | separatorClass: string; 13 | }>; 14 | 15 | /** 16 | * 面包屑 17 | * 18 | * 显示当前页面的路径,快速返回之前的任意页面 19 | */ 20 | type _UniBreadcrumb = Component<_UniBreadcrumbProps>; 21 | 22 | /** 面包屑实例 */ 23 | type _UniBreadcrumbInstance = InstanceType<_UniBreadcrumb>; 24 | 25 | export { 26 | _UniBreadcrumbProps as UniBreadcrumbProps, 27 | _UniBreadcrumb as UniBreadcrumb, 28 | _UniBreadcrumbInstance as UniBreadcrumbInstance, 29 | }; 30 | 31 | declare global { 32 | namespace UniHelper { 33 | /** 面包屑属性 */ 34 | export type UniBreadcrumbProps = _UniBreadcrumbProps; 35 | /** 36 | * 面包屑 37 | * 38 | * 显示当前页面的路径,快速返回之前的任意页面 39 | */ 40 | export type UniBreadcrumb = _UniBreadcrumb; 41 | /** 面包屑实例 */ 42 | export type UniBreadcrumbInstance = _UniBreadcrumbInstance; 43 | } 44 | } 45 | 46 | declare module '@vue/runtime-core' { 47 | export interface GlobalComponents { 48 | /** 49 | * 面包屑 50 | * 51 | * 显示当前页面的路径,快速返回之前的任意页面 52 | */ 53 | UniBreadcrumb: _UniBreadcrumb; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/uni-card.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniCardOnClickType = 'cover' | 'title' | 'extra' | 'content' | 'actions'; 4 | 5 | /** 点击事件 */ 6 | interface _UniCardOnClick { 7 | (type: _UniCardOnClickType): void; 8 | } 9 | 10 | /** 卡片组件属性 */ 11 | type _UniCardProps = Partial<{ 12 | /** 标题文字 */ 13 | title: string; 14 | /** 副标题文字 */ 15 | subTitle: string; 16 | /** 标题额外信息 */ 17 | extra: string; 18 | /** 19 | * 标题左侧缩略图,支持网络图片和本地图片 20 | * 21 | * 本地图片需要传入绝对路径 22 | */ 23 | thumbnail: string; 24 | /** 25 | * 封面图,支持网络图片和本地图片 26 | * 27 | * 本图片需要传入绝对路径 28 | */ 29 | cover: string; 30 | /** 31 | * 卡片内容是否通栏 32 | * 33 | * true 去除 padding 34 | * 35 | * false 保留 padding 36 | * 37 | * 默认为 false 38 | */ 39 | isFull: boolean; 40 | /** 41 | * 是否开启阴影 42 | * 43 | * 默认为 true 44 | */ 45 | isShadow: boolean; 46 | /** 47 | * 卡片阴影 48 | * 49 | * 默认为 0px 0px 3px 1px rgba(0, 0, 0, 0.08) 50 | */ 51 | shadow: string; 52 | /** 53 | * 是否显示卡片边框 54 | * 55 | * 默认为 true 56 | */ 57 | border: boolean; 58 | /** 59 | * 卡片外边距 60 | * 61 | * 默认为 15px 62 | */ 63 | margin: string; 64 | /** 65 | * 卡片内边距 66 | * 67 | * 默认为 0 10px 68 | */ 69 | spacing: string; 70 | /** 71 | * 卡片内容内边距 72 | * 73 | * 默认为 10px 74 | */ 75 | padding: string; 76 | /** 点击事件 */ 77 | onClick: _UniCardOnClick; 78 | }>; 79 | 80 | /** 81 | * 卡片组件通用来显示完整独立的一段信息,同时让用户理解它的作用 82 | * 83 | * 例如一篇文章的预览图、作者信息、时间等 84 | * 85 | * 卡片通常是更复杂和更详细信息的入口点 86 | */ 87 | type _UniCard = Component<_UniCardProps>; 88 | 89 | /** 卡片组件实例 */ 90 | type _UniCardInstance = InstanceType<_UniCard>; 91 | 92 | export { 93 | _UniCardOnClickType as UniCardOnClickType, 94 | _UniCardOnClick as UniCardOnClick, 95 | _UniCardProps as UniCardProps, 96 | _UniCard as UniCard, 97 | _UniCardInstance as UniCardInstance, 98 | }; 99 | 100 | declare global { 101 | namespace UniHelper { 102 | export type UniCardOnClickType = _UniCardOnClickType; 103 | /** 点击事件 */ 104 | export interface UniCardOnClick extends _UniCardOnClick {} 105 | /** 卡片组件属性 */ 106 | export type UniCardProps = _UniCardProps; 107 | /** 108 | * 卡片组件通用来显示完整独立的一段信息,同时让用户理解它的作用 109 | * 110 | * 例如一篇文章的预览图、作者信息、时间等 111 | * 112 | * 卡片通常是更复杂和更详细信息的入口点 113 | */ 114 | export type UniCard = _UniCard; 115 | /** 卡片组件实例 */ 116 | export type UniCardInstance = _UniCardInstance; 117 | } 118 | } 119 | 120 | declare module '@vue/runtime-core' { 121 | export interface GlobalComponents { 122 | /** 123 | * 卡片组件通用来显示完整独立的一段信息,同时让用户理解它的作用 124 | * 125 | * 例如一篇文章的预览图、作者信息、时间等 126 | * 127 | * 卡片通常是更复杂和更详细信息的入口点 128 | */ 129 | UniCard: _UniCard; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/uni-col.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 栅格规则 */ 4 | type _UniColRules = Partial<{ 5 | /** 6 | * 栅格占据的列数 7 | * 8 | * 默认为 24 9 | */ 10 | span: number; 11 | /** 栅格左侧间隔格数 */ 12 | offset: number; 13 | /** 栅格向右偏移格数 */ 14 | push: number; 15 | /** 栅格向左偏移格数 */ 16 | pull: number; 17 | }>; 18 | 19 | /** 列属性 */ 20 | type _UniColProps = _UniColRules & 21 | Partial<{ 22 | /** 屏幕宽度 <768px 时,要显示的栅格规则 */ 23 | xs: number | _UniColRules; 24 | /** 屏幕宽度 ≥768px 时,要显示的栅格规则 */ 25 | sm: number | _UniColRules; 26 | /** 屏幕宽度 ≥992px 时,要显示的栅格规则 */ 27 | md: number | _UniColRules; 28 | /** 屏幕宽度 ≥1200px 时,要显示的栅格规则 */ 29 | lg: number | _UniColRules; 30 | /** 屏幕宽度 ≥1920px 时,要显示的栅格规则 */ 31 | xl: number | _UniColRules; 32 | }>; 33 | 34 | /** 流式栅格系统中的列 */ 35 | type _UniCol = Component<_UniColProps>; 36 | 37 | /** 流式栅格系统中的列实例 */ 38 | type _UniColInstance = InstanceType<_UniCol>; 39 | 40 | export { 41 | _UniColRules as UniColRules, 42 | _UniColProps as UniColProps, 43 | _UniCol as UniCol, 44 | _UniColInstance as UniColInstance, 45 | }; 46 | 47 | declare global { 48 | namespace UniHelper { 49 | /** 栅格规则 */ 50 | export type UniColRules = _UniColRules; 51 | /** 列属性 */ 52 | export type UniColProps = _UniColProps; 53 | /** 流式栅格系统中的列 */ 54 | export type UniCol = _UniCol; 55 | /** 流式栅格系统中的列实例 */ 56 | export type UniColInstance = _UniColInstance; 57 | } 58 | } 59 | 60 | declare module '@vue/runtime-core' { 61 | export interface GlobalComponents { 62 | /** 流式栅格系统中的列 */ 63 | UniCol: _UniCol; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/uni-collapse-item.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 折叠面板标题分隔线 5 | * 6 | * auto 分隔线自动显示 7 | * 8 | * none 不显示分隔线 9 | * 10 | * show 一直显示分隔线 11 | */ 12 | type _UniCollapseItemTitleBorder = 'auto' | 'none' | 'show'; 13 | 14 | type _UniCollapseItemProps = Partial<{ 15 | /** 标题文字 */ 16 | title: string; 17 | /** 标题左侧缩略图 */ 18 | thumb: string; 19 | /** 20 | * 是否禁用 21 | * 22 | * 默认为 false 23 | */ 24 | disabled: boolean; 25 | /** 26 | * 是否展开面板 27 | * 28 | * 不要和 uni-collapse value / v-model 一起使用 29 | * 30 | * 默认为 false 31 | */ 32 | open: boolean; 33 | /** 34 | * 是否开启动画 35 | * 36 | * 默认为 false 37 | */ 38 | showAnimation: boolean; 39 | /** 40 | * 是否显示分隔线 41 | * 42 | * 默认为 true 43 | */ 44 | border: boolean; 45 | /** 46 | * 折叠面板标题分隔线 47 | * 48 | * auto 分隔线自动显示 49 | * 50 | * none 不显示分隔线 51 | * 52 | * show 一直显示分隔线 53 | * 54 | * 默认为 auto 55 | */ 56 | titleBorder: _UniCollapseItemTitleBorder; 57 | /** 58 | * 是否显示右侧箭头 59 | * 60 | * 默认为 true 61 | */ 62 | showArrow: boolean; 63 | }>; 64 | 65 | type _UniCollapseItem = Component<_UniCollapseItemProps>; 66 | 67 | type _UniCollapseItemInstance = InstanceType<_UniCollapseItem>; 68 | 69 | export { 70 | _UniCollapseItemTitleBorder as UniCollapseItemTitleBorder, 71 | _UniCollapseItemProps as UniCollapseItemProps, 72 | _UniCollapseItem as UniCollapseItem, 73 | _UniCollapseItemInstance as UniCollapseItemInstance, 74 | }; 75 | 76 | declare global { 77 | namespace UniHelper { 78 | /** 79 | * 折叠面板标题分隔线 80 | * 81 | * auto 分隔线自动显示 82 | * 83 | * none 不显示分隔线 84 | * 85 | * show 一直显示分隔线 86 | */ 87 | export type UniCollapseItemTitleBorder = _UniCollapseItemTitleBorder; 88 | export type UniCollapseItemProps = _UniCollapseItemProps; 89 | export type UniCollapseItem = _UniCollapseItem; 90 | export type UniCollapseItemInstance = _UniCollapseItemInstance; 91 | } 92 | } 93 | 94 | declare module '@vue/runtime-core' { 95 | export interface GlobalComponents { 96 | UniCollapseItem: _UniCollapseItem; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/uni-combox.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 组合框值 */ 4 | type _UniComboxValue = string; 5 | 6 | /** 输入时触发 */ 7 | interface _UniComboxOnInput { 8 | (value: _UniComboxValue): void; 9 | } 10 | 11 | /** 组合框属性 */ 12 | type _UniComboxProps = Partial<{ 13 | /** 14 | * 是否显示边框 15 | * 16 | * 默认为 true 17 | */ 18 | border: boolean; 19 | /** 标签文字 */ 20 | label: string; 21 | /** 组合框值 */ 22 | value: _UniComboxValue; 23 | /** 24 | * 标签宽度 25 | * 26 | * 默认为 auto 27 | */ 28 | labelWidth: string; 29 | /** 输入框占位符 */ 30 | placeholder: string; 31 | /** 32 | * 候选字段 33 | * 34 | * 默认为 [] 35 | */ 36 | candidates: string | string[]; 37 | /** 38 | * 无匹配项时的提示语 39 | * 40 | * 默认为 无匹配项 41 | */ 42 | emptyTips: string; 43 | /** 输入时触发 */ 44 | onInput: _UniComboxOnInput; 45 | }>; 46 | 47 | /** 组合框组件,一般用于可以选择也可以输入的表单项 */ 48 | type _UniCombox = Component<_UniComboxProps>; 49 | 50 | /** 组合框组件实例 */ 51 | type _UniComboxInstance = InstanceType<_UniCombox>; 52 | 53 | export { 54 | _UniComboxValue as UniComboxValue, 55 | _UniComboxOnInput as UniComboxOnInput, 56 | _UniComboxProps as UniComboxProps, 57 | _UniCombox as UniCombox, 58 | _UniComboxInstance as UniComboxInstance, 59 | }; 60 | 61 | declare global { 62 | namespace UniHelper { 63 | /** 组合框值 */ 64 | export type UniComboxValue = _UniComboxValue; 65 | /** 输入时触发 */ 66 | export interface UniComboxOnInput extends _UniComboxOnInput {} 67 | /** 组合框属性 */ 68 | export type UniComboxProps = _UniComboxProps; 69 | /** 组合框组件,一般用于可以选择也可以输入的表单项 */ 70 | export type UniCombox = _UniCombox; 71 | /** 组合框组件实例 */ 72 | export type UniComboxInstance = _UniComboxInstance; 73 | } 74 | } 75 | 76 | declare module '@vue/runtime-core' { 77 | export interface GlobalComponents { 78 | /** 组合框组件,一般用于可以选择也可以输入的表单项 */ 79 | UniCombox: _UniCombox; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/uni-countdown.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 动态更新时间后,刷新组件显示 */ 4 | interface _UniCountdownOnUpdate { 5 | (): void; 6 | } 7 | 8 | /** 倒计时时间到触发事件 */ 9 | interface _UniCountdownOnTimeup { 10 | (): void; 11 | } 12 | 13 | /** 倒计时属性 */ 14 | type _UniCountdownProps = Partial<{ 15 | /** 16 | * 背景色 17 | * 18 | * 默认为 #ffffff 19 | */ 20 | backgroundColor: string; 21 | /** 22 | * 文字颜色 23 | * 24 | * 默认为 #000000 25 | */ 26 | color: string; 27 | /** 28 | * 分隔符颜色 29 | * 30 | * 默认为 #333 31 | */ 32 | splitorColor: string; 33 | /** 34 | * 天数 35 | * 36 | * 默认为 0 37 | */ 38 | day: number; 39 | /** 40 | * 小时数 41 | * 42 | * 默认为 0 43 | */ 44 | hour: number; 45 | /** 46 | * 分钟数 47 | * 48 | * 默认为 0 49 | */ 50 | minute: number; 51 | /** 52 | * 秒数 53 | * 54 | * 默认为 0 55 | */ 56 | second: number; 57 | /** 58 | * 目标时间戳 59 | * 60 | * 默认为 0 61 | */ 62 | timestamp: number; 63 | /** 64 | * 是否显示天数 65 | * 66 | * 默认为 true 67 | */ 68 | showDay: boolean; 69 | /** 70 | * 是否以冒号为分隔符 71 | * 72 | * 默认为 true 73 | */ 74 | showColon: boolean; 75 | /** 76 | * 是否初始化组件后就开始倒计时 77 | * 78 | * 默认为 true 79 | */ 80 | start: boolean; 81 | /** 动态更新时间后,刷新组件显示 */ 82 | update: _UniCountdownOnUpdate; 83 | /** 倒计时时间到触发事件 */ 84 | onTimeup: _UniCountdownOnTimeup; 85 | }>; 86 | 87 | /** 倒计时 */ 88 | type _UniCountdown = Component<_UniCountdownProps>; 89 | 90 | /** 倒计时实例 */ 91 | type _UniCountdownInstance = InstanceType<_UniCountdown>; 92 | 93 | export { 94 | _UniCountdownOnUpdate as UniCountdownOnUpdate, 95 | _UniCountdownOnTimeup as UniCountdownOnTimeup, 96 | _UniCountdownProps as UniCountdownProps, 97 | _UniCountdown as UniCountdown, 98 | _UniCountdownInstance as UniCountdownInstance, 99 | }; 100 | 101 | declare global { 102 | namespace UniHelper { 103 | /** 动态更新时间后,刷新组件显示 */ 104 | export interface UniCountdownOnUpdate extends _UniCountdownOnUpdate {} 105 | /** 倒计时时间到触发事件 */ 106 | export interface UniCountdownOnTimeup extends _UniCountdownOnTimeup {} 107 | /** 倒计时属性 */ 108 | export type UniCountdownProps = _UniCountdownProps; 109 | /** 倒计时 */ 110 | export type UniCountdown = _UniCountdown; 111 | /** 倒计时实例 */ 112 | export type UniCountdownInstance = _UniCountdownInstance; 113 | } 114 | } 115 | 116 | declare module '@vue/runtime-core' { 117 | export interface GlobalComponents { 118 | /** 倒计时 */ 119 | UniCountdown: _UniCountdown; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/uni-data-select.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniDataSelectValue = string | number; 4 | 5 | interface _UniDataSelectLocaldataItem { 6 | /** 值 */ 7 | value: _UniDataSelectValue; 8 | /** 显示文字 */ 9 | text: string; 10 | /** 11 | * 是否禁用 12 | * 13 | * 默认为 false 14 | */ 15 | disable?: boolean; 16 | } 17 | 18 | /** 本地数据 */ 19 | type _UniDataSelectLocaldata = _UniDataSelectLocaldataItem[]; 20 | 21 | /** 改变时触发 */ 22 | interface _UniDataSelectOnChange { 23 | (value: _UniDataSelectValue): void; 24 | } 25 | 26 | type _UniDataSelectProps = Partial<{ 27 | /** 已选择数据的 value 值 */ 28 | value: _UniDataSelectValue; 29 | /** 本地数据 */ 30 | localdata: _UniDataSelectLocaldata; 31 | /** 32 | * 是否可以清空已选项 33 | * 34 | * 默认为 true 35 | */ 36 | clear: boolean; 37 | /** 左侧标题 */ 38 | label: string; 39 | /** 40 | * 输入框的提示文字 41 | * 42 | * 默认为 请选择 43 | */ 44 | placeholder: string; 45 | /** 46 | * 没有数据时显示的文字,本地数据无效 47 | * 48 | * 默认为 无选项 49 | */ 50 | emptyTips: string; 51 | /** 52 | * 没有数据时显示的文字,本地数据无效 53 | * 54 | * 默认为 暂无数据 55 | */ 56 | emptyText: string; 57 | /** 58 | * 是否禁用 59 | * 60 | * 默认为 false 61 | */ 62 | disabled: boolean; 63 | /** 格式化输出 */ 64 | format: string; 65 | /** 改变时触发 */ 66 | onChange: _UniDataSelectOnChange; 67 | }>; 68 | 69 | /** 70 | * 当选项过多时,使用下拉菜单展示并选择内容 71 | * 72 | * 本组件要解决问题包括 73 | * 74 | * 数据绑定型组件:给本组件绑定一个 data,会自动渲染一组候选内容 75 | * 76 | * 自动的表单校验:组件绑定了 data,且符合 uni-forms 的表单校验规范,搭配使用会自动实现表单校验 77 | */ 78 | type _UniDataSelect = Component<_UniDataSelectProps>; 79 | 80 | type _UniDataSelectInstance = InstanceType<_UniDataSelect>; 81 | 82 | export { 83 | _UniDataSelectValue as UniDataSelectValue, 84 | _UniDataSelectLocaldataItem as UniDataSelectLocaldataItem, 85 | _UniDataSelectLocaldata as UniDataSelectLocaldata, 86 | _UniDataSelectOnChange as UniDataSelectOnChange, 87 | _UniDataSelectProps as UniDataSelectProps, 88 | _UniDataSelect as UniDataSelect, 89 | _UniDataSelectInstance as UniDataSelectInstance, 90 | }; 91 | 92 | declare global { 93 | namespace UniHelper { 94 | export type UniDataSelectValue = _UniDataSelectValue; 95 | export interface UniDataSelectLocaldataItem 96 | extends _UniDataSelectLocaldataItem {} 97 | /** 本地数据 */ 98 | export type UniDataSelectLocaldata = _UniDataSelectLocaldata; 99 | /** 改变时触发 */ 100 | export interface UniDataSelectOnChange extends _UniDataSelectOnChange {} 101 | export type UniDataSelectProps = _UniDataSelectProps; 102 | export type UniDataSelect = _UniDataSelect; 103 | export type UniDataSelectInstance = _UniDataSelectInstance; 104 | } 105 | } 106 | 107 | declare module '@vue/runtime-core' { 108 | export interface GlobalComponents { 109 | UniDataSelect: _UniDataSelect; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/uni-dateformat.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 格式化使用的语言 5 | * 6 | * zh 中文 7 | * 8 | * en 英文 9 | */ 10 | type _UniDateformatLocale = 'zh' | 'en'; 11 | 12 | /** 要格式化的日期对象/日期字符串/时间戳 */ 13 | type _UniDateformatData = Date | string | number; 14 | 15 | /** 日期格式化组件属性 */ 16 | type _UniDateformatProps = Partial<{ 17 | /** 18 | * 要格式化的日期对象/日期字符串/时间戳 19 | * 20 | * 默认为 - 21 | */ 22 | date: _UniDateformatData; 23 | /** 24 | * 转化类型阈值 25 | * 26 | * 默认为 [0, 0] 27 | */ 28 | threshold: [number, number]; 29 | /** 30 | * 格式字符串 31 | * 32 | * yyyy 四位年份 33 | * 34 | * yy 两位年份 35 | * 36 | * MM 两位月份,不足则在前面补 0 37 | * 38 | * M 月份,不自动补 0 39 | * 40 | * dd 两位天,不足则在前面补 0 41 | * 42 | * d 天,不自动补 0 43 | * 44 | * hh 两位小时,不足则在前面补 0 45 | * 46 | * h 小时,不自动补 0 47 | * 48 | * mm 两位分钟,不足则在前面补 0 49 | * 50 | * m 分钟,不自动补 0 51 | * 52 | * ss 两位秒,不足则在前面补 0 53 | * 54 | * s 秒,不自动补 0 55 | * 56 | * SSS 三位毫秒,不足则在前面补 0 57 | * 58 | * S 毫秒,不自动补 0 59 | * 60 | * 默认为 yyyy/MM/dd hh:mm:ss 61 | */ 62 | format: string; 63 | /** 64 | * 格式化使用的语言 65 | * 66 | * zh 中文 67 | * 68 | * en 英文 69 | * 70 | * 默认为 zh 71 | */ 72 | locale: _UniDateformatLocale; 73 | /** 74 | * 刷新频率 75 | * 76 | * 单位为 ms 77 | * 78 | * 默认为 0,表示不刷新 79 | */ 80 | refreshRate: number | string; 81 | }>; 82 | 83 | /** 日期格式化组件 */ 84 | type _UniDateformat = Component<_UniDateformatProps>; 85 | 86 | /** 日期格式化组件实例 */ 87 | type _UniDateformatInstance = InstanceType<_UniDateformat>; 88 | 89 | export { 90 | _UniDateformatLocale as UniDateformatLocale, 91 | _UniDateformatData as UniDateformatData, 92 | _UniDateformatProps as UniDateformatProps, 93 | _UniDateformat as UniDateformat, 94 | _UniDateformatInstance as UniDateformatInstance, 95 | }; 96 | 97 | declare global { 98 | namespace UniHelper { 99 | /** 格式化使用的语言 */ 100 | export type UniDateformatLocale = _UniDateformatLocale; 101 | /** 要格式化的日期对象/日期字符串/时间戳 */ 102 | export type UniDateformatData = _UniDateformatData; 103 | /** 日期格式化组件属性 */ 104 | export type UniDateformatProps = _UniDateformatProps; 105 | /** 日期格式化组件 */ 106 | export type UniDateformat = _UniDateformat; 107 | /** 日期格式化组件实例 */ 108 | export type UniDateformatInstance = _UniDateformatInstance; 109 | } 110 | } 111 | 112 | declare module '@vue/runtime-core' { 113 | export interface GlobalComponents { 114 | /** 日期格式化组件 */ 115 | UniDateformat: _UniDateformat; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/uni-drawer.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 抽屉滑出位置 5 | * 6 | * left 从左侧滑出 7 | * 8 | * right 从右侧滑出 9 | */ 10 | type _UniDrawerMode = 'left' | 'right'; 11 | 12 | /** 打开抽屉 */ 13 | interface _UniDrawerOpen { 14 | (): void; 15 | } 16 | 17 | /** 关闭抽屉 */ 18 | interface _UniDrawerClose { 19 | (): void; 20 | } 21 | 22 | /** 抽屉状态发生变化时触发 */ 23 | interface _UniDrawerOnChange { 24 | (isDrawerOpen: boolean): void; 25 | } 26 | 27 | /** 抽屉侧滑菜单属性 */ 28 | type _UniDrawerProps = Partial<{ 29 | /** 30 | * 是否显示遮罩 31 | * 32 | * 默认为 true 33 | */ 34 | mask: boolean; 35 | /** 36 | * 点击遮罩是否可以关闭抽屉 37 | * 38 | * 默认为 true 39 | */ 40 | maskClick: boolean; 41 | /** 42 | * 抽屉滑出位置 43 | * 44 | * left 从左侧滑出 45 | * 46 | * right 从右侧滑出 47 | * 48 | * 默认为 left 49 | */ 50 | mode: _UniDrawerMode; 51 | /** 52 | * 宽度 53 | * 54 | * 单位为 px 55 | * 56 | * 默认为 220 57 | */ 58 | width: number; 59 | /** 打开抽屉 */ 60 | open: _UniDrawerOpen; 61 | /** 关闭抽屉 */ 62 | close: _UniDrawerClose; 63 | /** 抽屉状态发生变化时触发 */ 64 | onChange: _UniDrawerOnChange; 65 | }>; 66 | 67 | /** 抽屉侧滑菜单 */ 68 | type _UniDrawer = Component<_UniDrawerProps>; 69 | 70 | /** 抽屉侧滑菜单实例 */ 71 | type _UniDrawerInstance = InstanceType<_UniDrawer>; 72 | 73 | export { 74 | _UniDrawerMode as UniDrawerMode, 75 | _UniDrawerOpen as UniDrawerOpen, 76 | _UniDrawerClose as UniDrawerClose, 77 | _UniDrawerOnChange as UniDrawerOnChange, 78 | _UniDrawerProps as UniDrawerProps, 79 | _UniDrawer as UniDrawer, 80 | _UniDrawerInstance as UniDrawerInstance, 81 | }; 82 | 83 | declare global { 84 | namespace UniHelper { 85 | /** 86 | * 抽屉滑出位置 87 | * 88 | * left 从左侧滑出 89 | * 90 | * right 从右侧滑出 91 | */ 92 | export type UniDrawerMode = _UniDrawerMode; 93 | /** 打开抽屉 */ 94 | export interface UniDrawerOpen extends _UniDrawerOpen {} 95 | /** 关闭抽屉 */ 96 | export interface UniDrawerClose extends _UniDrawerClose {} 97 | /** 抽屉状态发生变化时触发 */ 98 | export interface UniDrawerOnChange extends _UniDrawerOnChange {} 99 | /** 抽屉侧滑菜单属性 */ 100 | export type UniDrawerProps = _UniDrawerProps; 101 | /** 抽屉侧滑菜单 */ 102 | export type UniDrawer = _UniDrawer; 103 | /** 抽屉侧滑菜单实例 */ 104 | export type UniDrawerInstance = _UniDrawerInstance; 105 | } 106 | } 107 | 108 | declare module '@vue/runtime-core' { 109 | export interface GlobalComponents { 110 | /** 抽屉侧滑菜单 */ 111 | UniDrawer: _UniDrawer; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/uni-fav.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 收藏按钮文字 */ 4 | interface _UniFavContentText { 5 | /** 6 | * 未收藏文字 7 | * 8 | * 默认为 收藏 9 | */ 10 | contentDefault: string; 11 | /** 12 | * 已收藏文字 13 | * 14 | * 默认为 已收藏 15 | */ 16 | contentFav: string; 17 | } 18 | 19 | /** 点击触发 */ 20 | interface _UniFavOnClick { 21 | (): void; 22 | } 23 | 24 | type _UniFavProps = Partial<{ 25 | /** 26 | * 按钮是否带星 27 | * 28 | * 默认为 true 29 | */ 30 | star: boolean; 31 | /** 32 | * 未收藏时背景色 33 | * 34 | * 默认为 #eeeeee 35 | */ 36 | bgColor: string; 37 | /** 38 | * 已收藏时背景色 39 | * 40 | * 默认为 #007aff 41 | */ 42 | bgColorChecked: string; 43 | /** 44 | * 未收藏时文字颜色 45 | * 46 | * 默认为 #666666 47 | */ 48 | fgColor: string; 49 | /** 50 | * 已收藏时文字颜色 51 | * 52 | * 默认为 #ffffff 53 | */ 54 | fgColorChecked: string; 55 | /** 56 | * 是否为圆角 57 | * 58 | * 默认为 false 59 | */ 60 | circle: boolean; 61 | /** 62 | * 是否为已收藏 63 | * 64 | * 默认为 false 65 | */ 66 | checked: boolean; 67 | /** 收藏按钮文字 */ 68 | contentText: _UniFavContentText; 69 | /** 点击触发 */ 70 | onClick: _UniFavOnClick; 71 | }>; 72 | 73 | /** 用于收藏功能,可点击切换选中、不选中的状态 */ 74 | type _UniFav = Component<_UniFavProps>; 75 | 76 | type _UniFavInstance = InstanceType<_UniFav>; 77 | 78 | export { 79 | _UniFavContentText as UniFavContentText, 80 | _UniFavOnClick as UniFavOnClick, 81 | _UniFavProps as UniFavProps, 82 | _UniFav as UniFav, 83 | _UniFavInstance as UniFavInstance, 84 | }; 85 | 86 | declare global { 87 | namespace UniHelper { 88 | /** 收藏按钮文字 */ 89 | export interface UniFavContentText extends _UniFavContentText {} 90 | /** 点击触发 */ 91 | export interface UniFavOnClick extends _UniFavOnClick {} 92 | export type UniFavProps = _UniFavProps; 93 | /** 用于收藏功能,可点击切换选中、不选中的状态 */ 94 | export type UniFav = _UniFav; 95 | export type UniFavInstance = _UniFavInstance; 96 | } 97 | } 98 | 99 | declare module '@vue/runtime-core' { 100 | export interface GlobalComponents { 101 | /** 用于收藏功能,可点击切换选中、不选中的状态 */ 102 | UniFav: _UniFav; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/uni-forms-item.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | import type { UniFormsRulesRule } from './uni-forms'; 3 | 4 | /** 校验规则 */ 5 | interface _UniFormsItemRulesRule extends UniFormsRulesRule {} 6 | 7 | /** 校验规则 */ 8 | type _UniFormsItemRules = Array<_UniFormsItemRulesRule>; 9 | 10 | /** label 对齐方式 */ 11 | type _UniFormsItemLabelAlign = 'left' | 'center' | 'right'; 12 | 13 | /** 动态设置表单规则 */ 14 | interface _UniFormsItemSetRules { 15 | (rules: _UniFormsItemRules): void; 16 | } 17 | 18 | /** 校验子表单 */ 19 | interface _UniFormsItemOnFieldChange { 20 | (value: any): void; 21 | } 22 | 23 | type _UniFormsItemProps = Partial<{ 24 | /** 表单域的属性名,在使用校验规则时必填 */ 25 | name: string | string[]; 26 | /** 表单校验规则 */ 27 | rules: _UniFormsItemRules; 28 | /** 29 | * label 右边显示红色 * 号,样式显示不会对校验规则产生效果 30 | * 31 | * 默认为 false 32 | */ 33 | required: boolean; 34 | /** 输入框左边的文字提示 */ 35 | label: string; 36 | /** 37 | * label 的宽度 38 | * 39 | * 单位为 px 40 | * 41 | * 默认为 65 42 | */ 43 | labelWidth: number; 44 | /** 45 | * 显示的错误提示内容 46 | * 47 | * 如果为空字符串或 false,则不显示错误信息 48 | */ 49 | errorMessage: false | string; 50 | /** 51 | * label 对齐方式 52 | * 53 | * 默认为 left 54 | */ 55 | labelAlign: _UniFormsItemLabelAlign; 56 | /** 动态设置表单规则 */ 57 | setRules: _UniFormsItemSetRules; 58 | /** 校验子表单 */ 59 | onFieldChange: _UniFormsItemOnFieldChange; 60 | }>; 61 | 62 | type _UniFormsItem = Component<_UniFormsItemProps>; 63 | 64 | type _UniFormsItemInstance = InstanceType<_UniFormsItem>; 65 | 66 | export { 67 | _UniFormsItemRulesRule as UniFormsItemRulesRule, 68 | _UniFormsItemRules as UniFormsItemRules, 69 | _UniFormsItemLabelAlign as UniFormsItemLabelAlign, 70 | _UniFormsItemSetRules as UniFormsItemSetRules, 71 | _UniFormsItemOnFieldChange as UniFormsItemOnFieldChange, 72 | _UniFormsItemProps as UniFormsItemProps, 73 | _UniFormsItem as UniFormsItem, 74 | _UniFormsItemInstance as UniFormsItemInstance, 75 | }; 76 | 77 | declare global { 78 | namespace UniHelper { 79 | /** 校验规则 */ 80 | export interface UniFormsItemRulesRule extends _UniFormsItemRulesRule {} 81 | /** 校验规则 */ 82 | export type UniFormsItemRules = _UniFormsItemRules; 83 | /** label 对齐方式 */ 84 | export type UniFormsItemLabelAlign = _UniFormsItemLabelAlign; 85 | /** 动态设置表单规则 */ 86 | export interface UniFormsItemSetRules extends _UniFormsItemSetRules {} 87 | /** 校验子表单 */ 88 | export interface UniFormsItemOnFieldChange 89 | extends _UniFormsItemOnFieldChange {} 90 | export type UniFormsItemProps = _UniFormsItemProps; 91 | export type UniFormsItem = _UniFormsItem; 92 | export type UniFormsItemInstance = _UniFormsItemInstance; 93 | } 94 | } 95 | 96 | declare module '@vue/runtime-core' { 97 | export interface GlobalComponents { 98 | UniFormsItem: _UniFormsItem; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/uni-goods-nav.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | import type { UniIconsType } from './uni-icons'; 3 | 4 | /** 选项 */ 5 | interface _UniGoodsNavOption { 6 | /** 文字 */ 7 | text: string; 8 | /** 图标 */ 9 | icon: UniIconsType; 10 | /** 右上角数字角标 */ 11 | info?: number; 12 | /** 13 | * 角标背景色 14 | * 15 | * 默认为 #ff0000 16 | */ 17 | infoBackgroundColor?: string; 18 | /** 19 | * 角标前景色 20 | * 21 | * 默认为 #fff 22 | */ 23 | infoColor?: string; 24 | } 25 | 26 | interface _UniGoodsNavOnClickEvent { 27 | index: number; 28 | content: _UniGoodsNavOption; 29 | } 30 | 31 | /** 左侧点击触发 */ 32 | interface _UniGoodsNavOnClick { 33 | (event: _UniGoodsNavOnClickEvent): void; 34 | } 35 | 36 | /** 按钮 */ 37 | interface _UniGoodsNavButton { 38 | /** 文字 */ 39 | text: string; 40 | /** 按钮背景色 */ 41 | backgroundColor: string; 42 | /** 字体颜色 */ 43 | color: string; 44 | } 45 | 46 | interface _UniGoodsNavOnButtonClickEvent { 47 | index: number; 48 | content: _UniGoodsNavButton; 49 | } 50 | 51 | /** 右侧点击触发 */ 52 | interface _UniGoodsNavOnButtonClick { 53 | (event: _UniGoodsNavOnButtonClickEvent): void; 54 | } 55 | 56 | type _UniGoodsNavProps = Partial<{ 57 | /** 58 | * 选项 59 | * 60 | * 默认为 [{ icon: 'shop', text: '店铺' }, { icon: 'cart', text: '购物车' }] 61 | */ 62 | options: _UniGoodsNavOption[]; 63 | /** 64 | * 组件按钮组 65 | * 66 | * 默认为 [{ text: '加入购物车', backgroundColor: 'linear-gradient(90deg, #ffcd1e, 67 | * #ff8a18)', color: '#fff' }, { text: '立即购买', backgroundColor: 68 | * 'linear-gradient(90deg, #fe6035, #ef1224)', color: '#fff' }] 69 | */ 70 | buttonGroup: _UniGoodsNavButton[]; 71 | /** 72 | * 按钮是否平铺 73 | * 74 | * 默认为 false 75 | */ 76 | fill: boolean; 77 | /** 左侧点击触发 */ 78 | onClick: _UniGoodsNavOnClick; 79 | /** 右侧点击触发 */ 80 | onButtonClick: _UniGoodsNavOnButtonClick; 81 | }>; 82 | 83 | /** 商品加入购物车,立即购买 */ 84 | type _UniGoodsNav = Component<_UniGoodsNavProps>; 85 | 86 | type _UniGoodsNavInstance = InstanceType<_UniGoodsNav>; 87 | 88 | export { 89 | _UniGoodsNavOption as UniGoodsNavOption, 90 | _UniGoodsNavOnClickEvent as UniGoodsNavOnClickEvent, 91 | _UniGoodsNavOnClick as UniGoodsNavOnClick, 92 | _UniGoodsNavOnButtonClickEvent as UniGoodsNavOnButtonClickEvent, 93 | _UniGoodsNavOnButtonClick as UniGoodsNavOnButtonClick, 94 | _UniGoodsNavButton as UniGoodsNavButton, 95 | _UniGoodsNavProps as UniGoodsNavProps, 96 | _UniGoodsNav as UniGoodsNav, 97 | _UniGoodsNavInstance as UniGoodsNavInstance, 98 | }; 99 | 100 | declare global { 101 | namespace UniHelper { 102 | /** 选项 */ 103 | export interface UniGoodsNavOption extends _UniGoodsNavOption {} 104 | export type UniGoodsNavOnClickEvent = _UniGoodsNavOnClickEvent; 105 | /** 左侧点击触发 */ 106 | export interface UniGoodsNavOnClick extends _UniGoodsNavOnClick {} 107 | /** 按钮 */ 108 | export interface UniGoodsNavButton extends _UniGoodsNavButton {} 109 | export type UniGoodsNavOnButtonClickEvent = _UniGoodsNavOnButtonClickEvent; 110 | /** 右侧点击触发 */ 111 | export interface UniGoodsNavOnButtonClick 112 | extends _UniGoodsNavOnButtonClick {} 113 | 114 | export type UniGoodsNavProps = _UniGoodsNavProps; 115 | /** 商品加入购物车,立即购买 */ 116 | export type UniGoodsNav = _UniGoodsNav; 117 | export type UniGoodsNavInstance = _UniGoodsNavInstance; 118 | } 119 | } 120 | 121 | declare module '@vue/runtime-core' { 122 | export interface GlobalComponents { 123 | /** 商品加入购物车,立即购买 */ 124 | UniGoodsNav: _UniGoodsNav; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /src/uni-grid-item.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 宫格项属性 */ 4 | type _UniGridItemProps = Partial<{ 5 | /** 子组件唯一标识 */ 6 | index: number; 7 | }>; 8 | 9 | /** 宫格项 */ 10 | type _UniGridItem = Component<_UniGridItemProps>; 11 | 12 | /** 宫格项实例 */ 13 | type _UniGridItemInstance = InstanceType<_UniGridItem>; 14 | 15 | export { 16 | _UniGridItemProps as UniGridItemProps, 17 | _UniGridItem as UniGridItem, 18 | _UniGridItemInstance as UniGridItemInstance, 19 | }; 20 | 21 | declare global { 22 | namespace UniHelper { 23 | /** 宫格项属性 */ 24 | export type UniGridItemProps = _UniGridItemProps; 25 | /** 宫格项 */ 26 | export type UniGridItem = _UniGridItem; 27 | /** 宫格项实例 */ 28 | export type UniGridItemInstance = _UniGridItemInstance; 29 | } 30 | } 31 | 32 | declare module '@vue/runtime-core' { 33 | export interface GlobalComponents { 34 | /** 宫格项 */ 35 | UniGridItem: _UniGridItem; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/uni-grid.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | interface _UniGridOnChangeDetail { 4 | index: number; 5 | } 6 | 7 | interface _UniGridOnChangeEvent { 8 | detail: _UniGridOnChangeDetail; 9 | } 10 | 11 | /** 点击触发 */ 12 | interface _UniGridOnChange { 13 | (event: _UniGridOnChangeEvent): void; 14 | } 15 | 16 | /** 宫格属性 */ 17 | type _UniGridProps = Partial<{ 18 | /** 19 | * 每列显示个数 20 | * 21 | * 默认为 3 22 | */ 23 | column: number; 24 | /** 25 | * 边框颜色 26 | * 27 | * 默认为 #d2d2d2 28 | */ 29 | borderColor: string; 30 | /** 31 | * 是否显示边框 32 | * 33 | * 默认为 true 34 | */ 35 | showBorder: boolean; 36 | /** 37 | * 是否方形显示 38 | * 39 | * 默认为 true 40 | */ 41 | square: boolean; 42 | /** 43 | * 点击背景是否高亮 44 | * 45 | * 默认为 true 46 | */ 47 | highlight: boolean; 48 | /** 点击触发 */ 49 | onChange: _UniGridOnChange; 50 | }>; 51 | 52 | /** 宫格 */ 53 | type _UniGrid = Component<_UniGridProps>; 54 | 55 | /** 宫格属性 */ 56 | type _UniGridInstance = InstanceType<_UniGrid>; 57 | 58 | export { 59 | _UniGridOnChangeDetail as UniGridOnChangeDetail, 60 | _UniGridOnChangeEvent as UniGridOnChangeEvent, 61 | _UniGridOnChange as UniGridOnChange, 62 | _UniGridProps as UniGridProps, 63 | _UniGrid as UniGrid, 64 | _UniGridInstance as UniGridInstance, 65 | }; 66 | 67 | declare global { 68 | namespace UniHelper { 69 | export interface UniGridOnChangeDetail extends _UniGridOnChangeDetail {} 70 | export type UniGridOnChangeEvent = _UniGridOnChangeEvent; 71 | /** 点击触发 */ 72 | export interface UniGridOnChange extends _UniGridOnChange {} 73 | /** 宫格属性 */ 74 | export type UniGridProps = _UniGridProps; 75 | /** 宫格 */ 76 | export type UniGrid = _UniGrid; 77 | /** 宫格实例 */ 78 | export type UniGridInstance = _UniGridInstance; 79 | } 80 | } 81 | 82 | declare module '@vue/runtime-core' { 83 | export interface GlobalComponents { 84 | /** 宫格 */ 85 | UniGrid: _UniGrid; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/uni-group.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 模式 5 | * 6 | * default 默认 7 | * 8 | * card 卡片 9 | */ 10 | type _UniGroupMode = 'default' | 'card'; 11 | 12 | /** 点击时触发 */ 13 | interface _UniGroupOnClick { 14 | (): void; 15 | } 16 | 17 | /** 分组属性 */ 18 | type _UniGroupProps = Partial<{ 19 | /** 主标题 */ 20 | title: string; 21 | /** 22 | * 分组间隔 23 | * 24 | * 单位为 px 25 | * 26 | * 默认为 10 27 | */ 28 | top: number | string; 29 | /** 30 | * 模式 31 | * 32 | * default 默认 33 | * 34 | * card 卡片 35 | * 36 | * 默认为 default 37 | */ 38 | mode: _UniGroupMode; 39 | /** 40 | * 是否开启统计 41 | * 42 | * 默认为 false 43 | */ 44 | stat: boolean; 45 | /** 点击时触发 */ 46 | onClick: _UniGroupOnClick; 47 | }>; 48 | 49 | /** 分组组件可用于将组件分组,添加间隔,以产生明显的区块 */ 50 | type _UniGroup = Component<_UniGroupProps>; 51 | 52 | /** 分组组件实例 */ 53 | type _UniGroupInstance = InstanceType<_UniGroup>; 54 | 55 | export { 56 | _UniGroupMode as UniGroupMode, 57 | _UniGroupOnClick as UniGroupOnClick, 58 | _UniGroupProps as UniGroupProps, 59 | _UniGroup as UniGroup, 60 | _UniGroupInstance as UniGroupInstance, 61 | }; 62 | 63 | declare global { 64 | namespace UniHelper { 65 | /** 66 | * 模式 67 | * 68 | * default 默认 69 | * 70 | * card 卡片 71 | */ 72 | export type UniGroupMode = _UniGroupMode; 73 | export interface UniGroupOnClick extends _UniGroupOnClick {} 74 | /** 分组属性 */ 75 | export type UniGroupProps = _UniGroupProps; 76 | /** 分组组件可用于将组件分组,添加间隔,以产生明显的区块 */ 77 | export type UniGroup = _UniGroup; 78 | /** 分组组件实例 */ 79 | export type UniGroupInstance = _UniGroupInstance; 80 | } 81 | } 82 | 83 | declare module '@vue/runtime-core' { 84 | export interface GlobalComponents { 85 | /** 分组组件可用于将组件分组,添加间隔,以产生明显的区块 */ 86 | UniGroup: _UniGroup; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/uni-indexed-list.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 数据对象 */ 4 | interface _UniIndexedListOption { 5 | /** 索引标题 */ 6 | letter: string; 7 | /** 索引 */ 8 | data: string[]; 9 | } 10 | /** 数据对象 */ 11 | interface _UniIndexedItemSelected { 12 | /** 索引标题 */ 13 | key: string; 14 | /** 索引 */ 15 | name: string; 16 | /** 索引序号 */ 17 | itemIndex: number; 18 | /** 索引是否选中 */ 19 | checked: boolean; 20 | } 21 | 22 | interface _UniIndexedListOnClickEvent { 23 | item: _UniIndexedItemSelected; 24 | select: _UniIndexedItemSelected[]; 25 | } 26 | 27 | /** 点击触发 */ 28 | interface _UniIndexedListOnClick { 29 | (event: _UniIndexedListOnClickEvent): void; 30 | } 31 | 32 | /** 索引列表属性 */ 33 | type _UniIndexedListProps = Partial<{ 34 | /** 索引列表需要的数据对象 */ 35 | options: _UniIndexedListOption[]; 36 | /** 37 | * 展示模式 38 | * 39 | * true 展示默认 40 | * 41 | * false 展示选择 42 | * 43 | * 默认为 false 44 | */ 45 | showSelect: boolean; 46 | /** 点击触发 */ 47 | onClick: _UniIndexedListOnClick; 48 | }>; 49 | 50 | /** 索引列表 */ 51 | type _UniIndexedList = Component<_UniIndexedListProps>; 52 | 53 | /** 索引列表实例 */ 54 | type _UniIndexedListInstance = InstanceType<_UniIndexedList>; 55 | 56 | export { 57 | _UniIndexedListOption as UniIndexedListOption, 58 | _UniIndexedItemSelected as UniIndexedItemSelected, 59 | _UniIndexedListOnClickEvent as UniIndexedListOnClickEvent, 60 | _UniIndexedListOnClick as UniIndexedListOnClick, 61 | _UniIndexedListProps as UniIndexedListProps, 62 | _UniIndexedList as UniIndexedList, 63 | _UniIndexedListInstance as UniIndexedListInstance, 64 | }; 65 | 66 | declare global { 67 | namespace UniHelper { 68 | /** 数据对象 */ 69 | export interface UniIndexedListOption extends _UniIndexedListOption {} 70 | export interface UniIndexedItemSelected extends _UniIndexedItemSelected {} 71 | export type UniIndexedListOnClickEvent = _UniIndexedListOnClickEvent; 72 | /** 点击触发 */ 73 | export interface UniIndexedListOnClick extends _UniIndexedListOnClick {} 74 | /** 索引列表属性 */ 75 | export type UniIndexedListProps = _UniIndexedListProps; 76 | /** 索引列表 */ 77 | export type UniIndexedList = _UniIndexedList; 78 | /** 索引列表实例 */ 79 | export type UniIndexedListInstance = _UniIndexedListInstance; 80 | } 81 | } 82 | 83 | declare module '@vue/runtime-core' { 84 | export interface GlobalComponents { 85 | /** 索引列表 */ 86 | UniIndexedList: _UniIndexedList; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/uni-link.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 外部网页超链接组件属性 */ 4 | type _UniLinkProps = Partial<{ 5 | /** 链接地址 */ 6 | href: string; 7 | /** 显示文字 */ 8 | text: string; 9 | /** H5 下载文件名 */ 10 | download: string; 11 | /** 12 | * 是否显示下划线 13 | * 14 | * 默认为 true 15 | */ 16 | showUnderLine: boolean; 17 | /** 18 | * 小程序端复制链接时的提示语 19 | * 20 | * 默认为 已自动复制网址,请在手机浏览器里粘贴该网址 21 | */ 22 | copyTips: string; 23 | /** 24 | * 链接文字颜色 25 | * 26 | * 默认为 #999999 27 | */ 28 | color: string; 29 | /** 30 | * 链接文字大小 31 | * 32 | * 单位为 px 33 | * 34 | * 默认为 14 35 | */ 36 | fontSize: number | string; 37 | }>; 38 | 39 | /** 40 | * 外部网页超链接组件 41 | * 42 | * 在小程序内复制 URL 43 | * 44 | * 在 APP 内打开外部浏览器 45 | * 46 | * 在 H5 端打开新网页 47 | */ 48 | type _UniLink = Component<_UniLinkProps>; 49 | 50 | /** 外部网页超链接组件实例 */ 51 | type _UniLinkInstance = InstanceType<_UniLink>; 52 | 53 | export { 54 | _UniLinkProps as UniLinkProps, 55 | _UniLink as UniLink, 56 | _UniLinkInstance as UniLinkInstance, 57 | }; 58 | 59 | declare global { 60 | namespace UniHelper { 61 | /** 外部网页超链接组件属性 */ 62 | export type UniLinkProps = _UniLinkProps; 63 | /** 64 | * 外部网页超链接组件 65 | * 66 | * 在小程序内复制 URL 67 | * 68 | * 在 APP 内打开外部浏览器 69 | * 70 | * 在 H5 端打开新网页 71 | */ 72 | export type UniLink = _UniLink; 73 | /** 外部网页超链接组件 */ 74 | export type UniLinkInstance = _UniLinkInstance; 75 | } 76 | } 77 | 78 | declare module '@vue/runtime-core' { 79 | export interface GlobalComponents { 80 | /** 81 | * 外部网页超链接组件 82 | * 83 | * 在小程序内复制 URL 84 | * 85 | * 在 APP 内打开外部浏览器 86 | * 87 | * 在 H5 端打开新网页 88 | */ 89 | UniLink: _UniLink; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/uni-list-ad.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniListAdProps = Partial<{ 4 | /** 标题 */ 5 | title: string; 6 | }>; 7 | 8 | type _UniListAd = Component<_UniListAdProps>; 9 | 10 | type _UniListAdInstance = InstanceType<_UniListAd>; 11 | 12 | export { 13 | _UniListAdProps as UniListAdProps, 14 | _UniListAd as UniListAd, 15 | _UniListAdInstance as UniListAdInstance, 16 | }; 17 | 18 | declare global { 19 | namespace UniHelper { 20 | export type UniListAdProps = _UniListAdProps; 21 | export type UniListAd = _UniListAd; 22 | export type UniListAdInstance = _UniListAdInstance; 23 | } 24 | } 25 | 26 | declare module '@vue/runtime-core' { 27 | export interface GlobalComponents { 28 | UniListAd: _UniListAd; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/uni-list-chat.ts: -------------------------------------------------------------------------------- 1 | import type { AnyRecord, Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniListChatLink = 'navigateTo' | 'redirectTo' | 'reLaunch' | 'switchTab'; 4 | 5 | /** 角标位置 */ 6 | type _UniListChatBadgePositon = 'left' | 'right'; 7 | 8 | interface _UniListChatOnClickEvent { 9 | data: AnyRecord; 10 | } 11 | 12 | /** 点击时触发 */ 13 | interface _UniListChatOnClick { 14 | (event: _UniListChatOnClickEvent): void; 15 | } 16 | 17 | /** 聊天列表属性 */ 18 | type _UniListChatProps = Partial<{ 19 | /** 标题 */ 20 | title: string; 21 | /** 描述 */ 22 | note: string; 23 | /** 24 | * 是否开启点击反馈 25 | * 26 | * 默认为 false 27 | */ 28 | clickable: boolean; 29 | /** 30 | * 是否展示右侧箭头并开启点击反馈 31 | * 32 | * 默认为 false,表示不开启 33 | */ 34 | link: false | _UniListChatLink; 35 | /** 36 | * 跳转页面地址 37 | * 38 | * 如果填写此属性,click 会返回页面是否跳转成功 39 | */ 40 | to: string; 41 | /** 数字角标内容,设置为 dot 将显示圆点 */ 42 | badgeText: string; 43 | /** 44 | * 角标位置 45 | * 46 | * 默认为 right 47 | */ 48 | badgePositon: _UniListChatBadgePositon; 49 | /** 右侧显示的时间 */ 50 | time: string; 51 | /** 52 | * 是否显示圆形头像 53 | * 54 | * 默认为 false 55 | */ 56 | avatarCircle: boolean; 57 | /** 头像地址 */ 58 | avatar: string; 59 | /** 头像组 */ 60 | avatarList: Array<{ url: string }>; 61 | /** 点击时触发 */ 62 | onClick: _UniListChatOnClick; 63 | }>; 64 | 65 | /** 聊天列表 */ 66 | type _UniListChat = Component<_UniListChatProps>; 67 | 68 | /** 聊天列表实例 */ 69 | type _UniListChatInstance = InstanceType<_UniListChat>; 70 | 71 | export { 72 | _UniListChatLink as UniListChatLink, 73 | _UniListChatBadgePositon as UniListChatBadgePositon, 74 | _UniListChatOnClickEvent as UniListChatOnClickEvent, 75 | _UniListChatOnClick as UniListChatOnClick, 76 | _UniListChatProps as UniListChatProps, 77 | _UniListChat as UniListChat, 78 | _UniListChatInstance as UniListChatInstance, 79 | }; 80 | 81 | declare global { 82 | namespace UniHelper { 83 | export type UniListChatLink = _UniListChatLink; 84 | /** 角标位置 */ 85 | export type UniListChatBadgePositon = _UniListChatBadgePositon; 86 | export type UniListChatOnClickEvent = _UniListChatOnClickEvent; 87 | /** 点击时触发 */ 88 | export interface UniListChatOnClick extends _UniListChatOnClick {} 89 | /** 聊天列表属性 */ 90 | export type UniListChatProps = _UniListChatProps; 91 | /** 聊天列表 */ 92 | export type UniListChat = _UniListChat; 93 | /** 聊天列表实例 */ 94 | export type UniListChatInstance = _UniListChatInstance; 95 | } 96 | } 97 | 98 | declare module '@vue/runtime-core' { 99 | export interface GlobalComponents { 100 | /** 聊天列表 */ 101 | UniListChat: _UniListChat; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/uni-list.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 列表属性 */ 4 | type _UniListProps = Partial<{ 5 | /** 6 | * 是否显示边框 7 | * 8 | * 默认为 true 9 | */ 10 | border: boolean; 11 | }>; 12 | 13 | /** 14 | * 列表 15 | * 16 | * 包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容 17 | * 18 | * 在 vue 页面默认使用页面级滚动,在 app-nvue 页面默认使用原生 list 组件滚动 19 | * 20 | * uni-list 是父容器,核心是 uni-list-item 子组件,它代表列表中的一个可重复行,子组件可以无限循环 21 | * 22 | * uni-list-item 有很多风格,uni-list-item 组件通过内置的属性,满足一些常用的场景,也可以通过扩展插槽来自定义列表内容 23 | * 24 | * 内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表 25 | * 26 | * 涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现 27 | */ 28 | type _UniList = Component<_UniListProps>; 29 | 30 | /** 列表实例 */ 31 | type _UniListInstance = InstanceType<_UniList>; 32 | 33 | export { 34 | _UniListProps as UniListProps, 35 | _UniList as UniList, 36 | _UniListInstance as UniListInstance, 37 | }; 38 | 39 | declare global { 40 | namespace UniHelper { 41 | /** 列表属性 */ 42 | export type UniListProps = _UniListProps; 43 | /** 44 | * 列表 45 | * 46 | * 包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容 47 | * 48 | * 在 vue 页面默认使用页面级滚动,在 app-nvue 页面默认使用原生 list 组件滚动 49 | * 50 | * uni-list 是父容器,核心是 uni-list-item 子组件,它代表列表中的一个可重复行,子组件可以无限循环 51 | * 52 | * uni-list-item 有很多风格,uni-list-item 组件通过内置的属性,满足一些常用的场景,也可以通过扩展插槽来自定义列表内容 53 | * 54 | * 内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表 55 | * 56 | * 涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现 57 | */ 58 | export type UniList = _UniList; 59 | /** 列表实例 */ 60 | export type UniListInstance = _UniListInstance; 61 | } 62 | } 63 | 64 | declare module '@vue/runtime-core' { 65 | export interface GlobalComponents { 66 | /** 67 | * 列表 68 | * 69 | * 包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容 70 | * 71 | * 在 vue 页面默认使用页面级滚动,在 app-nvue 页面默认使用原生 list 组件滚动 72 | * 73 | * uni-list 是父容器,核心是 uni-list-item 子组件,它代表列表中的一个可重复行,子组件可以无限循环 74 | * 75 | * uni-list-item 有很多风格,uni-list-item 组件通过内置的属性,满足一些常用的场景,也可以通过扩展插槽来自定义列表内容 76 | * 77 | * 内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表 78 | * 79 | * 涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现 80 | */ 81 | UniList: _UniList; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/uni-load-more.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * loading 的状态 5 | * 6 | * more 加载前 7 | * 8 | * loading 加载中 9 | * 10 | * noMore 没有更多数据 11 | */ 12 | type _UniLoadMoreStatus = 'more' | 'loading' | 'noMore'; 13 | 14 | /** 15 | * 图标样式 16 | * 17 | * snow iOS 雪花加载样式 18 | * 19 | * circle Android 环形加载样式 20 | * 21 | * auto 根据平台自动选择加载样式 22 | */ 23 | type _UniLoadMoreIconType = 'auto' | 'snow' | 'circle'; 24 | 25 | /** 各状态文字说明 */ 26 | interface _UniLoadMoreContentText { 27 | /** 默认为 上拉显示更多 */ 28 | contentdown: string; 29 | /** 默认为 正在加载 */ 30 | contentrefresh: string; 31 | /** 默认为 没有更多数据了 */ 32 | contentnomore: string; 33 | } 34 | 35 | interface _UniLoadMoreOnClickLoadMoreDetail { 36 | /** 37 | * loading 的状态 38 | * 39 | * more 加载前 40 | * 41 | * loading 加载中 42 | * 43 | * noMore 没有更多数据 44 | */ 45 | status: _UniLoadMoreStatus; 46 | } 47 | 48 | interface _UniLoadMoreOnClickLoadMoreEvent { 49 | detail: _UniLoadMoreOnClickLoadMoreDetail; 50 | } 51 | 52 | /** 点击加载更多时触发 */ 53 | interface _UniLoadMoreOnClickLoadMore { 54 | (event: _UniLoadMoreOnClickLoadMoreEvent): void; 55 | } 56 | 57 | type _UniLoadMoreProps = Partial<{ 58 | /** 59 | * 图标大小 60 | * 61 | * 单位为 px 62 | * 63 | * 默认为 24 64 | */ 65 | iconSize: number; 66 | /** 67 | * loading 的状态 68 | * 69 | * more 加载前 70 | * 71 | * loading 加载中 72 | * 73 | * noMore 没有更多数据 74 | * 75 | * 默认为 more 76 | */ 77 | status: _UniLoadMoreStatus; 78 | /** 79 | * 是否显示 loading 图标 80 | * 81 | * 默认为 true 82 | */ 83 | showIcon: boolean; 84 | /** 85 | * 是否显示文本 86 | * 87 | * 默认为 true 88 | */ 89 | showText: boolean; 90 | /** 91 | * 图标样式 92 | * 93 | * snow iOS 雪花加载样式 94 | * 95 | * circle Android 环形加载样式 96 | * 97 | * auto 根据平台自动选择加载样式 98 | * 99 | * 默认为 auto 100 | */ 101 | iconType: _UniLoadMoreIconType; 102 | /** 103 | * 图标和文字颜色 104 | * 105 | * 默认为 #777777 106 | */ 107 | color: string; 108 | /** 各状态文字说明 */ 109 | contentText: _UniLoadMoreContentText; 110 | /** 点击加载更多时触发 */ 111 | onClickLoadMore: _UniLoadMoreOnClickLoadMore; 112 | }>; 113 | 114 | /** 用于列表中,做滚动加载使用,展示 loading 的各种状态 */ 115 | type _UniLoadMore = Component<_UniLoadMoreProps>; 116 | 117 | type _UniLoadMoreInstance = InstanceType<_UniLoadMore>; 118 | 119 | export { 120 | _UniLoadMoreStatus as UniLoadMoreStatus, 121 | _UniLoadMoreIconType as UniLoadMoreIconType, 122 | _UniLoadMoreContentText as UniLoadMoreContentText, 123 | _UniLoadMoreOnClickLoadMoreDetail as UniLoadMoreOnClickLoadMoreDetail, 124 | _UniLoadMoreOnClickLoadMoreEvent as UniLoadMoreOnClickLoadMoreEvent, 125 | _UniLoadMoreOnClickLoadMore as UniLoadMoreOnClickLoadMore, 126 | _UniLoadMoreProps as UniLoadMoreProps, 127 | _UniLoadMore as UniLoadMore, 128 | _UniLoadMoreInstance as UniLoadMoreInstance, 129 | }; 130 | 131 | declare global { 132 | namespace UniHelper { 133 | /** 134 | * loading 的状态 135 | * 136 | * more 加载前 137 | * 138 | * loading 加载中 139 | * 140 | * noMore 没有更多数据 141 | */ 142 | export type UniLoadMoreStatus = _UniLoadMoreStatus; 143 | /** 144 | * 图标样式 145 | * 146 | * snow iOS 雪花加载样式 147 | * 148 | * circle Android 环形加载样式 149 | * 150 | * auto 根据平台自动选择加载样式 151 | */ 152 | export type UniLoadMoreIconType = _UniLoadMoreIconType; 153 | /** 各状态文字说明 */ 154 | export interface UniLoadMoreContentText extends _UniLoadMoreContentText {} 155 | export interface UniLoadMoreOnClickLoadMoreDetail 156 | extends _UniLoadMoreOnClickLoadMoreDetail {} 157 | export type UniLoadMoreOnClickLoadMoreEvent = 158 | _UniLoadMoreOnClickLoadMoreEvent; 159 | /** 点击加载更多时触发 */ 160 | export interface UniLoadMoreOnClickLoadMore 161 | extends _UniLoadMoreOnClickLoadMore {} 162 | export type UniLoadMoreProps = _UniLoadMoreProps; 163 | /** 用于列表中,做滚动加载使用,展示 loading 的各种状态 */ 164 | export type UniLoadMore = _UniLoadMore; 165 | export type UniLoadMoreInstance = _UniLoadMoreInstance; 166 | } 167 | } 168 | 169 | declare module '@vue/runtime-core' { 170 | export interface GlobalComponents { 171 | /** 用于列表中,做滚动加载使用,展示 loading 的各种状态 */ 172 | UniLoadMore: _UniLoadMore; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /src/uni-nav-bar.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | import type { UniIconsType } from './uni-icons'; 3 | 4 | /** 导航栏属性 */ 5 | type _UniNavBarProps = Partial<{ 6 | /** 标题文字 */ 7 | title: string; 8 | /** 左侧按钮文本 */ 9 | leftText: string; 10 | /** 右侧按钮文本 */ 11 | rightText: string; 12 | /** 左侧按钮图标 */ 13 | leftIcon: UniIconsType; 14 | /** 右侧按钮图标 */ 15 | rightIcon: UniIconsType; 16 | /** 17 | * 图标和文字颜色 18 | * 19 | * 默认为 #000000 20 | */ 21 | color: string; 22 | /** 23 | * 导航栏背景颜色 24 | * 25 | * 默认为 #ffffff 26 | */ 27 | backgroundColor: string; 28 | /** 29 | * 是否固定顶部 30 | * 31 | * 默认为 false 32 | */ 33 | fixed: boolean; 34 | /** 35 | * 是否包含状态栏 36 | * 37 | * 默认为 false 38 | */ 39 | statusBar: boolean; 40 | /** 41 | * 导航栏下是否有阴影 42 | * 43 | * 默认为 false 44 | */ 45 | shadow: boolean; 46 | /** 47 | * 导航栏下是否有边框 48 | * 49 | * 默认为 true 50 | */ 51 | border: boolean; 52 | /** 53 | * 导航栏高度 54 | * 55 | * 如果传入 number 默认使用 px 56 | * 57 | * 默认为 44 58 | */ 59 | height: number | string; 60 | /** 61 | * 导航栏是否开启暗黑模式 62 | * 63 | * 默认为 false 64 | */ 65 | dark: boolean; 66 | /** 67 | * 导航栏左侧插槽宽度 68 | * 69 | * 如果传入 number 默认使用 px 70 | * 71 | * 默认为 60 72 | */ 73 | leftWidth: number | string; 74 | /** 75 | * 导航栏右侧插槽宽度 76 | * 77 | * 如果传入 number 默认使用 px 78 | * 79 | * 默认为 60 80 | */ 81 | rightWidth: number | string; 82 | /** 83 | * 是否开启统计标题功能 84 | * 85 | * 默认为 false 86 | */ 87 | stat: boolean; 88 | }>; 89 | 90 | /** 导航栏组件,主要用于头部导航 */ 91 | type _UniNavBar = Component<_UniNavBarProps>; 92 | 93 | /** 导航栏组件实例 */ 94 | type _UniNavBarInstance = InstanceType<_UniNavBar>; 95 | 96 | export { 97 | _UniNavBarProps as UniNavBarProps, 98 | _UniNavBar as UniNavBar, 99 | _UniNavBarInstance as UniNavBarInstance, 100 | }; 101 | 102 | declare global { 103 | namespace UniHelper { 104 | /** 导航栏属性 */ 105 | export type UniNavBarProps = _UniNavBarProps; 106 | /** 导航栏组件,主要用于头部导航 */ 107 | export type UniNavBar = _UniNavBar; 108 | /** 导航栏组件实例 */ 109 | export type UniNavBarInstance = _UniNavBarInstance; 110 | } 111 | } 112 | 113 | declare module '@vue/runtime-core' { 114 | export interface GlobalComponents { 115 | /** 导航栏组件,主要用于头部导航 */ 116 | UniNavBar: _UniNavBar; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/uni-notice-bar.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 点击触发 */ 4 | interface _UniNoticeBarOnClick { 5 | (): void; 6 | } 7 | 8 | /** 关闭触发 */ 9 | interface _UniNoticeBarOnClose { 10 | (): void; 11 | } 12 | 13 | /** 查看更多触发 */ 14 | interface _UniNoticeBarOnGetmore { 15 | (): void; 16 | } 17 | 18 | /** 通告栏属性 */ 19 | type _UniNoticeBarProps = Partial<{ 20 | /** 21 | * 文字滚动的速度 22 | * 23 | * 单位为 px 24 | * 25 | * 默认为 100 26 | */ 27 | speed: number; 28 | /** 显示文字 */ 29 | text: string; 30 | /** 查看更多的文本 */ 31 | moreText: string; 32 | /** 33 | * 背景颜色 34 | * 35 | * 默认为 #fff9ea 36 | */ 37 | backgroundColor: string; 38 | /** 39 | * 文字颜色 40 | * 41 | * 默认为 #ff9a43 42 | */ 43 | color: string; 44 | /** 45 | * 查看更多的文字颜色 46 | * 47 | * 默认为 #ff9a43 48 | */ 49 | moreColor: string; 50 | /** 51 | * 字体大小,也用于计算 line-height 52 | * 53 | * 单位为 px 54 | * 55 | * 默认为 14 56 | */ 57 | fontSize: number; 58 | /** 59 | * 是否单行 60 | * 61 | * 默认为 false 62 | */ 63 | single: boolean; 64 | /** 65 | * 是否滚动 66 | * 67 | * true 滚动,强制单行 68 | * 69 | * false 不滚动 70 | * 71 | * 默认为 false 72 | */ 73 | scrollable: boolean; 74 | /** 75 | * 是否显示左侧喇叭图标 76 | * 77 | * 默认为 false 78 | */ 79 | showIcon: boolean; 80 | /** 81 | * 是否显示左侧关闭按钮 82 | * 83 | * 默认为 false 84 | */ 85 | showClose: boolean; 86 | /** 87 | * 是否显示右侧查看更多图标 88 | * 89 | * 默认为 false 90 | */ 91 | showGetMore: boolean; 92 | /** 点击触发 */ 93 | onClick: _UniNoticeBarOnClick; 94 | /** 关闭触发 */ 95 | onClose: _UniNoticeBarOnClose; 96 | /** 查看更多触发 */ 97 | onGetmore: _UniNoticeBarOnGetmore; 98 | }>; 99 | 100 | /** 通告栏 */ 101 | type _UniNoticeBar = Component<_UniNoticeBarProps>; 102 | 103 | /** 通告栏实例 */ 104 | type _UniNoticeBarInstance = InstanceType<_UniNoticeBar>; 105 | 106 | export { 107 | _UniNoticeBarOnClick as UniNoticeBarOnClick, 108 | _UniNoticeBarOnClose as UniNoticeBarOnClose, 109 | _UniNoticeBarOnGetmore as UniNoticeBarOnGetmore, 110 | _UniNoticeBarProps as UniNoticeBarProps, 111 | _UniNoticeBar as UniNoticeBar, 112 | _UniNoticeBarInstance as UniNoticeBarInstance, 113 | }; 114 | 115 | declare global { 116 | namespace UniHelper { 117 | /** 点击触发 */ 118 | export interface UniNoticeBarOnClick extends _UniNoticeBarOnClick {} 119 | /** 关闭触发 */ 120 | export interface UniNoticeBarOnClose extends _UniNoticeBarOnClose {} 121 | /** 查看更多触发 */ 122 | export interface UniNoticeBarOnGetmore extends _UniNoticeBarOnGetmore {} 123 | /** 通告栏属性 */ 124 | export type UniNoticeBarProps = _UniNoticeBarProps; 125 | /** 通告栏 */ 126 | export type UniNoticeBar = _UniNoticeBar; 127 | /** 通告栏实例 */ 128 | export type UniNoticeBarInstance = _UniNoticeBarInstance; 129 | } 130 | } 131 | 132 | declare module '@vue/runtime-core' { 133 | export interface GlobalComponents { 134 | /** 通告栏 */ 135 | UniNoticeBar: _UniNoticeBar; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/uni-number-box.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | Component, 3 | InputOnBlurEvent, 4 | InputOnFocusEvent, 5 | } from '@uni-helper/uni-app-types'; 6 | 7 | /** 值 */ 8 | type _UniNumberBoxValue = number; 9 | 10 | /** 值改变时触发 */ 11 | interface _UniNumberBoxOnChange { 12 | (value: _UniNumberBoxValue): void; 13 | } 14 | 15 | /** 值改变时触发 */ 16 | interface _UniNumberBoxOnInput { 17 | (value: _UniNumberBoxValue): void; 18 | } 19 | 20 | type _UniNumberBoxOnFocusEvent = InputOnFocusEvent; 21 | 22 | /** 聚焦时触发 */ 23 | interface _UniNumberBoxOnFocus { 24 | (event: _UniNumberBoxOnFocusEvent): void; 25 | } 26 | 27 | type _UniNumberBoxOnBlurEvent = InputOnBlurEvent; 28 | 29 | /** 失焦时触发 */ 30 | interface _UniNumberBoxOnBlur { 31 | (event: _UniNumberBoxOnBlurEvent): void; 32 | } 33 | 34 | /** 数字输入框属性 */ 35 | type _UniNumberBoxProps = Partial<{ 36 | /** 37 | * 输入框当前值 38 | * 39 | * 默认为 0 40 | */ 41 | value: _UniNumberBoxValue; 42 | /** 43 | * 最小值 44 | * 45 | * 默认为 0 46 | */ 47 | min: number; 48 | /** 49 | * 最大值 50 | * 51 | * 默认为 100 52 | */ 53 | max: number; 54 | /** 55 | * 每次点击改变的间隔大小 56 | * 57 | * 默认为 1 58 | */ 59 | step: number; 60 | /** 61 | * 背景色 62 | * 63 | * 默认为 #f5f5f5 64 | */ 65 | background: string; 66 | /** 67 | * 文本颜色 68 | * 69 | * 默认为 #333 70 | */ 71 | color: string; 72 | /** 73 | * 是否为禁用状态 74 | * 75 | * 默认为 false 76 | */ 77 | disabled: boolean; 78 | /** 值改变时触发 */ 79 | onChange: _UniNumberBoxOnChange; 80 | /** 值改变时触发 */ 81 | onInput: _UniNumberBoxOnInput; 82 | /** 聚焦时触发 */ 83 | onFocus: _UniNumberBoxOnFocus; 84 | /** 失焦时触发 */ 85 | onBlur: _UniNumberBoxOnBlur; 86 | }>; 87 | 88 | /** 带加减按钮的数字输入框 */ 89 | type _UniNumberBox = Component<_UniNumberBoxProps>; 90 | 91 | /** 带加减按钮的数字输入框实例 */ 92 | type _UniNumberBoxInstance = InstanceType<_UniNumberBox>; 93 | 94 | export { 95 | _UniNumberBoxValue as UniNumberBoxValue, 96 | _UniNumberBoxOnChange as UniNumberBoxOnChange, 97 | _UniNumberBoxOnInput as UniNumberBoxOnInput, 98 | _UniNumberBoxOnFocusEvent as UniNumberBoxOnFocusEvent, 99 | _UniNumberBoxOnFocus as UniNumberBoxOnFocus, 100 | _UniNumberBoxOnBlurEvent as UniNumberBoxOnBlurEvent, 101 | _UniNumberBoxOnBlur as UniNumberBoxOnBlur, 102 | _UniNumberBoxProps as UniNumberBoxProps, 103 | _UniNumberBox as UniNumberBox, 104 | _UniNumberBoxInstance as UniNumberBoxInstance, 105 | }; 106 | 107 | declare global { 108 | namespace UniHelper { 109 | /** 值 */ 110 | export type UniNumberBoxValue = _UniNumberBoxValue; 111 | /** 值改变时触发 */ 112 | export interface UniNumberBoxOnChange extends _UniNumberBoxOnChange {} 113 | /** 值改变时触发 */ 114 | export interface UniNumberBoxOnInput extends _UniNumberBoxOnInput {} 115 | export type UniNumberBoxOnFocusEvent = _UniNumberBoxOnFocusEvent; 116 | /** 聚焦时触发 */ 117 | export interface UniNumberBoxOnFocus extends _UniNumberBoxOnFocus {} 118 | export type UniNumberBoxOnBlurEvent = _UniNumberBoxOnBlurEvent; 119 | /** 失焦时触发 */ 120 | export interface UniNumberBoxOnBlur extends _UniNumberBoxOnBlur {} 121 | /** 数字输入框属性 */ 122 | export type UniNumberBoxProps = _UniNumberBoxProps; 123 | /** 带加减按钮的数字输入框 */ 124 | export type UniNumberBox = _UniNumberBox; 125 | /** 带加减按钮的数字输入框实例 */ 126 | export type UniNumberBoxInstance = _UniNumberBoxInstance; 127 | } 128 | } 129 | 130 | declare module '@vue/runtime-core' { 131 | export interface GlobalComponents { 132 | /** 带加减按钮的数字输入框 */ 133 | UniNumberBox: _UniNumberBox; 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/uni-pagination.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 点击页码按钮时触发 */ 4 | interface _UniPaginationOnInput { 5 | (current: number): void; 6 | } 7 | 8 | type _UniPaginationOnChangeType = 'prev' | 'next'; 9 | 10 | interface _UniPaginationOnChangeEvent { 11 | type: _UniPaginationOnChangeType; 12 | current: number; 13 | } 14 | 15 | /** 点击页码按钮时触发 */ 16 | interface _UniPaginationOnChange { 17 | (event: _UniPaginationOnChangeEvent): void; 18 | } 19 | 20 | /** 分页器属性 */ 21 | type _UniPaginationProps = Partial<{ 22 | /** 23 | * 左侧按钮文字 24 | * 25 | * 默认为 上一页 26 | */ 27 | prevText: string; 28 | /** 29 | * 右侧按钮文字 30 | * 31 | * 默认为 下一页 32 | */ 33 | nextText: string; 34 | /** 35 | * 每页条目文字 36 | * 37 | * 默认为 条/页 38 | */ 39 | piecePerPageText: string; 40 | /** 41 | * 当前页,优先级比 current 低 42 | * 43 | * 默认为 1 44 | */ 45 | value: number; 46 | /** 47 | * 当前页,优先级比 value 高 48 | * 49 | * 默认为 1 50 | */ 51 | current: number; 52 | /** 53 | * 数据总量 54 | * 55 | * 默认为 0 56 | */ 57 | total: number; 58 | /** 59 | * 每页数据量 60 | * 61 | * 默认为 10 62 | */ 63 | pageSize: number; 64 | /** 65 | * 是否以 icon 展示按钮 66 | * 67 | * 默认为 false 68 | */ 69 | showIcon: boolean; 70 | /** 71 | * 是否展示每页条目数 72 | * 73 | * 默认为 false 74 | */ 75 | showPageSize: boolean; 76 | /** 77 | * 可选的每页条目数 78 | * 79 | * 默认为 [20, 50, 100, 500] 80 | */ 81 | pageSizeRange: number[]; 82 | /** 83 | * 最大页数 84 | * 85 | * 默认为 7 86 | */ 87 | pagerCount: number; 88 | /** 点击页码按钮时触发 */ 89 | onInput: _UniPaginationOnInput; 90 | /** 点击页码按钮时触发 */ 91 | onChange: _UniPaginationOnChange; 92 | }>; 93 | 94 | /** 分页器组件,用于展示页码、请求数据等 */ 95 | type _UniPagination = Component<_UniPaginationProps>; 96 | 97 | /** 分页器组件实例 */ 98 | type _UniPaginationInstance = InstanceType<_UniPagination>; 99 | 100 | export { 101 | _UniPaginationOnInput as UniPaginationOnInput, 102 | _UniPaginationOnChangeType as UniPaginationOnChangeType, 103 | _UniPaginationOnChangeEvent as UniPaginationOnChangeEvent, 104 | _UniPaginationOnChange as UniPaginationOnChange, 105 | _UniPaginationProps as UniPaginationProps, 106 | _UniPagination as UniPagination, 107 | _UniPaginationInstance as UniPaginationInstance, 108 | }; 109 | 110 | declare global { 111 | namespace UniHelper { 112 | /** 点击页码按钮时触发 */ 113 | export interface UniPaginationOnInput extends _UniPaginationOnInput {} 114 | export type UniPaginationOnChangeType = _UniPaginationOnChangeType; 115 | export type UniPaginationOnChangeEvent = _UniPaginationOnChangeEvent; 116 | /** 点击页码按钮时触发 */ 117 | export interface UniPaginationOnChange extends _UniPaginationOnChange {} 118 | /** 分页器属性 */ 119 | export type UniPaginationProps = _UniPaginationProps; 120 | /** 分页器组件,用于展示页码、请求数据等 */ 121 | export type UniPagination = _UniPagination; 122 | /** 分页器组件实例 */ 123 | export type UniPaginationInstance = _UniPaginationInstance; 124 | } 125 | } 126 | 127 | declare module '@vue/runtime-core' { 128 | export interface GlobalComponents { 129 | /** 分页器组件,用于展示页码、请求数据等 */ 130 | UniPagination: _UniPagination; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/uni-popup-message.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 消息提示主题 5 | * 6 | * success 成功 7 | * 8 | * warn 警告 9 | * 10 | * error 失败 11 | * 12 | * info 消息 13 | */ 14 | type _UniPopupMessageType = 'success' | 'warn' | 'error' | 'info'; 15 | 16 | /** 消息弹窗属性 */ 17 | type _UniPopupMessageProps = Partial<{ 18 | /** 19 | * 消息提示主题 20 | * 21 | * success 成功 22 | * 23 | * warn 警告 24 | * 25 | * error 失败 26 | * 27 | * info 消息 28 | * 29 | * 默认为 success 30 | */ 31 | type: _UniPopupMessageType; 32 | /** 消息提示文字 */ 33 | message: string; 34 | /** 35 | * 消息显示时间,超过后自动关闭 36 | * 37 | * 设置为 0 不会自动关闭,需手动调用 close 关闭 38 | * 39 | * 默认为 3000 40 | */ 41 | duration: number; 42 | /** 43 | * 是否显示遮罩层 44 | * 45 | * 默认为 false 46 | */ 47 | maskShow: boolean; 48 | }>; 49 | 50 | /** 消息弹窗 */ 51 | type _UniPopupMessage = Component<_UniPopupMessageProps>; 52 | 53 | type _UniPopupMessageInstance = InstanceType<_UniPopupMessage>; 54 | 55 | export { 56 | _UniPopupMessageType as UniPopupMessageType, 57 | _UniPopupMessageProps as UniPopupMessageProps, 58 | _UniPopupMessage as UniPopupMessage, 59 | _UniPopupMessageInstance as UniPopupMessageInstance, 60 | }; 61 | 62 | declare global { 63 | namespace UniHelper { 64 | /** 65 | * 消息提示主题 66 | * 67 | * success 成功 68 | * 69 | * warn 警告 70 | * 71 | * error 失败 72 | * 73 | * info 消息 74 | */ 75 | export type UniPopupMessageType = _UniPopupMessageType; 76 | /** 消息弹窗属性 */ 77 | export type UniPopupMessageProps = _UniPopupMessageProps; 78 | /** 消息弹窗 */ 79 | export type UniPopupMessage = _UniPopupMessage; 80 | export type UniPopupMessageInstance = _UniPopupMessageInstance; 81 | } 82 | } 83 | 84 | declare module '@vue/runtime-core' { 85 | export interface GlobalComponents { 86 | UniPopupMessage: _UniPopupMessage; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/uni-popup-share.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | interface _UniPopupShareOnSelectEvent { 4 | item: { 5 | text: string; 6 | icon: string; 7 | name: string; 8 | }; 9 | index: number; 10 | } 11 | 12 | /** 选择时触发 */ 13 | interface _UniPopupShareOnSelect { 14 | (event: _UniPopupShareOnSelectEvent): void; 15 | } 16 | 17 | /** 分享弹窗属性 */ 18 | type _UniPopupShareProps = Partial<{ 19 | /** 分享弹窗标题 */ 20 | title: string; 21 | /** 22 | * 是否拦截按钮事件 23 | * 24 | * true 不会关闭对话框,手动调用 close 以关闭 25 | * 26 | * 默认为 false 27 | */ 28 | beforeClose: boolean; 29 | /** 选择时触发 */ 30 | onSelect: _UniPopupShareOnSelect; 31 | }>; 32 | 33 | /** 分享弹窗 */ 34 | type _UniPopupShare = Component<_UniPopupShareProps>; 35 | 36 | type _UniPopupShareInstance = InstanceType<_UniPopupShare>; 37 | 38 | export { 39 | _UniPopupShareOnSelectEvent as UniPopupShareOnSelectEvent, 40 | _UniPopupShareOnSelect as UniPopupShareOnSelect, 41 | _UniPopupShareProps as UniPopupShareProps, 42 | _UniPopupShare as UniPopupShare, 43 | _UniPopupShareInstance as UniPopupShareInstance, 44 | }; 45 | 46 | declare global { 47 | namespace UniHelper { 48 | export type UniPopupShareOnSelectEvent = _UniPopupShareOnSelectEvent; 49 | /** 选择时触发 */ 50 | export interface UniPopupShareOnSelect extends _UniPopupShareOnSelect {} 51 | /** 分享弹窗属性 */ 52 | export type UniPopupShareProps = _UniPopupShareProps; 53 | /** 分享弹窗 */ 54 | export type UniPopupShare = _UniPopupShare; 55 | export type UniPopupShareInstance = _UniPopupShareInstance; 56 | } 57 | } 58 | 59 | declare module '@vue/runtime-core' { 60 | export interface GlobalComponents { 61 | UniPopupShare: _UniPopupShare; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/uni-popup.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 弹出方式 5 | * 6 | * top 顶部弹出 7 | * 8 | * center 居中弹出 9 | * 10 | * bottom 底部弹出 11 | * 12 | * left 左侧弹出 13 | * 14 | * right 右侧弹出 15 | * 16 | * message 预置样式,消息提示 17 | * 18 | * dialog 预置样式,对话框 19 | * 20 | * share 预置样式,底部弹出分享 21 | */ 22 | type _UniPopupType = 23 | | 'top' 24 | | 'center' 25 | | 'bottom' 26 | | 'left' 27 | | 'right' 28 | | 'message' 29 | | 'dialog' 30 | | 'share'; 31 | 32 | interface _UniPopupOnChangeEvent { 33 | show: boolean; 34 | type: _UniPopupType; 35 | } 36 | 37 | /** 状态变化时触发 */ 38 | interface _UniPopupOnChange { 39 | (event: _UniPopupOnChangeEvent): void; 40 | } 41 | 42 | /** 点击遮罩层触发 */ 43 | interface _UniPopupOnMaskClick { 44 | (): void; 45 | } 46 | 47 | /** 弹出层属性 */ 48 | type _UniPopupProps = Partial<{ 49 | /** 50 | * 是否开启动画 51 | * 52 | * 默认为 true 53 | */ 54 | animation: boolean; 55 | /** 56 | * 弹出方式 57 | * 58 | * top 顶部弹出 59 | * 60 | * center 居中弹出 61 | * 62 | * bottom 底部弹出 63 | * 64 | * left 左侧弹出 65 | * 66 | * right 右侧弹出 67 | * 68 | * message 预置样式,消息提示 69 | * 70 | * dialog 预置样式,对话框 71 | * 72 | * share 预置样式,底部弹出分享 73 | * 74 | * 默认为 center 75 | */ 76 | type: _UniPopupType; 77 | /** 78 | * 蒙版点击是否关闭弹窗 79 | * 80 | * 默认为 true 81 | */ 82 | isMaskClick: boolean; 83 | /** 84 | * 蒙版颜色 85 | * 86 | * 默认为 rgba(0, 0, 0, 0.4) 87 | */ 88 | maskBackgroundColor: string; 89 | /** 90 | * 主窗口背景色 91 | * 92 | * 默认为 none 93 | */ 94 | backgroundColor: string; 95 | /** 96 | * 是否适配底部安全区 97 | * 98 | * 默认为 true 99 | */ 100 | safeArea: boolean; 101 | /** 打开弹出层 */ 102 | open: (type?: _UniPopupType) => void; 103 | /** 关闭弹出层 */ 104 | close: () => void; 105 | /** 状态变化时触发 */ 106 | onChange: _UniPopupOnChange; 107 | /** 点击遮罩层触发 */ 108 | onMaskClick: _UniPopupOnMaskClick; 109 | }>; 110 | 111 | /** 弹出层,在应用中弹出一个消息提示窗口、提示框等 */ 112 | type _UniPopup = Component<_UniPopupProps>; 113 | 114 | /** 弹出层实例 */ 115 | type _UniPopupInstance = InstanceType<_UniPopup>; 116 | 117 | export { 118 | _UniPopupType as UniPopupType, 119 | _UniPopupOnChangeEvent as UniPopupOnChangeEvent, 120 | _UniPopupOnChange as UniPopupOnChange, 121 | _UniPopupOnMaskClick as UniPopupOnMaskClick, 122 | _UniPopupProps as UniPopupProps, 123 | _UniPopup as UniPopup, 124 | _UniPopupInstance as UniPopupInstance, 125 | }; 126 | 127 | declare global { 128 | namespace UniHelper { 129 | /** 130 | * 弹出方式 131 | * 132 | * top 顶部弹出 133 | * 134 | * center 居中弹出 135 | * 136 | * bottom 底部弹出 137 | * 138 | * left 左侧弹出 139 | * 140 | * right 右侧弹出 141 | * 142 | * message 预置样式,消息提示 143 | * 144 | * dialog 预置样式,对话框 145 | * 146 | * share 预置样式,底部弹出分享 147 | */ 148 | export type UniPopupType = _UniPopupType; 149 | export type UniPopupOnChangeEvent = _UniPopupOnChangeEvent; 150 | /** 状态变化时触发 */ 151 | export interface UniPopupOnChange extends _UniPopupOnChange {} 152 | /** 点击遮罩层触发 */ 153 | export interface UniPopupOnMaskClick extends _UniPopupOnMaskClick {} 154 | /** 弹出层属性 */ 155 | export type UniPopupProps = _UniPopupProps; 156 | /** 弹出层,在应用中弹出一个消息提示窗口、提示框等 */ 157 | export type UniPopup = _UniPopup; 158 | /** 弹出层实例 */ 159 | export type UniPopupInstance = _UniPopupInstance; 160 | } 161 | } 162 | 163 | declare module '@vue/runtime-core' { 164 | export interface GlobalComponents { 165 | UniPopup: _UniPopup; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /src/uni-rate.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 评分 */ 4 | type _UniRateValue = number; 5 | 6 | interface _UniRateOnChangeEvent { 7 | value: _UniRateValue; 8 | } 9 | 10 | /** 值改变时触发 */ 11 | interface _UniRateOnChange { 12 | (event: _UniRateOnChangeEvent): void; 13 | } 14 | 15 | /** 评分组件属性 */ 16 | type _UniRateProps = Partial<{ 17 | /** 18 | * 当前评分 19 | * 20 | * 默认为 0 21 | */ 22 | value: _UniRateValue; 23 | /** 24 | * 未选中状态的星星颜色 25 | * 26 | * 默认为 #ececec 27 | */ 28 | color: string; 29 | /** 30 | * 选中状态的星星颜色 31 | * 32 | * 默认为 #ffca3e 33 | */ 34 | activeColor: string; 35 | /** 36 | * 禁用状态的星星颜色 37 | * 38 | * 默认为 #c0c0c0 39 | */ 40 | disabledColor: string; 41 | /** 42 | * 星星的大小 43 | * 44 | * 如果传入 number 默认使用 px 45 | * 46 | * 可传入其他自定义单位的宽度值 47 | * 48 | * 默认为 24 49 | */ 50 | size: number | string; 51 | /** 52 | * 最大评分评分数量 53 | * 54 | * 默认为 5 55 | */ 56 | max: number; 57 | /** 58 | * 星星的间距 59 | * 60 | * 单位为 px 61 | * 62 | * 默认为 0 63 | */ 64 | margin: number | string; 65 | /** 66 | * 是否显示实心星星 67 | * 68 | * 默认为 true 69 | */ 70 | isFill: boolean; 71 | /** 72 | * 是否为禁用状态 73 | * 74 | * 默认为 false 75 | */ 76 | disabled: boolean; 77 | /** 78 | * 是否为只读状态 79 | * 80 | * 默认为 false 81 | */ 82 | readonly: boolean; 83 | /** 84 | * 是否展示半星 85 | * 86 | * 默认为 false 87 | */ 88 | allowHalf: boolean; 89 | /** 90 | * 是否支持滑动手势 91 | * 92 | * 默认为 true 93 | */ 94 | touchable: boolean; 95 | /** 值改变时触发 */ 96 | onChange: _UniRateOnChange; 97 | }>; 98 | 99 | /** 评分组件,多用于购买商品后,对商品进行评价等场景 */ 100 | type _UniRate = Component<_UniRateProps>; 101 | 102 | /** 评分组件实例 */ 103 | type _UniRateInstance = InstanceType<_UniRate>; 104 | 105 | export { 106 | _UniRateValue as UniRateValue, 107 | _UniRateOnChangeEvent as UniRateOnChangeEvent, 108 | _UniRateOnChange as UniRateOnChange, 109 | _UniRateProps as UniRateProps, 110 | _UniRate as UniRate, 111 | _UniRateInstance as UniRateInstance, 112 | }; 113 | 114 | declare global { 115 | namespace UniHelper { 116 | /** 评分 */ 117 | export type UniRateValue = _UniRateValue; 118 | export type UniRateOnChangeEvent = _UniRateOnChangeEvent; 119 | /** 值改变时触发 */ 120 | export interface UniRateOnChange extends _UniRateOnChange {} 121 | /** 评分组件属性 */ 122 | export type UniRateProps = _UniRateProps; 123 | /** 评分组件,多用于购买商品后,对商品进行评价等场景 */ 124 | export type UniRate = _UniRate; 125 | /** 评分组件实例 */ 126 | export type UniRateInstance = _UniRateInstance; 127 | } 128 | } 129 | 130 | declare module '@vue/runtime-core' { 131 | export interface GlobalComponents { 132 | /** 评分组件,多用于购买商品后,对商品进行评价等场景 */ 133 | UniRate: _UniRate; 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/uni-row.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** flex 布局下的水平排列方式 */ 4 | type _UniRowJustify = 5 | | 'start' 6 | | 'end' 7 | | 'center' 8 | | 'space-around' 9 | | 'space-between'; 10 | 11 | /** flex 布局下的垂直排列方式 */ 12 | type _UniRowAlign = 'top' | 'middle' | 'bottom'; 13 | 14 | /** 行属性 */ 15 | type _UniRowProps = Partial<{ 16 | /** 17 | * 栅格间隔 18 | * 19 | * 默认为 0 20 | */ 21 | gutter: number; 22 | /** 23 | * flex 布局下的水平排列方式 24 | * 25 | * 默认为 start 26 | */ 27 | justify: _UniRowJustify; 28 | /** 29 | * flex 布局下的垂直排列方式 30 | * 31 | * 默认为 top 32 | */ 33 | align: _UniRowAlign; 34 | /** 35 | * nvue 中无百分比 width,使用 span 等属性时,需配置此项 rpx 值 36 | * 37 | * 此项不会影响其他平台展示效果 38 | * 39 | * 默认为 750rpx 40 | */ 41 | width: number | string; 42 | }>; 43 | 44 | /** 流式栅格系统中的行 */ 45 | type _UniRow = Component<_UniRowProps>; 46 | 47 | /** 流式栅格系统中的行实例 */ 48 | type _UniRowInstance = InstanceType<_UniRow>; 49 | 50 | export { 51 | _UniRowJustify as UniRowJustify, 52 | _UniRowAlign as UniRowAlign, 53 | _UniRowProps as UniRowProps, 54 | _UniRow as UniRow, 55 | _UniRowInstance as UniRowInstance, 56 | }; 57 | 58 | declare global { 59 | namespace UniHelper { 60 | /** flex 布局下的水平排列方式 */ 61 | export type UniRowJustify = _UniRowJustify; 62 | /** flex 布局下的垂直排列方式 */ 63 | export type UniRowAlign = _UniRowAlign; 64 | /** 行属性 */ 65 | export type UniRowProps = _UniRowProps; 66 | /** 流式栅格系统中的行 */ 67 | export type UniRow = _UniRow; 68 | /** 流式栅格系统中的行实例 */ 69 | export type UniRowInstance = _UniRowInstance; 70 | } 71 | } 72 | 73 | declare module '@vue/runtime-core' { 74 | export interface GlobalComponents { 75 | /** 流式栅格系统中的行 */ 76 | UniRow: _UniRow; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/uni-section.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 装饰类型 5 | * 6 | * line 竖线 7 | * 8 | * circle 圆形 9 | * 10 | * square 方形 11 | */ 12 | type _UniSectionType = 'line' | 'circle' | 'square'; 13 | 14 | /** 点击时触发 */ 15 | interface _UniSectionOnClick { 16 | (): void; 17 | } 18 | 19 | /** 标题栏属性 */ 20 | type _UniSectionProps = Partial<{ 21 | /** 22 | * 装饰类型 23 | * 24 | * line 竖线 25 | * 26 | * circle 圆形 27 | * 28 | * square 方形 29 | */ 30 | type: _UniSectionType; 31 | /** 主标题 */ 32 | title: string; 33 | /** 34 | * 主标题字体大小 35 | * 36 | * 默认为 14px 37 | */ 38 | titleFontSize: string; 39 | /** 40 | * 主标题字体颜色 41 | * 42 | * 默认为 #333 43 | */ 44 | titleColor: string; 45 | /** 副标题 */ 46 | subTitle: string; 47 | /** 48 | * 主标题字体大小 49 | * 50 | * 默认为 12px 51 | */ 52 | subTitleFontSize: string; 53 | /** 54 | * 主标题字体颜色 55 | * 56 | * 默认为 #999 57 | */ 58 | subTitleColor: string; 59 | /** 60 | * 默认插槽的 padding 值 61 | * 62 | * string 自定义的 padding 值 63 | * 64 | * true 10px 65 | * 66 | * 默认为 false,表示不设置 padding 值 67 | */ 68 | padding: boolean | string; 69 | /** 点击时触发 */ 70 | onClick: _UniSectionOnClick; 71 | }>; 72 | 73 | /** 标题栏 */ 74 | type _UniSection = Component<_UniSectionProps>; 75 | 76 | type _UniSectionInstance = InstanceType<_UniSection>; 77 | 78 | export { 79 | _UniSectionType as UniSectionType, 80 | _UniSectionOnClick as UniSectionOnClick, 81 | _UniSectionProps as UniSectionProps, 82 | _UniSection as UniSection, 83 | _UniSectionInstance as UniSectionInstance, 84 | }; 85 | 86 | declare global { 87 | namespace UniHelper { 88 | /** 89 | * 装饰类型 90 | * 91 | * line 竖线 92 | * 93 | * circle 圆形 94 | * 95 | * square 方形 96 | */ 97 | export type UniSectionType = _UniSectionType; 98 | /** 点击时触发 */ 99 | export interface UniSectionOnClick extends _UniSectionOnClick {} 100 | /** 标题栏属性 */ 101 | export type UniSectionProps = _UniSectionProps; 102 | /** 标题栏 */ 103 | export type UniSection = _UniSection; 104 | export type UniSectionInstance = _UniSectionInstance; 105 | } 106 | } 107 | 108 | declare module '@vue/runtime-core' { 109 | export interface GlobalComponents { 110 | UniSection: _UniSection; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/uni-segmented-control.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 当前选中的索引 */ 4 | type _UniSegmentedControlCurrent = number; 5 | 6 | /** 7 | * 分段器样式类型 8 | * 9 | * button 按钮 10 | * 11 | * text 文字 12 | */ 13 | type _UniSegmentedControlStyleType = 'button' | 'text'; 14 | 15 | interface _UniSegmentedControlOnClickItemEvent { 16 | currentIndex: _UniSegmentedControlCurrent; 17 | } 18 | 19 | /** 点击时触发 */ 20 | interface _UniSegmentedControlOnClickItem { 21 | (event: _UniSegmentedControlOnClickItemEvent): void; 22 | } 23 | 24 | /** 分段器属性 */ 25 | type _UniSegmentedControlProps = Partial<{ 26 | /** 27 | * 当前选中的索引 28 | * 29 | * 默认为 0 30 | */ 31 | current: _UniSegmentedControlCurrent; 32 | /** 33 | * 分段器样式类型 34 | * 35 | * button 按钮 36 | * 37 | * text 文字 38 | * 39 | * 默认为 button 40 | */ 41 | styleType: _UniSegmentedControlStyleType; 42 | /** 43 | * 选中的标签背景色与边框颜色 44 | * 45 | * 默认为 #2979ff 46 | */ 47 | activeColor: string; 48 | /** 选项 */ 49 | values: string[]; 50 | /** 点击时触发 */ 51 | onClickItem: _UniSegmentedControlOnClickItem; 52 | }>; 53 | 54 | /** 分段器,用作不同视图的显示 */ 55 | type _UniSegmentedControl = Component<_UniSegmentedControlProps>; 56 | 57 | /** 分段器实例 */ 58 | type _UniSegmentedControlInstance = InstanceType<_UniSegmentedControl>; 59 | 60 | export { 61 | _UniSegmentedControlCurrent as UniSegmentedControlCurrent, 62 | _UniSegmentedControlStyleType as UniSegmentedControlStyleType, 63 | _UniSegmentedControlOnClickItemEvent as UniSegmentedControlOnClickItemEvent, 64 | _UniSegmentedControlOnClickItem as UniSegmentedControlOnClickItem, 65 | _UniSegmentedControlProps as UniSegmentedControlProps, 66 | _UniSegmentedControl as UniSegmentedControl, 67 | _UniSegmentedControlInstance as UniSegmentedControlInstance, 68 | }; 69 | 70 | declare global { 71 | namespace UniHelper { 72 | /** 当前选中的索引 */ 73 | export type UniSegmentedControlCurrent = _UniSegmentedControlCurrent; 74 | /** 75 | * 分段器样式类型 76 | * 77 | * button 按钮 78 | * 79 | * text 文字 80 | */ 81 | export type UniSegmentedControlStyleType = _UniSegmentedControlStyleType; 82 | export type UniSegmentedControlOnClickItemEvent = 83 | _UniSegmentedControlOnClickItemEvent; 84 | /** 点击时触发 */ 85 | export interface UniSegmentedControlOnClickItem 86 | extends _UniSegmentedControlOnClickItem {} 87 | /** 分段器属性 */ 88 | export type UniSegmentedControlProps = _UniSegmentedControlProps; 89 | /** 分段器,用作不同视图的显示 */ 90 | export type UniSegmentedControl = _UniSegmentedControl; 91 | /** 分段器实例 */ 92 | export type UniSegmentedControlInstance = _UniSegmentedControlInstance; 93 | } 94 | } 95 | 96 | declare module '@vue/runtime-core' { 97 | export interface GlobalComponents { 98 | /** 分段器,用作不同视图的显示 */ 99 | UniSegmentedControl: _UniSegmentedControl; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/uni-steps.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | import type { UniIconsType } from './uni-icons'; 3 | 4 | /** 5 | * 排列方向 6 | * 7 | * row 横向 8 | * 9 | * column 纵向 10 | */ 11 | type _UniStepsDirection = 'row' | 'column'; 12 | 13 | /** 数据源 */ 14 | interface _UniStepsOption { 15 | /** 标题 */ 16 | title: string; 17 | /** 描述 */ 18 | desc: string; 19 | } 20 | 21 | /** 步骤条属性 */ 22 | type _UniStepsProps = Partial<{ 23 | /** 24 | * 当前步骤 25 | * 26 | * 默认为 0 27 | */ 28 | active: number; 29 | /** 30 | * 排列方向 31 | * 32 | * row 横向 33 | * 34 | * column 纵向 35 | * 36 | * 默认为 row 37 | */ 38 | direction: _UniStepsDirection; 39 | /** 40 | * 选中状态的颜色 41 | * 42 | * 默认为 #2979ff 43 | */ 44 | activeColor: string; 45 | /** 46 | * 未选中状态的颜色 47 | * 48 | * 默认为 #b7bdc6 49 | */ 50 | deactiveColor: string; 51 | /** 52 | * 当前步骤图标 53 | * 54 | * 默认为 checkbox-filled 55 | */ 56 | activeIcon: UniIconsType; 57 | /** 数据源 */ 58 | options: _UniStepsOption[]; 59 | }>; 60 | 61 | /** 步骤条,常用于显示进度 */ 62 | type _UniSteps = Component<_UniStepsProps>; 63 | 64 | /** 步骤条实例 */ 65 | type _UniStepsInstance = InstanceType<_UniSteps>; 66 | 67 | export { 68 | _UniStepsDirection as UniStepsDirection, 69 | _UniStepsOption as UniStepsOption, 70 | _UniStepsProps as UniStepsProps, 71 | _UniSteps as UniSteps, 72 | _UniStepsInstance as UniStepsInstance, 73 | }; 74 | 75 | declare global { 76 | namespace UniHelper { 77 | /** 78 | * 排列方向 79 | * 80 | * row 横向 81 | * 82 | * column 纵向 83 | */ 84 | export type UniStepsDirection = _UniStepsDirection; 85 | /** 数据源 */ 86 | export interface UniStepsOption extends _UniStepsOption {} 87 | /** 步骤条属性 */ 88 | export type UniStepsProps = _UniStepsProps; 89 | /** 步骤条,常用于显示进度 */ 90 | export type UniSteps = _UniSteps; 91 | /** 步骤条实例 */ 92 | export type UniStepsInstance = _UniStepsInstance; 93 | } 94 | } 95 | 96 | declare module '@vue/runtime-core' { 97 | export interface GlobalComponents { 98 | /** 步骤条 */ 99 | UniSteps: _UniSteps; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/uni-swipe-action-item.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 关闭组件 5 | * 6 | * autoClose 为 false 时有效 7 | */ 8 | type _UniSwipeActionItemShow = 'left' | 'right' | 'none'; 9 | 10 | /** 选项内容及样式 */ 11 | interface _UniSwipeActionItemOption { 12 | /** 按钮文字 */ 13 | text: string; 14 | /** 按钮样式 */ 15 | style: { 16 | /** 17 | * 背景音乐 18 | * 19 | * 默认为 #c7c6cd 20 | */ 21 | backgroundColor: string; 22 | /** 23 | * 文字颜色 24 | * 25 | * 默认为 #ffffff 26 | */ 27 | color: string; 28 | /** 29 | * 字体尺寸 30 | * 31 | * 默认为 14px 32 | */ 33 | fontSize: string; 34 | }; 35 | } 36 | 37 | type _UniSwipeActionItemOnClickEventPosition = Exclude< 38 | _UniSwipeActionItemShow, 39 | 'none' 40 | >; 41 | 42 | interface _UniSwipeActionItemOnClickEvent { 43 | content: _UniSwipeActionItemOption; 44 | index: number; 45 | position: _UniSwipeActionItemOnClickEventPosition; 46 | } 47 | 48 | /** 点击时触发 */ 49 | interface _UniSwipeActionItemOnClick { 50 | (event: _UniSwipeActionItemOnClickEvent): void; 51 | } 52 | 53 | /** 打开或关闭时触发 */ 54 | interface _UniSwipeActionItemOnChange { 55 | (show: _UniSwipeActionItemShow): void; 56 | } 57 | 58 | type _UniSwipeActionItemProps = Partial<{ 59 | /** 60 | * 其他组件开启的时候,当前组件是否自动关闭 61 | * 62 | * 默认为 true 63 | */ 64 | autoClose: boolean; 65 | /** 66 | * 关闭组件 67 | * 68 | * autoClose 为 false 时有效 69 | * 70 | * 默认为 none 71 | */ 72 | show: _UniSwipeActionItemShow; 73 | /** 74 | * 滑动阈值 75 | * 76 | * 默认为 20 77 | */ 78 | threshold: number; 79 | /** 80 | * 是否禁止滑动 81 | * 82 | * 默认为 false 83 | */ 84 | disabled: boolean; 85 | /** 左侧选项内容及样式 */ 86 | leftOptions: _UniSwipeActionItemOption[]; 87 | /** 右侧选项内容及样式 */ 88 | rightOptions: _UniSwipeActionItemOption[]; 89 | /** 点击时触发 */ 90 | onClick: _UniSwipeActionItemOnClick; 91 | /** 打开或关闭时触发 */ 92 | onChange: _UniSwipeActionItemOnChange; 93 | }>; 94 | 95 | type _UniSwipeActionItem = Component<_UniSwipeActionItemProps>; 96 | 97 | type _UniSwipeActionItemInstance = InstanceType<_UniSwipeActionItem>; 98 | 99 | export { 100 | _UniSwipeActionItemShow as UniSwipeActionItemShow, 101 | _UniSwipeActionItemOption as UniSwipeActionItemOption, 102 | _UniSwipeActionItemOnClickEventPosition as UniSwipeActionItemOnClickEventPosition, 103 | _UniSwipeActionItemOnClickEvent as UniSwipeActionItemOnClickEvent, 104 | _UniSwipeActionItemOnClick as UniSwipeActionItemOnClick, 105 | _UniSwipeActionItemOnChange as UniSwipeActionItemOnChange, 106 | _UniSwipeActionItemProps as UniSwipeActionItemProps, 107 | _UniSwipeActionItem as UniSwipeActionItem, 108 | _UniSwipeActionItemInstance as UniSwipeActionItemInstance, 109 | }; 110 | 111 | declare global { 112 | namespace UniHelper { 113 | /** 114 | * 关闭组件 115 | * 116 | * autoClose 为 false 时有效 117 | */ 118 | export type UniSwipeActionItemShow = _UniSwipeActionItemShow; 119 | /** 选项内容及样式 */ 120 | export interface UniSwipeActionItemOption 121 | extends _UniSwipeActionItemOption {} 122 | export type UniSwipeActionItemOnClickEventPosition = 123 | _UniSwipeActionItemOnClickEventPosition; 124 | export type UniSwipeActionItemOnClickEvent = 125 | _UniSwipeActionItemOnClickEvent; 126 | /** 点击时触发 */ 127 | export interface UniSwipeActionItemOnClick 128 | extends _UniSwipeActionItemOnClick {} 129 | /** 打开或关闭时触发 */ 130 | export interface UniSwipeActionItemOnChange 131 | extends _UniSwipeActionItemOnChange {} 132 | export type UniSwipeActionItemProps = _UniSwipeActionItemProps; 133 | export type UniSwipeActionItem = _UniSwipeActionItem; 134 | export type UniSwipeActionItemInstance = _UniSwipeActionItemInstance; 135 | } 136 | } 137 | 138 | declare module '@vue/runtime-core' { 139 | export interface GlobalComponents { 140 | UniSwipeActionItem: _UniSwipeActionItem; 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/uni-swipe-action.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 动态添加数据后,如不能正常滑动,需要主动调用此方法 */ 4 | interface _UniSwipeActionResize { 5 | (): void; 6 | } 7 | 8 | /** 关闭所有已经打开的组件 */ 9 | interface _UniSwipeActionCloseAll { 10 | (): void; 11 | } 12 | 13 | type _UniSwipeActionProps = Partial<{ 14 | /** 动态添加数据后,如不能正常滑动,需要主动调用此方法 */ 15 | resize: _UniSwipeActionResize; 16 | /** 关闭所有已经打开的组件 */ 17 | closeAll: _UniSwipeActionCloseAll; 18 | }>; 19 | 20 | /** 21 | * 滑动操作 22 | * 23 | * 通过滑动触发选项的容器 24 | */ 25 | type _UniSwipeAction = Component<_UniSwipeActionProps>; 26 | 27 | type _UniSwipeActionInstance = InstanceType<_UniSwipeAction>; 28 | 29 | export { 30 | _UniSwipeActionResize as UniSwipeActionResize, 31 | _UniSwipeActionCloseAll as UniSwipeActionCloseAll, 32 | _UniSwipeActionProps as UniSwipeActionProps, 33 | _UniSwipeAction as UniSwipeAction, 34 | _UniSwipeActionInstance as UniSwipeActionInstance, 35 | }; 36 | 37 | declare global { 38 | namespace UniHelper { 39 | /** 动态添加数据后,如不能正常滑动,需要主动调用此方法 */ 40 | export interface UniSwipeActionResize extends _UniSwipeActionResize {} 41 | /** 关闭所有已经打开的组件 */ 42 | export interface UniSwipeActionCloseAll extends _UniSwipeActionCloseAll {} 43 | export type UniSwipeActionProps = _UniSwipeActionProps; 44 | /** 45 | * 滑动操作 46 | * 47 | * 通过滑动触发选项的容器 48 | */ 49 | export type UniSwipeAction = _UniSwipeAction; 50 | export type UniSwipeActionInstance = _UniSwipeActionInstance; 51 | } 52 | } 53 | 54 | declare module '@vue/runtime-core' { 55 | export interface GlobalComponents { 56 | /** 57 | * 滑动操作 58 | * 59 | * 通过滑动触发选项的容器 60 | */ 61 | UniSwipeAction: _UniSwipeAction; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/uni-swiper-dot.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 指示点的类型 */ 4 | type _UniSwiperDotMode = 'default' | 'round' | 'nav' | 'indexes'; 5 | 6 | /** 指示点样式 */ 7 | interface _UniSwiperDotDotsStyles { 8 | /** 9 | * 指示点宽度 10 | * 11 | * mode="nav"、mode="indexes" 时无效 12 | * 13 | * 单位为 px 14 | * 15 | * 默认为 6 16 | */ 17 | width?: number; 18 | /** 19 | * 指示点高度 20 | * 21 | * mode="nav"、mode="indexes" 时无效 22 | * 23 | * 单位为 px 24 | * 25 | * 默认为 6 26 | */ 27 | height?: number; 28 | /** 29 | * 指示点距 swiper 底部的高度 30 | * 31 | * 单位为 px 32 | * 33 | * 默认为 10 34 | */ 35 | bottom?: number; 36 | /** 37 | * 指示点前景色 38 | * 39 | * mode="nav"、mode="indexes" 时有效 40 | * 41 | * 默认为 #ffffff 42 | */ 43 | color?: string; 44 | /** 45 | * 未选择指示点背景色 46 | * 47 | * 默认为 rgba(0, 0, 0, 0.3) 48 | */ 49 | backgroundColor?: string; 50 | /** 51 | * 未选择指示点边框样式 52 | * 53 | * 默认为 1px rgba(0, 0, 0, 0.3) solid 54 | */ 55 | border?: string; 56 | /** 57 | * 已选择指示点背景色 58 | * 59 | * mode="nav" 时无效 60 | * 61 | * 默认为 #333333 62 | */ 63 | selectedBackgroundColor?: string; 64 | /** 65 | * 已选择指示点边框样式 66 | * 67 | * mode="nav" 时无效 68 | * 69 | * 默认为 1px rgba(0, 0, 0, 0.9) solid 70 | */ 71 | selectedBorder?: string; 72 | } 73 | 74 | /** 点击时触发 */ 75 | interface _UniSwiperDotOnClickItem { 76 | (index: number): void; 77 | } 78 | 79 | /** 轮播图指示点属性 */ 80 | type _UniSwiperDotProps = Partial<{ 81 | /** 82 | * 当前指示点索引 83 | * 84 | * 必须是通过 swiper 的 change 事件获取到的 e.detail.current 85 | * 86 | * 默认为 0 87 | */ 88 | current: number; 89 | /** 90 | * 指示点类型 91 | * 92 | * 默认为 default 93 | */ 94 | mode: _UniSwiperDotMode; 95 | /** 96 | * 显示的内容字段 97 | * 98 | * mode="nav" 时有效 99 | */ 100 | field: string; 101 | /** 轮播图数据 */ 102 | info: any[]; 103 | /** 指示点样式 */ 104 | dotsStyles: _UniSwiperDotDotsStyles; 105 | /** 点击时触发 */ 106 | onClickItem: _UniSwiperDotOnClickItem; 107 | }>; 108 | 109 | /** 轮播图指示点 */ 110 | type _UniSwiperDot = Component<_UniSwiperDotProps>; 111 | 112 | type _UniSwiperDotInstance = InstanceType<_UniSwiperDot>; 113 | 114 | export { 115 | _UniSwiperDotMode as UniSwiperDotMode, 116 | _UniSwiperDotDotsStyles as UniSwiperDotDotsStyles, 117 | _UniSwiperDotOnClickItem as UniSwiperDotOnClickItem, 118 | _UniSwiperDotProps as UniSwiperDotProps, 119 | _UniSwiperDot as UniSwiperDot, 120 | _UniSwiperDotInstance as UniSwiperDotInstance, 121 | }; 122 | 123 | declare global { 124 | namespace UniHelper { 125 | /** 指示点的类型 */ 126 | export type UniSwiperDotMode = _UniSwiperDotMode; 127 | /** 指示点样式 */ 128 | export interface UniSwiperDotDotsStyles extends _UniSwiperDotDotsStyles {} 129 | /** 点击时触发 */ 130 | export interface UniSwiperDotOnClickItem extends _UniSwiperDotOnClickItem {} 131 | /** 轮播图指示点属性 */ 132 | export type UniSwiperDotProps = _UniSwiperDotProps; 133 | /** 轮播图指示点 */ 134 | export type UniSwiperDot = _UniSwiperDot; 135 | export type UniSwiperDotInstance = _UniSwiperDotInstance; 136 | } 137 | } 138 | 139 | declare module '@vue/runtime-core' { 140 | export interface GlobalComponents { 141 | UniSwiperDot: _UniSwiperDot; 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/uni-tag.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 4 | * 大小尺寸 5 | * 6 | * normal 正常 7 | * 8 | * small 小 9 | */ 10 | type _UniTagSize = 'normal' | 'small'; 11 | 12 | /** 13 | * 颜色类型 14 | * 15 | * default 灰色 16 | * 17 | * primary 蓝色 18 | * 19 | * success 绿色 20 | * 21 | * warning 黄色 22 | * 23 | * error 红色 24 | * 25 | * royal 紫色 26 | */ 27 | type _UniTagType = 28 | | 'default' 29 | | 'primary' 30 | | 'success' 31 | | 'warning' 32 | | 'error' 33 | | 'royal'; 34 | 35 | /** 自定义样式 */ 36 | type _UniTagCustomStyle = string; 37 | 38 | /** 点击触发 */ 39 | interface _UniTagOnClick { 40 | (): void; 41 | } 42 | 43 | type _UniTagProps = Partial<{ 44 | /** 标签内容 */ 45 | text: string; 46 | /** 47 | * 大小尺寸 48 | * 49 | * normal 正常 50 | * 51 | * small 小 52 | * 53 | * 默认为 normal 54 | */ 55 | size: _UniTagSize; 56 | /** 57 | * 颜色类型 58 | * 59 | * default 灰色 60 | * 61 | * primary 蓝色 62 | * 63 | * success 绿色 64 | * 65 | * warning 黄色 66 | * 67 | * error 红色 68 | * 69 | * royal 紫色 70 | * 71 | * 默认为 default 72 | */ 73 | type: _UniTagType; 74 | /** 75 | * 是否为禁用状态 76 | * 77 | * 默认为 false 78 | */ 79 | disabled: boolean; 80 | /** 81 | * 是否无需背景颜色 82 | * 83 | * 默认为 false 84 | */ 85 | inverted: boolean; 86 | /** 87 | * 是否为圆角 88 | * 89 | * 默认为 false 90 | */ 91 | circle: boolean; 92 | /** 93 | * 是否为标记样式 94 | * 95 | * 默认为 false 96 | */ 97 | mark: boolean; 98 | /** 自定义样式 */ 99 | customStyle: _UniTagCustomStyle; 100 | /** 点击触发 */ 101 | onClick: _UniTagOnClick; 102 | }>; 103 | 104 | /** 用于展示一个或多个文字标签,可点击切换选中、不选中的状态 */ 105 | type _UniTag = Component<_UniTagProps>; 106 | 107 | type _UniTagInstance = InstanceType<_UniTag>; 108 | 109 | export { 110 | _UniTagSize as UniTagSize, 111 | _UniTagType as UniTagType, 112 | _UniTagCustomStyle as UniTagCustomStyle, 113 | _UniTagOnClick as UniTagOnClick, 114 | _UniTagProps as UniTagProps, 115 | _UniTag as UniTag, 116 | _UniTagInstance as UniTagInstance, 117 | }; 118 | 119 | declare global { 120 | namespace UniHelper { 121 | /** 122 | * 大小尺寸 123 | * 124 | * normal 正常 125 | * 126 | * small 小 127 | */ 128 | export type UniTagSize = _UniTagSize; 129 | /** 130 | * 颜色类型 131 | * 132 | * default 灰色 133 | * 134 | * primary 蓝色 135 | * 136 | * success 绿色 137 | * 138 | * warning 黄色 139 | * 140 | * error 红色 141 | * 142 | * royal 紫色 143 | */ 144 | export type UniTagType = _UniTagType; 145 | /** 自定义样式 */ 146 | export type UniTagCustomStyle = _UniTagCustomStyle; 147 | /** 点击触发 */ 148 | export interface UniTagOnClick extends _UniTagOnClick {} 149 | export type UniTagProps = _UniTagProps; 150 | /** 用于展示一个或多个文字标签,可点击切换选中、不选中的状态 */ 151 | export type UniTag = _UniTag; 152 | export type UniTagInstance = _UniTagInstance; 153 | } 154 | } 155 | 156 | declare module '@vue/runtime-core' { 157 | export interface GlobalComponents { 158 | /** 用于展示一个或多个文字标签,可点击切换选中、不选中的状态 */ 159 | UniTag: _UniTag; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /src/uni-td.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 单元格对齐方式 */ 4 | type _UniTdAlign = 'left' | 'center' | 'right'; 5 | 6 | type _UniTdProps = Partial<{ 7 | /** 8 | * 单元格宽度 9 | * 10 | * 单位为 px 11 | */ 12 | width: string | number; 13 | /** 14 | * 对齐方式 15 | * 16 | * 默认为 left 17 | */ 18 | align: _UniTdAlign; 19 | /** 20 | * 行合并 21 | * 22 | * 默认为 1 23 | */ 24 | rowspan: number | string; 25 | /** 26 | * 列合并 27 | * 28 | * 默认为 1 29 | */ 30 | colspan: number | string; 31 | }>; 32 | 33 | type _UniTd = Component<_UniTdProps>; 34 | 35 | type _UniTdInstance = InstanceType<_UniTd>; 36 | 37 | export { 38 | _UniTdAlign as UniTdAlign, 39 | _UniTdProps as UniTdProps, 40 | _UniTd as UniTd, 41 | _UniTdInstance as UniTdInstance, 42 | }; 43 | 44 | declare global { 45 | namespace UniHelper { 46 | /** 单元格对齐方式 */ 47 | export type UniTdAlign = _UniTdAlign; 48 | export type UniTdProps = _UniTdProps; 49 | export type UniTd = _UniTd; 50 | export type UniTdInstance = _UniTdInstance; 51 | } 52 | } 53 | 54 | declare module '@vue/runtime-core' { 55 | export interface GlobalComponents { 56 | UniTd: _UniTd; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/uni-th.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 对齐方式 */ 4 | type _UniThAlign = 'left' | 'center' | 'right'; 5 | 6 | /** 筛选类型 */ 7 | type _UniThFilterType = 'search' | 'select' | 'range' | 'date' | 'timestamp'; 8 | 9 | /** 筛选数据 */ 10 | interface _UniThFilterData { 11 | /** 显示内容 */ 12 | text: string; 13 | /** 值 */ 14 | value: string; 15 | } 16 | 17 | interface _UniThOnSortChangeEvent { 18 | order: 'ascending' | 'descending' | null; 19 | } 20 | 21 | /** 点击排序时触发 */ 22 | interface _UniThOnSortChange { 23 | (event: _UniThOnSortChangeEvent): void; 24 | } 25 | 26 | type _UniThOnFilterChangeEvent = 27 | | { 28 | filterType: 'search'; 29 | filter: string; 30 | } 31 | | { 32 | filterType: 'select' | 'range'; 33 | filter: [string, string]; 34 | } 35 | | { 36 | filterType: 'date' | 'timestamp'; 37 | filter: [number, number]; 38 | }; 39 | 40 | /** 筛选数据时触发 */ 41 | interface _UniThOnFilterChange { 42 | (event: _UniThOnFilterChangeEvent): void; 43 | } 44 | 45 | type _UniThProps = Partial<{ 46 | /** 47 | * 单元格宽度 48 | * 49 | * 如果传入 number 默认使用 px 50 | */ 51 | width: string | number; 52 | /** 53 | * 对齐方式 54 | * 55 | * 默认为 left 56 | */ 57 | align: _UniThAlign; 58 | /** 筛选类型 */ 59 | filterType: _UniThFilterType; 60 | /** 筛选数据 */ 61 | filterData: _UniThFilterData[]; 62 | /** 63 | * 是否启用排序 64 | * 65 | * 默认为 false 66 | */ 67 | sortable: boolean; 68 | /** 69 | * 行合并 70 | * 71 | * 默认为 1 72 | */ 73 | rowspan: number | string; 74 | /** 75 | * 列合并 76 | * 77 | * 默认为 1 78 | */ 79 | colspan: number | string; 80 | /** 点击排序时触发 */ 81 | onSortChange: _UniThOnSortChange; 82 | /** 筛选数据时触发 */ 83 | onFilterChange: _UniThOnFilterChange; 84 | }>; 85 | 86 | type _UniTh = Component<_UniThProps>; 87 | 88 | type _UniThInstance = InstanceType<_UniTh>; 89 | 90 | export { 91 | _UniThAlign as UniThAlign, 92 | _UniThFilterType as UniThFilterType, 93 | _UniThFilterData as UniThFilterData, 94 | _UniThOnSortChangeEvent as UniThOnSortChangeEvent, 95 | _UniThOnSortChange as UniThOnSortChange, 96 | _UniThOnFilterChangeEvent as UniThOnFilterChangeEvent, 97 | _UniThOnFilterChange as UniThOnFilterChange, 98 | _UniThProps as UniThProps, 99 | _UniTh as UniTh, 100 | _UniThInstance as UniThInstance, 101 | }; 102 | 103 | declare global { 104 | namespace UniHelper { 105 | /** 对齐方式 */ 106 | export type UniThAlign = _UniThAlign; 107 | /** 筛选类型 */ 108 | export type UniThFilterType = _UniThFilterType; 109 | /** 筛选数据 */ 110 | export interface UniThFilterData extends _UniThFilterData {} 111 | export type UniThOnSortChangeEvent = _UniThOnSortChangeEvent; 112 | /** 点击排序时触发 */ 113 | export interface UniThOnSortChange extends _UniThOnSortChange {} 114 | export type UniThOnFilterChangeEvent = _UniThOnFilterChangeEvent; 115 | /** 筛选数据时触发 */ 116 | export interface UniThOnFilterChange extends _UniThOnFilterChange {} 117 | export type UniThProps = _UniThProps; 118 | export type UniTh = _UniTh; 119 | export type UniThInstance = _UniThInstance; 120 | } 121 | } 122 | 123 | declare module '@vue/runtime-core' { 124 | export interface GlobalComponents { 125 | /** 用于展示一个或多个文字标签,可点击切换选中、不选中的状态 */ 126 | UniTh: _UniTh; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/uni-title.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | /** 标题类型 */ 4 | type _UniTitleType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5'; 5 | 6 | /** 7 | * 对齐方式 8 | * 9 | * left 左对齐 10 | * 11 | * center 居中对齐 12 | * 13 | * right 右对齐 14 | */ 15 | type _UniTitleAlign = 'left' | 'center' | 'right'; 16 | 17 | type _UniTitleProps = Partial<{ 18 | /** 标题类型 */ 19 | type: _UniTitleType; 20 | /** 章节标题内容 */ 21 | title: string; 22 | /** 23 | * 对齐方式 24 | * 25 | * left 左对齐 26 | * 27 | * center 居中对齐 28 | * 29 | * right 右对齐 30 | * 31 | * 默认为 left 32 | */ 33 | align: _UniTitleAlign; 34 | /** 35 | * 字体颜色 36 | * 37 | * 默认为 #333 38 | */ 39 | color: string; 40 | /** 41 | * 是否开启统计 42 | * 43 | * 如果不填写 type,默认开启 44 | * 45 | * 如果填写 type,默认关闭 46 | */ 47 | stat: boolean; 48 | }>; 49 | 50 | /** 51 | * 章节标题,通常用于记录页面标题 52 | * 53 | * 使用当前组件,uni-app 如果开启统计,将会自动统计页面标题 54 | */ 55 | type _UniTitle = Component<_UniTitleProps>; 56 | 57 | type _UniTitleInstance = InstanceType<_UniTitle>; 58 | 59 | export { 60 | _UniTitleType as UniTitleType, 61 | _UniTitleAlign as UniTitleAlign, 62 | _UniTitleProps as UniTitleProps, 63 | _UniTitle as UniTitle, 64 | _UniTitleInstance as UniTitleInstance, 65 | }; 66 | 67 | declare global { 68 | namespace UniHelper { 69 | /** 标题类型 */ 70 | export type UniTitleType = _UniTitleType; 71 | /** 72 | * 对齐方式 73 | * 74 | * left 左对齐 75 | * 76 | * center 居中对齐 77 | * 78 | * right 右对齐 79 | */ 80 | export type UniTitleAlign = _UniTitleAlign; 81 | export type UniTitleProps = _UniTitleProps; 82 | /** 83 | * 章节标题,通常用于记录页面标题 84 | * 85 | * 使用当前组件,uni-app 如果开启统计,将会自动统计页面标题 86 | */ 87 | export type UniTitle = _UniTitle; 88 | export type UniTitleInstance = _UniTitleInstance; 89 | } 90 | } 91 | 92 | declare module '@vue/runtime-core' { 93 | export interface GlobalComponents { 94 | /** 用于展示一个或多个文字标签,可点击切换选中、不选中的状态 */ 95 | UniTitle: _UniTitle; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/uni-tooltip.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniTooltipProps = Partial<{ 4 | /** 显示内容 */ 5 | content: string; 6 | }>; 7 | 8 | /** 提示文字 */ 9 | type _UniTooltip = Component<_UniTooltipProps>; 10 | 11 | type _UniTooltipInstance = InstanceType<_UniTooltip>; 12 | 13 | export { 14 | _UniTooltipProps as UniTooltipProps, 15 | _UniTooltip as UniTooltip, 16 | _UniTooltipInstance as UniTooltipInstance, 17 | }; 18 | 19 | declare global { 20 | namespace UniHelper { 21 | export type UniTooltipProps = _UniTooltipProps; 22 | /** 提示文字 */ 23 | export type UniTooltip = _UniTooltip; 24 | export type UniTooltipInstance = _UniTooltipInstance; 25 | } 26 | } 27 | 28 | declare module '@vue/runtime-core' { 29 | export interface GlobalComponents { 30 | /** 提示文字 */ 31 | UniTooltip: _UniTooltip; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/uni-tr.ts: -------------------------------------------------------------------------------- 1 | import type { Component } from '@uni-helper/uni-app-types'; 2 | 3 | type _UniTrProps = Partial<{ 4 | /** 5 | * 是否禁用选择 6 | * 7 | * 默认为 false 8 | */ 9 | disabled: boolean; 10 | keyValue: string | number; 11 | }>; 12 | 13 | type _UniTr = Component<_UniTrProps>; 14 | 15 | type _UniTrInstance = InstanceType<_UniTr>; 16 | 17 | export { 18 | _UniTrProps as UniTrProps, 19 | _UniTr as UniTr, 20 | _UniTrInstance as UniTrInstance, 21 | }; 22 | 23 | declare global { 24 | namespace UniHelper { 25 | export type UniTrProps = _UniTrProps; 26 | export type UniTr = _UniTr; 27 | export type UniTrInstance = _UniTrInstance; 28 | } 29 | } 30 | 31 | declare module '@vue/runtime-core' { 32 | export interface GlobalComponents { 33 | UniTr: _UniTr; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/uni-badge.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniBadgeType, 4 | UniBadgeSize, 5 | UniBadgeCustomStyle, 6 | UniBadgeAbsolute, 7 | UniBadgeOnClick, 8 | UniBadgeProps, 9 | UniBadge, 10 | UniBadgeInstance, 11 | } from '@/index'; 12 | 13 | describe('UniBadge', () => { 14 | expectTypeOf().toBeString(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeString(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().toBeObject(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().toBeString(); 24 | expectTypeOf().toEqualTypeOf(); 25 | 26 | expectTypeOf().toBeFunction(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeObject(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().not.toBeAny(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().not.toBeAny(); 36 | expectTypeOf().toEqualTypeOf(); 37 | }); 38 | -------------------------------------------------------------------------------- /tests/uni-breadcrumb-item.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniBreadcrumbItemProps, UniBreadcrumbItem, UniBreadcrumbItemInstance } from '@/index'; 3 | 4 | describe('UniBreadcrumbItem', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-breadcrumb.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniBreadcrumbProps, UniBreadcrumb, UniBreadcrumbInstance } from '@/index'; 3 | 4 | describe('UniBreadcrumb', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-calendar.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniCalendarDate, 4 | UniCalendarSelectedElement, 5 | UniCalendarSelected, 6 | UniCalendarOpen, 7 | UniCalendarBaseEvent, 8 | UniCalendarOnChangeEvent, 9 | UniCalendarOnChange, 10 | UniCalendarOnConfirmEvent, 11 | UniCalendarOnConfirm, 12 | UniCalendarOnMonthSwitchEvent, 13 | UniCalendarOnMonthSwitch, 14 | UniCalendarOnClose, 15 | UniCalendarProps, 16 | UniCalendar, 17 | UniCalendarInstance, 18 | } from '@/index'; 19 | 20 | describe('UniCalendar', () => { 21 | expectTypeOf().toBeString(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().toBeObject(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeArray(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeFunction(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeObject(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().toBeObject(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().toBeObject(); 40 | expectTypeOf().toEqualTypeOf(); 41 | 42 | expectTypeOf().toBeObject(); 43 | expectTypeOf().toEqualTypeOf(); 44 | 45 | expectTypeOf().toBeObject(); 46 | expectTypeOf().toEqualTypeOf(); 47 | 48 | expectTypeOf().toBeObject(); 49 | expectTypeOf().toEqualTypeOf(); 50 | 51 | expectTypeOf().toBeObject(); 52 | expectTypeOf().toEqualTypeOf(); 53 | 54 | expectTypeOf().toBeObject(); 55 | expectTypeOf().toEqualTypeOf(); 56 | 57 | expectTypeOf().toBeObject(); 58 | expectTypeOf().toEqualTypeOf(); 59 | 60 | expectTypeOf().not.toBeAny(); 61 | expectTypeOf().toEqualTypeOf(); 62 | 63 | expectTypeOf().not.toBeAny(); 64 | expectTypeOf().toEqualTypeOf(); 65 | }); 66 | -------------------------------------------------------------------------------- /tests/uni-card.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniCardOnClickType, 4 | UniCardOnClick, 5 | UniCardProps, 6 | UniCard, 7 | UniCardInstance, 8 | } from '@/index'; 9 | 10 | describe('UniCard', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-col.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniColRules, UniColProps, UniCol, UniColInstance } from '@/index'; 3 | 4 | describe('UniCol', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().toBeObject(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().not.toBeAny(); 15 | expectTypeOf().toEqualTypeOf(); 16 | }); 17 | -------------------------------------------------------------------------------- /tests/uni-collapse-item.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniCollapseItemTitleBorder, 4 | UniCollapseItemProps, 5 | UniCollapseItem, 6 | UniCollapseItemInstance, 7 | } from '@/index'; 8 | 9 | describe('UniCollapseItem', () => { 10 | expectTypeOf().toBeString(); 11 | expectTypeOf().toEqualTypeOf(); 12 | 13 | expectTypeOf().toBeObject(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().not.toBeAny(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().not.toBeAny(); 20 | expectTypeOf().toEqualTypeOf(); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/uni-collapse.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniCollapseResize, 4 | UniCollapseBaseProps, 5 | UniCollapseNoAccordionValue, 6 | UniCollapseNoAccordionOnChange, 7 | UniCollapseNoAccordionProps, 8 | UniCollapseAccordionValue, 9 | UniCollapseAccordionOnChange, 10 | UniCollapseAccordionProps, 11 | UniCollapseProps, 12 | UniCollapse, 13 | UniCollapseInstance, 14 | } from '@/index'; 15 | 16 | describe('UniCollapse', () => { 17 | expectTypeOf().toBeFunction(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().toBeObject(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().toBeArray(); 24 | expectTypeOf().toEqualTypeOf(); 25 | 26 | expectTypeOf().toBeFunction(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeObject(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().toBeString(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().toBeFunction(); 36 | expectTypeOf().toEqualTypeOf(); 37 | 38 | expectTypeOf().toBeObject(); 39 | expectTypeOf().toEqualTypeOf(); 40 | 41 | expectTypeOf().toBeObject(); 42 | expectTypeOf().toEqualTypeOf(); 43 | 44 | expectTypeOf().not.toBeAny(); 45 | expectTypeOf().toEqualTypeOf(); 46 | 47 | expectTypeOf().not.toBeAny(); 48 | expectTypeOf().toEqualTypeOf(); 49 | }); 50 | -------------------------------------------------------------------------------- /tests/uni-combox.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniComboxValue, 4 | UniComboxOnInput, 5 | UniComboxProps, 6 | UniCombox, 7 | UniComboxInstance, 8 | } from '@/index'; 9 | 10 | describe('UniCombox', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-countdown.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniCountdownOnUpdate, 4 | UniCountdownOnTimeup, 5 | UniCountdownProps, 6 | UniCountdown, 7 | UniCountdownInstance, 8 | } from '@/index'; 9 | 10 | describe('UniCountdown', () => { 11 | expectTypeOf().toBeFunction(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-data-checkbox.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniDataCheckboxValue, 4 | UniDataCheckboxMode, 5 | UniDataCheckboxLocaldataItem, 6 | UniDataCheckboxLocaldata, 7 | UniDataCheckboxIcon, 8 | UniDataCheckboxMap, 9 | UniDataCheckboxBaseProps, 10 | UniDataCheckboxSingleOnChangeDetail, 11 | UniDataCheckboxSingleOnChangeEvent, 12 | UniDataCheckboxSingleOnChange, 13 | UniDataCheckboxSingleProps, 14 | UniDataCheckboxMultipleOnChangeDetail, 15 | UniDataCheckboxMultipleOnChangeEvent, 16 | UniDataCheckboxMultipleOnChange, 17 | UniDataCheckboxMultipleProps, 18 | UniDataCheckboxProps, 19 | UniDataCheckbox, 20 | UniDataCheckboxInstance, 21 | } from '@/index'; 22 | 23 | describe('UniDataCheckbox', () => { 24 | expectTypeOf().toMatchTypeOf(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeString(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeObject(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeArray(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().toBeString(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().toBeObject(); 40 | expectTypeOf().toEqualTypeOf(); 41 | 42 | expectTypeOf().toBeObject(); 43 | expectTypeOf().toEqualTypeOf; 44 | 45 | expectTypeOf().toBeObject(); 46 | expectTypeOf() 47 | .toEqualTypeOf; 48 | 49 | expectTypeOf().toBeObject(); 50 | expectTypeOf() 51 | .toEqualTypeOf; 52 | 53 | expectTypeOf().toBeObject(); 54 | expectTypeOf() 55 | .toEqualTypeOf; 56 | 57 | expectTypeOf().toBeObject(); 58 | expectTypeOf().toEqualTypeOf; 59 | 60 | expectTypeOf().toBeObject(); 61 | expectTypeOf() 62 | .toEqualTypeOf; 63 | 64 | expectTypeOf().toBeObject(); 65 | expectTypeOf() 66 | .toEqualTypeOf; 67 | 68 | expectTypeOf().toBeObject(); 69 | expectTypeOf() 70 | .toEqualTypeOf; 71 | 72 | expectTypeOf().toBeObject(); 73 | expectTypeOf() 74 | .toEqualTypeOf; 75 | 76 | expectTypeOf().toBeObject(); 77 | expectTypeOf().toEqualTypeOf(); 78 | 79 | expectTypeOf().not.toBeAny(); 80 | expectTypeOf().toEqualTypeOf(); 81 | 82 | expectTypeOf().not.toBeAny(); 83 | expectTypeOf().toEqualTypeOf(); 84 | }); 85 | -------------------------------------------------------------------------------- /tests/uni-data-picker.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniDataPickerSpaceInfoProvider, 4 | UniDataPickerSpaceInfo, 5 | UniDataPickerKey, 6 | UniDataPickerValue, 7 | UniDataPickerLocaldataItem, 8 | UniDataPickerLocaldata, 9 | UniDataPickerPageData, 10 | UniDataPickerMap, 11 | UniDataPickerShow, 12 | UniDataPickerHide, 13 | UniDataPickerClear, 14 | UniDataPickerOnChangeDetail, 15 | UniDataPickerOnChange, 16 | UniDataPickerOnNodeclick, 17 | UniDataPickerOnStepsearch, 18 | UniDataPickerOnPopupopened, 19 | UniDataPickerOnPopupclosed, 20 | UniDataPickerProps, 21 | UniDataPicker, 22 | UniDataPickerInstance, 23 | } from '@/index'; 24 | 25 | describe('UniDataPicker', () => { 26 | expectTypeOf().toBeString(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeObject(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().toMatchTypeOf(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().toMatchTypeOf(); 36 | expectTypeOf().toEqualTypeOf(); 37 | 38 | expectTypeOf().toBeObject(); 39 | expectTypeOf().toEqualTypeOf(); 40 | 41 | expectTypeOf().toBeArray(); 42 | expectTypeOf().toEqualTypeOf(); 43 | 44 | expectTypeOf().toBeString(); 45 | expectTypeOf().toEqualTypeOf(); 46 | 47 | expectTypeOf().toBeObject(); 48 | expectTypeOf().toEqualTypeOf(); 49 | 50 | expectTypeOf().toBeFunction(); 51 | expectTypeOf().toEqualTypeOf(); 52 | 53 | expectTypeOf().toBeFunction(); 54 | expectTypeOf().toEqualTypeOf(); 55 | 56 | expectTypeOf().toBeFunction(); 57 | expectTypeOf().toEqualTypeOf(); 58 | 59 | expectTypeOf().toBeObject(); 60 | expectTypeOf().toEqualTypeOf(); 61 | 62 | expectTypeOf().toBeFunction(); 63 | expectTypeOf().toEqualTypeOf(); 64 | 65 | expectTypeOf().toBeFunction(); 66 | expectTypeOf().toEqualTypeOf(); 67 | 68 | expectTypeOf().toBeFunction(); 69 | expectTypeOf().toEqualTypeOf(); 70 | 71 | expectTypeOf().toBeFunction(); 72 | expectTypeOf().toEqualTypeOf(); 73 | 74 | expectTypeOf().toBeFunction(); 75 | expectTypeOf().toEqualTypeOf(); 76 | 77 | expectTypeOf().toBeObject(); 78 | expectTypeOf().toEqualTypeOf(); 79 | 80 | expectTypeOf().not.toBeAny(); 81 | expectTypeOf().toEqualTypeOf(); 82 | 83 | expectTypeOf().not.toBeAny(); 84 | expectTypeOf().toEqualTypeOf(); 85 | }); 86 | -------------------------------------------------------------------------------- /tests/uni-data-select.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniDataSelectValue, 4 | UniDataSelectLocaldataItem, 5 | UniDataSelectLocaldata, 6 | UniDataSelectOnChange, 7 | UniDataSelectProps, 8 | UniDataSelect, 9 | UniDataSelectInstance, 10 | } from '@/index'; 11 | 12 | describe('UniDataSelect', () => { 13 | expectTypeOf().toMatchTypeOf(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeObject(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeArray(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-dateformat.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniDateformatLocale, 4 | UniDateformatData, 5 | UniDateformatProps, 6 | UniDateformat, 7 | UniDateformatInstance, 8 | } from '@/index'; 9 | 10 | describe('UniDateformat', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toMatchTypeOf(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-datetime-picker.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniDatetimePickerType, 4 | UniDatetimePickerValue, 5 | UniDatetimePickerStart, 6 | UniDatetimePickerEnd, 7 | UniDatetimePickerReturnType, 8 | UniDatetimePickerShow, 9 | UniDatetimePickerClose, 10 | UniDatetimePickerClear, 11 | UniDatetimePickerOnChange, 12 | UniDatetimePickerOnMaskClick, 13 | UniDatetimePickerProps, 14 | UniDatetimePicker, 15 | UniDatetimePickerInstance, 16 | } from '@/index'; 17 | 18 | describe('UniDatetimePicker', () => { 19 | expectTypeOf().toBeString(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toMatchTypeOf< 23 | string | number | Date | string[] | number[] | Date[] 24 | >(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toMatchTypeOf(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toMatchTypeOf(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeString(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().toBeFunction(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().toBeFunction(); 40 | expectTypeOf().toEqualTypeOf(); 41 | 42 | expectTypeOf().toBeFunction(); 43 | expectTypeOf().toEqualTypeOf(); 44 | 45 | expectTypeOf().toBeFunction(); 46 | expectTypeOf().toEqualTypeOf(); 47 | 48 | expectTypeOf().toBeFunction(); 49 | expectTypeOf().toEqualTypeOf(); 50 | 51 | expectTypeOf().toBeObject(); 52 | expectTypeOf().toEqualTypeOf(); 53 | 54 | expectTypeOf().not.toBeAny(); 55 | expectTypeOf().toEqualTypeOf(); 56 | 57 | expectTypeOf().not.toBeAny(); 58 | expectTypeOf().toEqualTypeOf(); 59 | }); 60 | -------------------------------------------------------------------------------- /tests/uni-drawer.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniDrawerMode, 4 | UniDrawerOpen, 5 | UniDrawerClose, 6 | UniDrawerOnChange, 7 | UniDrawerProps, 8 | UniDrawer, 9 | UniDrawerInstance, 10 | } from '@/index'; 11 | 12 | describe('UniDrawer', () => { 13 | expectTypeOf().toBeString(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeFunction(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeFunction(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-easyinput.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniEasyinputValue, 4 | UniEasyinputType, 5 | UniEasyinputOnConfirmType, 6 | UniEasyinputTrim, 7 | UniEasyinputStyles, 8 | UniEasyinputIconPosition, 9 | UniEasyinputOnInput, 10 | UniEasyinputOnClear, 11 | UniEasyinputOnFocusDetail, 12 | UniEasyinputOnFocusEvent, 13 | UniEasyinputOnFocus, 14 | UniEasyinputOnBlurDetail, 15 | UniEasyinputOnBlurEvent, 16 | UniEasyinputOnBlur, 17 | UniEasyinputOnConfirm, 18 | UniEasyinputOnIconClick, 19 | UniEasyinputOnChange, 20 | UniEasyinputProps, 21 | UniEasyinput, 22 | UniEasyinputInstance, 23 | } from '@/index'; 24 | 25 | describe('UniEasyinput', () => { 26 | expectTypeOf().toMatchTypeOf(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeString(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().toBeString(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().toMatchTypeOf(); 36 | expectTypeOf().toEqualTypeOf(); 37 | 38 | expectTypeOf().toBeObject(); 39 | expectTypeOf().toEqualTypeOf(); 40 | 41 | expectTypeOf().toBeString(); 42 | expectTypeOf().toEqualTypeOf(); 43 | 44 | expectTypeOf().toBeFunction(); 45 | expectTypeOf().toEqualTypeOf(); 46 | 47 | expectTypeOf().toBeFunction(); 48 | expectTypeOf().toEqualTypeOf(); 49 | 50 | expectTypeOf().toBeObject(); 51 | expectTypeOf().toEqualTypeOf(); 52 | 53 | expectTypeOf().toBeObject(); 54 | expectTypeOf().toEqualTypeOf(); 55 | 56 | expectTypeOf().toBeFunction(); 57 | expectTypeOf().toEqualTypeOf(); 58 | 59 | expectTypeOf().toBeObject(); 60 | expectTypeOf().toEqualTypeOf(); 61 | 62 | expectTypeOf().toBeObject(); 63 | expectTypeOf().toEqualTypeOf(); 64 | 65 | expectTypeOf().toBeFunction(); 66 | expectTypeOf().toEqualTypeOf(); 67 | 68 | expectTypeOf().toBeFunction(); 69 | expectTypeOf().toEqualTypeOf(); 70 | 71 | expectTypeOf().toBeFunction(); 72 | expectTypeOf().toEqualTypeOf(); 73 | 74 | expectTypeOf().toBeFunction(); 75 | expectTypeOf().toEqualTypeOf(); 76 | 77 | expectTypeOf().toBeObject(); 78 | expectTypeOf().toEqualTypeOf(); 79 | 80 | expectTypeOf().not.toBeAny(); 81 | expectTypeOf().toEqualTypeOf(); 82 | 83 | expectTypeOf().not.toBeAny(); 84 | expectTypeOf().toEqualTypeOf(); 85 | }); 86 | -------------------------------------------------------------------------------- /tests/uni-fab.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniFabPattern, 4 | UniFabHorizontal, 5 | UniFabVertical, 6 | UniFabDirection, 7 | UniFabContentItem, 8 | UniFabContent, 9 | UniFabOnTriggerEvent, 10 | UniFabOnTrigger, 11 | UniFabOnFabClick, 12 | UniFabProps, 13 | UniFab, 14 | UniFabInstance, 15 | } from '@/index'; 16 | 17 | describe('UniFab', () => { 18 | expectTypeOf().toBeObject(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeString(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().toBeString(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeString(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeObject(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeArray(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().toBeObject(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().toBeFunction(); 40 | expectTypeOf().toEqualTypeOf(); 41 | 42 | expectTypeOf().toBeFunction(); 43 | expectTypeOf().toEqualTypeOf(); 44 | 45 | expectTypeOf().toBeObject(); 46 | expectTypeOf().toEqualTypeOf(); 47 | 48 | expectTypeOf().not.toBeAny(); 49 | expectTypeOf().toEqualTypeOf(); 50 | 51 | expectTypeOf().not.toBeAny(); 52 | expectTypeOf().toEqualTypeOf(); 53 | }); 54 | -------------------------------------------------------------------------------- /tests/uni-fav.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniFavContentText, 4 | UniFavOnClick, 5 | UniFavProps, 6 | UniFav, 7 | UniFavInstance, 8 | } from '@/index'; 9 | 10 | describe('UniFav', () => { 11 | expectTypeOf().toBeObject(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-forms-item.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniFormsItemRulesRule, 4 | UniFormsItemRules, 5 | UniFormsItemLabelAlign, 6 | UniFormsItemSetRules, 7 | UniFormsItemOnFieldChange, 8 | UniFormsItemProps, 9 | UniFormsItem, 10 | UniFormsItemInstance, 11 | } from '@/index'; 12 | 13 | describe('UniFormsItem', () => { 14 | expectTypeOf().toBeObject(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeArray(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().toBeString(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().toBeFunction(); 24 | expectTypeOf().toEqualTypeOf(); 25 | 26 | expectTypeOf().toBeFunction(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeObject(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().not.toBeAny(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().not.toBeAny(); 36 | expectTypeOf().toEqualTypeOf(); 37 | }); 38 | -------------------------------------------------------------------------------- /tests/uni-forms.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniFormsFormat, 4 | UniFormsCallback, 5 | UniFormsValidateFunction, 6 | UniFormsRulesRule, 7 | UniFormsRules, 8 | UniFormsValidateTrigger, 9 | UniFormsLabelPosition, 10 | UniFormsLabelAlign, 11 | UniFormsErrShowType, 12 | UniFormsSetRules, 13 | UniFormsValidate, 14 | UniFormsValidateField, 15 | UniFormsClearValidate, 16 | UniFormsOnValidate, 17 | UniFormsProps, 18 | UniForms, 19 | UniFormsInstance, 20 | } from '@/index'; 21 | 22 | describe('UniForms', () => { 23 | expectTypeOf().toBeString(); 24 | expectTypeOf().toEqualTypeOf(); 25 | 26 | expectTypeOf().toBeFunction(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeFunction(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().toBeObject(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().toBeObject(); 36 | expectTypeOf().toEqualTypeOf(); 37 | 38 | expectTypeOf().toBeString(); 39 | expectTypeOf().toEqualTypeOf(); 40 | 41 | expectTypeOf().toBeString(); 42 | expectTypeOf().toEqualTypeOf(); 43 | 44 | expectTypeOf().toBeString(); 45 | expectTypeOf().toEqualTypeOf(); 46 | 47 | expectTypeOf().toBeString(); 48 | expectTypeOf().toEqualTypeOf(); 49 | 50 | expectTypeOf().toBeFunction(); 51 | expectTypeOf().toEqualTypeOf(); 52 | 53 | expectTypeOf().toBeFunction(); 54 | expectTypeOf().toEqualTypeOf(); 55 | 56 | expectTypeOf().toBeFunction(); 57 | expectTypeOf().toEqualTypeOf(); 58 | 59 | expectTypeOf().toBeFunction(); 60 | expectTypeOf().toEqualTypeOf(); 61 | 62 | expectTypeOf().toBeFunction(); 63 | expectTypeOf().toEqualTypeOf(); 64 | 65 | expectTypeOf().toBeObject(); 66 | expectTypeOf().toEqualTypeOf(); 67 | 68 | expectTypeOf().not.toBeAny(); 69 | expectTypeOf().toEqualTypeOf(); 70 | 71 | expectTypeOf().not.toBeAny(); 72 | expectTypeOf().toEqualTypeOf(); 73 | }); 74 | -------------------------------------------------------------------------------- /tests/uni-goods-nav.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniGoodsNavOption, 4 | UniGoodsNavOnClickEvent, 5 | UniGoodsNavOnClick, 6 | UniGoodsNavOnButtonClickEvent, 7 | UniGoodsNavOnButtonClick, 8 | UniGoodsNavButton, 9 | UniGoodsNavProps, 10 | UniGoodsNav, 11 | UniGoodsNavInstance, 12 | } from '@/index'; 13 | 14 | describe('UniGoodsNav', () => { 15 | expectTypeOf().toBeObject(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeObject(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeFunction(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().toBeObject(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeFunction(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeObject(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeObject(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().not.toBeAny(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().not.toBeAny(); 40 | expectTypeOf().toEqualTypeOf(); 41 | }); 42 | -------------------------------------------------------------------------------- /tests/uni-grid-item.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniGridItemProps, UniGridItem, UniGridItemInstance } from '@/index'; 3 | 4 | describe('UniGridItem', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-grid.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniGridOnChangeDetail, 4 | UniGridOnChangeEvent, 5 | UniGridOnChange, 6 | UniGridProps, 7 | UniGrid, 8 | UniGridInstance, 9 | } from '@/index'; 10 | 11 | describe('UniGrid', () => { 12 | expectTypeOf().toBeObject(); 13 | expectTypeOf().toEqualTypeOf(); 14 | 15 | expectTypeOf().toBeObject(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeFunction(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeObject(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().not.toBeAny(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().not.toBeAny(); 28 | expectTypeOf().toEqualTypeOf(); 29 | }); 30 | -------------------------------------------------------------------------------- /tests/uni-group.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniGroupMode, 4 | UniGroupOnClick, 5 | UniGroupProps, 6 | UniGroup, 7 | UniGroupInstance, 8 | } from '@/index'; 9 | 10 | describe('UniGroup', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-icons.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniIconsType, UniIconsProps, UniIcons, UniIconsInstance } from '@/index'; 3 | 4 | describe('UniIcons', () => { 5 | expectTypeOf().toBeString(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().toBeObject(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().not.toBeAny(); 15 | expectTypeOf().toEqualTypeOf(); 16 | }); 17 | -------------------------------------------------------------------------------- /tests/uni-indexed-list.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniIndexedListOption, 4 | UniIndexedItemSelected, 5 | UniIndexedListOnClickEvent, 6 | UniIndexedListOnClick, 7 | UniIndexedListProps, 8 | UniIndexedList, 9 | UniIndexedListInstance, 10 | } from '@/index'; 11 | 12 | describe('UniIndexedList', () => { 13 | expectTypeOf().toBeObject(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeObject(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeObject(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-link.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniLinkProps, UniLink, UniLinkInstance } from '@/index'; 3 | 4 | describe('UniLink', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-list-ad.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniListAdProps, UniListAd, UniListAdInstance } from '@/index'; 3 | 4 | describe('UniListAd', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-list-chat.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniListChatLink, 4 | UniListChatBadgePositon, 5 | UniListChatOnClickEvent, 6 | UniListChatOnClick, 7 | UniListChatProps, 8 | UniListChat, 9 | UniListChatInstance, 10 | } from '@/index'; 11 | 12 | describe('UniListChat', () => { 13 | expectTypeOf().toBeString(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeString(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeObject(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-list-item.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniListItemEllipsis, 4 | UniListItemThumbSize, 5 | UniListItemLink, 6 | UniListItemDirection, 7 | UniListItemSwitchChecked, 8 | UniListItemExtraIcon, 9 | UniListItemOnClickEvent, 10 | UniListItemOnClick, 11 | UniListItemOnSwitchChangeEvent, 12 | UniListItemOnSwitchChange, 13 | UniListItemProps, 14 | UniListItem, 15 | UniListItemInstance, 16 | } from '@/index'; 17 | 18 | describe('UniListItem', () => { 19 | expectTypeOf().toBeNumber(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeString(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeString(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().toBeString(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().toBeBoolean(); 32 | expectTypeOf().toEqualTypeOf(); 33 | 34 | expectTypeOf().toBeObject(); 35 | expectTypeOf().toEqualTypeOf(); 36 | 37 | expectTypeOf().toBeObject(); 38 | expectTypeOf().toEqualTypeOf(); 39 | 40 | expectTypeOf().toBeFunction(); 41 | expectTypeOf().toEqualTypeOf(); 42 | 43 | expectTypeOf().toBeObject(); 44 | expectTypeOf().toEqualTypeOf(); 45 | 46 | expectTypeOf().toBeFunction(); 47 | expectTypeOf().toEqualTypeOf(); 48 | 49 | expectTypeOf().toBeObject(); 50 | expectTypeOf().toEqualTypeOf(); 51 | 52 | expectTypeOf().not.toBeAny(); 53 | expectTypeOf().toEqualTypeOf(); 54 | 55 | expectTypeOf().not.toBeAny(); 56 | expectTypeOf().toEqualTypeOf(); 57 | }); 58 | -------------------------------------------------------------------------------- /tests/uni-list.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniListProps, UniList, UniListInstance } from '@/index'; 3 | 4 | describe('UniList', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-load-more.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniLoadMoreStatus, 4 | UniLoadMoreIconType, 5 | UniLoadMoreContentText, 6 | UniLoadMoreOnClickLoadMoreDetail, 7 | UniLoadMoreOnClickLoadMoreEvent, 8 | UniLoadMoreOnClickLoadMore, 9 | UniLoadMoreProps, 10 | UniLoadMore, 11 | UniLoadMoreInstance, 12 | } from '@/index'; 13 | 14 | describe('UniLoadMore', () => { 15 | expectTypeOf().toBeString(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeString(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeObject(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().toBeObject(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeObject(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeFunction(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeObject(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().not.toBeAny(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().not.toBeAny(); 40 | expectTypeOf().toEqualTypeOf(); 41 | }); 42 | -------------------------------------------------------------------------------- /tests/uni-nav-bar.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniNavBarProps, UniNavBar, UniNavBarInstance } from '@/index'; 3 | 4 | describe('UniNavBar', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-notice-bar.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniNoticeBarOnClick, 4 | UniNoticeBarOnClose, 5 | UniNoticeBarOnGetmore, 6 | UniNoticeBarProps, 7 | UniNoticeBar, 8 | UniNoticeBarInstance, 9 | } from '@/index'; 10 | 11 | describe('UniNoticeBar', () => { 12 | expectTypeOf().toBeFunction(); 13 | expectTypeOf().toEqualTypeOf(); 14 | 15 | expectTypeOf().toBeFunction(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeFunction(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeObject(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().not.toBeAny(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().not.toBeAny(); 28 | expectTypeOf().toEqualTypeOf(); 29 | }); 30 | -------------------------------------------------------------------------------- /tests/uni-number-box.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniNumberBoxValue, 4 | UniNumberBoxOnChange, 5 | UniNumberBoxOnInput, 6 | UniNumberBoxOnFocusEvent, 7 | UniNumberBoxOnFocus, 8 | UniNumberBoxOnBlurEvent, 9 | UniNumberBoxOnBlur, 10 | UniNumberBoxProps, 11 | UniNumberBox, 12 | UniNumberBoxInstance, 13 | } from '@/index'; 14 | 15 | describe('UniNumberBox', () => { 16 | expectTypeOf().toBeNumber(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeFunction(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().toBeFunction(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().toBeObject(); 32 | expectTypeOf().toEqualTypeOf(); 33 | 34 | expectTypeOf().toBeFunction(); 35 | expectTypeOf().toEqualTypeOf(); 36 | 37 | expectTypeOf().toBeObject(); 38 | expectTypeOf().toEqualTypeOf(); 39 | 40 | expectTypeOf().not.toBeAny(); 41 | expectTypeOf().toEqualTypeOf(); 42 | 43 | expectTypeOf().not.toBeAny(); 44 | expectTypeOf().toEqualTypeOf(); 45 | }); 46 | -------------------------------------------------------------------------------- /tests/uni-pagination.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniPaginationOnInput, 4 | UniPaginationOnChangeType, 5 | UniPaginationOnChangeEvent, 6 | UniPaginationOnChange, 7 | UniPaginationProps, 8 | UniPagination, 9 | UniPaginationInstance, 10 | } from '@/index'; 11 | 12 | describe('UniPagination', () => { 13 | expectTypeOf().toBeFunction(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeString(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeObject(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-popup-dialog.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniPopupDialogType, 4 | UniPopupDialogMode, 5 | UniPopupDialogValue, 6 | UniPopupDialogOnClose, 7 | UniPopupDialogOnConfirmEvent, 8 | UniPopupDialogOnConfirm, 9 | UniPopupDialogProps, 10 | UniPopupDialog, 11 | UniPopupDialogInstance, 12 | } from '@/index'; 13 | 14 | describe('UniPopupDialog', () => { 15 | expectTypeOf().toBeString(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeString(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toMatchTypeOf(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().toBeFunction(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeObject(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeFunction(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeObject(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().not.toBeAny(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().not.toBeAny(); 40 | expectTypeOf().toEqualTypeOf(); 41 | }); 42 | -------------------------------------------------------------------------------- /tests/uni-popup-message.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniPopupMessageType, 4 | UniPopupMessageProps, 5 | UniPopupMessage, 6 | UniPopupMessageInstance, 7 | } from '@/index'; 8 | 9 | describe('UniPopupMessage', () => { 10 | expectTypeOf().toBeString(); 11 | expectTypeOf().toEqualTypeOf(); 12 | 13 | expectTypeOf().toBeObject(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().not.toBeAny(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().not.toBeAny(); 20 | expectTypeOf().toEqualTypeOf(); 21 | }); 22 | -------------------------------------------------------------------------------- /tests/uni-popup-share.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniPopupShareOnSelectEvent, 4 | UniPopupShareOnSelect, 5 | UniPopupShareProps, 6 | UniPopupShare, 7 | UniPopupShareInstance, 8 | } from '@/index'; 9 | 10 | describe('UniPopupShare', () => { 11 | expectTypeOf().toBeObject(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-popup.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniPopupType, 4 | UniPopupOnChangeEvent, 5 | UniPopupOnChange, 6 | UniPopupOnMaskClick, 7 | UniPopupProps, 8 | UniPopup, 9 | UniPopupInstance, 10 | } from '@/index'; 11 | 12 | describe('UniPopup', () => { 13 | expectTypeOf().toBeString(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeObject(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeFunction(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-rate.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniRateValue, 4 | UniRateOnChangeEvent, 5 | UniRateOnChange, 6 | UniRateProps, 7 | UniRate, 8 | UniRateInstance, 9 | } from '@/index'; 10 | 11 | describe('UniRate', () => { 12 | expectTypeOf().toBeNumber(); 13 | expectTypeOf().toEqualTypeOf(); 14 | 15 | expectTypeOf().toBeObject(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeFunction(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeObject(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().not.toBeAny(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().not.toBeAny(); 28 | expectTypeOf().toEqualTypeOf(); 29 | }); 30 | -------------------------------------------------------------------------------- /tests/uni-row.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniRowJustify, UniRowAlign, UniRowProps, UniRow, UniRowInstance } from '@/index'; 3 | 4 | describe('UniRow', () => { 5 | expectTypeOf().toBeString(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().toBeString(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().toBeObject(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().not.toBeAny(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().not.toBeAny(); 18 | expectTypeOf().toEqualTypeOf(); 19 | }); 20 | -------------------------------------------------------------------------------- /tests/uni-search-bar.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniSearchBarValue, 4 | UniSearchBarClearButton, 5 | UniSearchBarCancelButton, 6 | UniSearchBarBaseEvent, 7 | UniSearchBarOnConfirmEvent, 8 | UniSearchBarOnConfirm, 9 | UniSearchBarOnInputEvent, 10 | UniSearchBarOnInput, 11 | UniSearchBarOnCancelEvent, 12 | UniSearchBarOnCancel, 13 | UniSearchBarOnClearEvent, 14 | UniSearchBarOnClear, 15 | UniSearchBarOnFocusEvent, 16 | UniSearchBarOnFocus, 17 | UniSearchBarOnBlurEvent, 18 | UniSearchBarOnBlur, 19 | UniSearchBarProps, 20 | UniSearchBar, 21 | UniSearchBarInstance, 22 | } from '@/index'; 23 | 24 | describe('UniSearchBar', () => { 25 | expectTypeOf().toMatchTypeOf(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().toBeString(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().toBeString(); 32 | expectTypeOf().toEqualTypeOf(); 33 | 34 | expectTypeOf().toBeObject(); 35 | expectTypeOf().toEqualTypeOf(); 36 | 37 | expectTypeOf().toBeObject(); 38 | expectTypeOf().toEqualTypeOf(); 39 | 40 | expectTypeOf().toBeObject(); 41 | expectTypeOf().toEqualTypeOf(); 42 | 43 | expectTypeOf().toBeObject(); 44 | expectTypeOf().toEqualTypeOf(); 45 | 46 | expectTypeOf().toBeObject(); 47 | expectTypeOf().toEqualTypeOf(); 48 | 49 | expectTypeOf().toBeObject(); 50 | expectTypeOf().toEqualTypeOf(); 51 | 52 | expectTypeOf().toBeObject(); 53 | expectTypeOf().toEqualTypeOf(); 54 | 55 | expectTypeOf().toBeObject(); 56 | expectTypeOf().toEqualTypeOf(); 57 | 58 | expectTypeOf().toBeObject(); 59 | expectTypeOf().toEqualTypeOf(); 60 | 61 | expectTypeOf().toBeObject(); 62 | expectTypeOf().toEqualTypeOf(); 63 | 64 | expectTypeOf().toBeObject(); 65 | expectTypeOf().toEqualTypeOf(); 66 | 67 | expectTypeOf().toBeObject(); 68 | expectTypeOf().toEqualTypeOf(); 69 | 70 | expectTypeOf().toBeObject(); 71 | expectTypeOf().toEqualTypeOf(); 72 | 73 | expectTypeOf().toBeObject(); 74 | expectTypeOf().toEqualTypeOf(); 75 | 76 | expectTypeOf().not.toBeAny(); 77 | expectTypeOf().toEqualTypeOf(); 78 | 79 | expectTypeOf().not.toBeAny(); 80 | expectTypeOf().toEqualTypeOf(); 81 | }); 82 | -------------------------------------------------------------------------------- /tests/uni-section.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniSectionType, 4 | UniSectionOnClick, 5 | UniSectionProps, 6 | UniSection, 7 | UniSectionInstance, 8 | } from '@/index'; 9 | 10 | describe('UniSection', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-segmented-control.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniSegmentedControlCurrent, 4 | UniSegmentedControlStyleType, 5 | UniSegmentedControlOnClickItemEvent, 6 | UniSegmentedControlOnClickItem, 7 | UniSegmentedControlProps, 8 | UniSegmentedControl, 9 | UniSegmentedControlInstance, 10 | } from '@/index'; 11 | 12 | describe('UniSegmentedControl', () => { 13 | expectTypeOf().toBeNumber(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeString(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeObject(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-steps.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniStepsDirection, 4 | UniStepsOption, 5 | UniStepsProps, 6 | UniSteps, 7 | UniStepsInstance, 8 | } from '@/index'; 9 | 10 | describe('UniSteps', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeObject(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-swipe-action-item.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniSwipeActionItemShow, 4 | UniSwipeActionItemOption, 5 | UniSwipeActionItemOnClickEventPosition, 6 | UniSwipeActionItemOnClickEvent, 7 | UniSwipeActionItemOnClick, 8 | UniSwipeActionItemOnChange, 9 | UniSwipeActionItemProps, 10 | UniSwipeActionItem, 11 | UniSwipeActionItemInstance, 12 | } from '@/index'; 13 | 14 | describe('UniSwipeActionItem', () => { 15 | expectTypeOf().toBeString(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeObject(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeString(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().toBeObject(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().toBeFunction(); 28 | expectTypeOf().toEqualTypeOf(); 29 | 30 | expectTypeOf().toBeObject(); 31 | expectTypeOf().toEqualTypeOf(); 32 | 33 | expectTypeOf().toBeObject(); 34 | expectTypeOf().toEqualTypeOf(); 35 | 36 | expectTypeOf().not.toBeAny(); 37 | expectTypeOf().toEqualTypeOf(); 38 | 39 | expectTypeOf().not.toBeAny(); 40 | expectTypeOf().toEqualTypeOf(); 41 | }); 42 | -------------------------------------------------------------------------------- /tests/uni-swipe-action.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniSwipeActionResize, 4 | UniSwipeActionCloseAll, 5 | UniSwipeActionProps, 6 | UniSwipeAction, 7 | UniSwipeActionInstance, 8 | } from '@/index'; 9 | 10 | describe('UniSwipeAction', () => { 11 | expectTypeOf().toBeFunction(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeFunction(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-swiper-dot.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniSwiperDotMode, 4 | UniSwiperDotDotsStyles, 5 | UniSwiperDotOnClickItem, 6 | UniSwiperDotProps, 7 | UniSwiperDot, 8 | UniSwiperDotInstance, 9 | } from '@/index'; 10 | 11 | describe('UniSwiperDot', () => { 12 | expectTypeOf().toBeString(); 13 | expectTypeOf().toEqualTypeOf(); 14 | 15 | expectTypeOf().toBeObject(); 16 | expectTypeOf().toEqualTypeOf(); 17 | 18 | expectTypeOf().toBeFunction(); 19 | expectTypeOf().toEqualTypeOf(); 20 | 21 | expectTypeOf().toBeObject(); 22 | expectTypeOf().toEqualTypeOf(); 23 | 24 | expectTypeOf().not.toBeAny(); 25 | expectTypeOf().toEqualTypeOf(); 26 | 27 | expectTypeOf().not.toBeAny(); 28 | expectTypeOf().toEqualTypeOf(); 29 | }); 30 | -------------------------------------------------------------------------------- /tests/uni-table.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniTableType, 4 | UniTableSelectionAll, 5 | UniTableToggleRowSelection, 6 | UniTableClearSelection, 7 | UniTableToggleAllSelection, 8 | UniTableOnSelectionChangeDetail, 9 | UniTableOnSelectionChangeEvent, 10 | UniTableOnSelectionChange, 11 | UniTableProps, 12 | UniTable, 13 | UniTableInstance, 14 | } from '@/index'; 15 | 16 | describe('UniTable', () => { 17 | expectTypeOf().toBeString(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().toBeFunction(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().toBeFunction(); 24 | expectTypeOf().toEqualTypeOf(); 25 | 26 | expectTypeOf().toBeFunction(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeFunction(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().toBeObject(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().toBeObject(); 36 | expectTypeOf().toEqualTypeOf(); 37 | 38 | expectTypeOf().toBeFunction(); 39 | expectTypeOf().toEqualTypeOf(); 40 | 41 | expectTypeOf().toBeObject(); 42 | expectTypeOf().toEqualTypeOf(); 43 | 44 | expectTypeOf().not.toBeAny(); 45 | expectTypeOf().toEqualTypeOf(); 46 | 47 | expectTypeOf().not.toBeAny(); 48 | expectTypeOf().toEqualTypeOf(); 49 | }); 50 | -------------------------------------------------------------------------------- /tests/uni-tag.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniTagType, 4 | UniTagSize, 5 | UniTagCustomStyle, 6 | UniTagOnClick, 7 | UniTagProps, 8 | UniTag, 9 | UniTagInstance, 10 | } from '@/index'; 11 | 12 | describe('UniTag', () => { 13 | expectTypeOf().toBeString(); 14 | expectTypeOf().toEqualTypeOf(); 15 | 16 | expectTypeOf().toBeString(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeString(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeFunction(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().not.toBeAny(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().not.toBeAny(); 32 | expectTypeOf().toEqualTypeOf(); 33 | }); 34 | -------------------------------------------------------------------------------- /tests/uni-td.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniTdAlign, UniTdProps, UniTd, UniTdInstance } from '@/index'; 3 | 4 | describe('UniTd', () => { 5 | expectTypeOf().toBeString(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().toBeObject(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().not.toBeAny(); 15 | expectTypeOf().toEqualTypeOf(); 16 | }); 17 | -------------------------------------------------------------------------------- /tests/uni-th.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniThAlign, 4 | UniThFilterType, 5 | UniThFilterData, 6 | UniThOnSortChangeEvent, 7 | UniThOnSortChange, 8 | UniThOnFilterChangeEvent, 9 | UniThOnFilterChange, 10 | UniThProps, 11 | UniTh, 12 | UniThInstance, 13 | } from '@/index'; 14 | 15 | describe('UniTh', () => { 16 | expectTypeOf().toBeString(); 17 | expectTypeOf().toEqualTypeOf(); 18 | 19 | expectTypeOf().toBeString(); 20 | expectTypeOf().toEqualTypeOf(); 21 | 22 | expectTypeOf().toBeObject(); 23 | expectTypeOf().toEqualTypeOf(); 24 | 25 | expectTypeOf().toBeObject(); 26 | expectTypeOf().toEqualTypeOf(); 27 | 28 | expectTypeOf().toBeFunction(); 29 | expectTypeOf().toEqualTypeOf(); 30 | 31 | expectTypeOf().toBeObject(); 32 | expectTypeOf().toEqualTypeOf(); 33 | 34 | expectTypeOf().toBeFunction(); 35 | expectTypeOf().toEqualTypeOf(); 36 | 37 | expectTypeOf().toBeObject(); 38 | expectTypeOf().toEqualTypeOf(); 39 | 40 | expectTypeOf().not.toBeAny(); 41 | expectTypeOf().toEqualTypeOf(); 42 | 43 | expectTypeOf().not.toBeAny(); 44 | expectTypeOf().toEqualTypeOf(); 45 | }); 46 | -------------------------------------------------------------------------------- /tests/uni-title.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniTitleType, 4 | UniTitleAlign, 5 | UniTitleProps, 6 | UniTitle, 7 | UniTitleInstance, 8 | } from '@/index'; 9 | 10 | describe('UniTitle', () => { 11 | expectTypeOf().toBeString(); 12 | expectTypeOf().toEqualTypeOf(); 13 | 14 | expectTypeOf().toBeString(); 15 | expectTypeOf().toEqualTypeOf(); 16 | 17 | expectTypeOf().toBeObject(); 18 | expectTypeOf().toEqualTypeOf(); 19 | 20 | expectTypeOf().not.toBeAny(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().not.toBeAny(); 24 | expectTypeOf().toEqualTypeOf(); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/uni-tooltip.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniTooltipProps, UniTooltip, UniTooltipInstance } from '@/index'; 3 | 4 | describe('UniTooltip', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-tr.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { UniTrProps, UniTr, UniTrInstance } from '@/index'; 3 | 4 | describe('UniTr', () => { 5 | expectTypeOf().toBeObject(); 6 | expectTypeOf().toEqualTypeOf(); 7 | 8 | expectTypeOf().not.toBeAny(); 9 | expectTypeOf().toEqualTypeOf(); 10 | 11 | expectTypeOf().not.toBeAny(); 12 | expectTypeOf().toEqualTypeOf(); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/uni-transition.test-d.ts: -------------------------------------------------------------------------------- 1 | import { describe, expectTypeOf } from 'vitest'; 2 | import type { 3 | UniTransitionModeClass, 4 | UniTransitionTimingFunction, 5 | UniTransitionConfig, 6 | UniTransitionType, 7 | UniTransitionInit, 8 | UniTransitionStep, 9 | UniTransitionRun, 10 | UniTransitionOnClickEvent, 11 | UniTransitionOnClick, 12 | UniTransitionOnChangeEvent, 13 | UniTransitionOnChange, 14 | UniTransitionProps, 15 | UniTransition, 16 | UniTransitionInstance, 17 | } from '@/index'; 18 | 19 | describe('UniTransition', () => { 20 | expectTypeOf().toBeString(); 21 | expectTypeOf().toEqualTypeOf(); 22 | 23 | expectTypeOf().toBeString(); 24 | expectTypeOf().toEqualTypeOf(); 25 | 26 | expectTypeOf().toBeObject(); 27 | expectTypeOf().toEqualTypeOf(); 28 | 29 | expectTypeOf().toBeObject(); 30 | expectTypeOf().toEqualTypeOf(); 31 | 32 | expectTypeOf().toBeFunction(); 33 | expectTypeOf().toEqualTypeOf(); 34 | 35 | expectTypeOf().toBeFunction(); 36 | expectTypeOf().toEqualTypeOf(); 37 | 38 | expectTypeOf().toBeFunction(); 39 | expectTypeOf().toEqualTypeOf(); 40 | 41 | expectTypeOf().toBeObject(); 42 | expectTypeOf().toEqualTypeOf(); 43 | 44 | expectTypeOf().toBeFunction(); 45 | expectTypeOf().toEqualTypeOf(); 46 | 47 | expectTypeOf().toBeObject(); 48 | expectTypeOf().toEqualTypeOf(); 49 | 50 | expectTypeOf().toBeFunction(); 51 | expectTypeOf().toEqualTypeOf(); 52 | 53 | expectTypeOf().toBeObject(); 54 | expectTypeOf().toEqualTypeOf(); 55 | 56 | expectTypeOf().not.toBeAny(); 57 | expectTypeOf().toEqualTypeOf(); 58 | 59 | expectTypeOf().not.toBeAny(); 60 | expectTypeOf().toEqualTypeOf(); 61 | }); 62 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node20", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "lib": ["DOM", "ESNext"], 6 | "module": "ESNext", 7 | "moduleResolution": "Bundler", 8 | "target": "ESNext", 9 | "resolveJsonModule": true, 10 | "paths": { 11 | "@/*": ["./src/*"] 12 | }, 13 | "types": ["@dcloudio/types", "node"] 14 | }, 15 | "include": [ 16 | "**/*.js", 17 | "**/*.cjs", 18 | "**/*.mjs", 19 | "**/*.ts", 20 | "**/*.cts", 21 | "**/*.mts" 22 | ], 23 | "exclude": ["**/node_modules", "**/dist", "playground"] 24 | } 25 | -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'node:url'; 2 | import { defineConfig } from 'vitest/config'; 3 | 4 | export default defineConfig({ 5 | resolve: { 6 | alias: { 7 | '@': fileURLToPath(new URL('src', import.meta.url)), 8 | }, 9 | }, 10 | }); 11 | --------------------------------------------------------------------------------