├── .eslintignore ├── .eslintrc ├── .github └── workflows │ └── unit-test.yml ├── .gitignore ├── .npmrc ├── README.md ├── package.json ├── playground ├── index.html ├── package.json ├── public │ └── icon.svg ├── src │ ├── App.vue │ ├── auto-imports.d.ts │ ├── button-types.ts │ ├── components.d.ts │ ├── components │ │ └── Button.vue │ ├── main.ts │ ├── other-types.ts │ ├── test.ts │ └── typings │ │ └── index.ts ├── tsconfig.json └── vite.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── src ├── core │ ├── ast.ts │ ├── constants.ts │ ├── index.ts │ └── utils.ts ├── index.ts ├── nuxt.ts └── vite.ts ├── test ├── __snapshots__ │ ├── common.test.ts.snap │ └── dynamic.test.ts.snap ├── _presets.ts ├── _utils.ts ├── common.test.ts ├── dynamic.test.ts └── fixtures │ ├── common │ ├── duplicate-imports │ │ ├── export-aliases │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ ├── multi-level.ts │ │ │ └── types │ │ │ │ ├── 1.ts │ │ │ │ ├── 2.ts │ │ │ │ ├── 3.ts │ │ │ │ └── 4.ts │ │ ├── import-aliases │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ ├── multi-level.ts │ │ │ └── types │ │ │ │ ├── 1.ts │ │ │ │ ├── 2.ts │ │ │ │ └── 3.ts │ │ └── import-export-default │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ ├── multi-level.ts │ │ │ └── types │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ ├── 3.ts │ │ │ └── 4.ts │ ├── enum-types │ │ └── default │ │ │ ├── empty.ts │ │ │ ├── mixed.ts │ │ │ ├── number.ts │ │ │ └── string.ts │ ├── export-aliases │ │ ├── default │ │ │ ├── _types.ts │ │ │ └── index.ts │ │ └── multi-level │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ └── types │ │ │ └── 1.ts │ ├── export-all │ │ └── default │ │ │ ├── index.ts │ │ │ └── types │ │ │ ├── 1.ts │ │ │ └── 2.ts │ ├── import-aliases │ │ ├── default │ │ │ ├── _types.ts │ │ │ └── index.ts │ │ └── multi-level │ │ │ ├── _type_A.ts │ │ │ ├── _type_B.ts │ │ │ └── index.ts │ ├── import-export-default │ │ ├── default │ │ │ ├── 1.ts │ │ │ └── _types.ts │ │ ├── multi-level │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ └── types │ │ │ │ ├── 1.ts │ │ │ │ ├── 2.ts │ │ │ │ └── 3.ts │ │ └── use-aliases │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ ├── 3.ts │ │ │ └── types │ │ │ ├── alias.ts │ │ │ └── default.ts │ ├── import-same-type-implicitly │ │ └── default │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ └── types │ │ │ ├── 1.ts │ │ │ └── 2.ts │ ├── interface-extends-interface │ │ ├── has-reference │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ └── 3.ts │ │ └── no-reference │ │ │ └── index.ts │ ├── interface-without-reference │ │ └── default │ │ │ └── index.ts │ ├── mixed-aliases │ │ └── default │ │ │ ├── index.ts │ │ │ └── types │ │ │ ├── 1.ts │ │ │ └── 2.ts │ ├── multi-level-reference │ │ └── default │ │ │ ├── 1.ts │ │ │ └── 2.ts │ ├── redeclaration-of-types │ │ ├── default │ │ │ └── index.ts │ │ └── same-name │ │ │ ├── _type.ts │ │ │ └── index.ts │ ├── reference-in-property │ │ └── default │ │ │ └── index.ts │ └── strict-type-finding │ │ └── default │ │ ├── _types.ts │ │ └── index.ts │ └── dynamic │ ├── enum-types │ └── default │ │ ├── _types.ts │ │ ├── index.vue │ │ └── local.vue │ ├── import-priority │ ├── preferred-dts │ │ ├── _types.d.ts │ │ └── index.vue │ ├── preferred-ts │ │ ├── _types.d.ts │ │ ├── _types.ts │ │ ├── _types.tsx │ │ └── index.vue │ └── preferred-tsx │ │ ├── _types.d.ts │ │ ├── _types.tsx │ │ └── index.vue │ ├── interface-extends-interface │ ├── has-reference │ │ ├── 1.vue │ │ ├── 2.vue │ │ ├── 3.vue │ │ ├── external_1.vue │ │ ├── external_2.vue │ │ ├── external_3.vue │ │ └── externals │ │ │ ├── 1.ts │ │ │ ├── 2.ts │ │ │ └── 3.ts │ └── no-reference │ │ ├── index.ts │ │ ├── index.vue │ │ └── internal.vue │ ├── interface-without-reference │ └── no-transform │ │ └── index.vue │ ├── multi-level-reference │ └── default │ │ ├── 1.vue │ │ └── 2.vue │ └── tsx │ ├── import-tsx │ ├── _types.tsx │ └── index.vue │ └── lang-tsx │ └── index.vue ├── tsconfig.json ├── tsconfig.test.json ├── tsup.config.ts └── vitest.config.ts /.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | .d.ts 4 | coverage 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | }, 5 | "extends": ["@antfu"], 6 | "rules": { 7 | "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], 8 | "no-restricted-imports": [ 9 | "error", 10 | { 11 | "paths": ["vql"] 12 | } 13 | ] 14 | }, 15 | "overrides": [ 16 | { 17 | "files": [ 18 | "playground/**/*.*" 19 | ], 20 | "rules": { 21 | "no-restricted-imports": "off" 22 | } 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /.github/workflows/unit-test.yml: -------------------------------------------------------------------------------- 1 | name: Unit Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | pull_request: 9 | branches: 10 | - main 11 | 12 | env: 13 | VITEST_SEGFAULT_RETRY: 3 14 | 15 | jobs: 16 | lint: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v3 20 | 21 | - name: Setup node 16.x 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: 16.x 25 | 26 | - name: Setup ni 27 | run: npm i -g @antfu/ni 28 | 29 | - name: Install 30 | run: nci 31 | 32 | - name: Lint 33 | run: nr lint 34 | 35 | typecheck: 36 | runs-on: ubuntu-latest 37 | steps: 38 | - uses: actions/checkout@v3 39 | 40 | - name: Setup node 16.x 41 | uses: actions/setup-node@v3 42 | with: 43 | node-version: 16.x 44 | 45 | - name: Setup ni 46 | run: npm i -g @antfu/ni 47 | 48 | - name: Install 49 | run: nci 50 | 51 | - name: Type Check 52 | run: nr typecheck 53 | 54 | test: 55 | strategy: 56 | matrix: 57 | version: [14.x, 16.x] 58 | os: [ubuntu-latest, windows-latest, macos-latest] 59 | fail-fast: false 60 | 61 | runs-on: ${{ matrix.os }} 62 | steps: 63 | - uses: actions/checkout@v3 64 | 65 | - name: Setup node ${{ matrix.version }} 66 | uses: actions/setup-node@v3 67 | with: 68 | node-version: ${{ matrix.version }} 69 | 70 | - name: Setup ni 71 | run: npm i -g @antfu/ni 72 | 73 | - name: Install 74 | run: nci 75 | 76 | - name: Build 77 | run: nr build 78 | 79 | - name: Unit Test 80 | run: nr test:ci 81 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | coverage 5 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | ignore-workspace-root-check=true 2 | shamefully-hoist=true -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
4 | Enables you to import types and use them in your defineProps
and defineEmits
. Supports both Vue 2 and Vue 3.
5 |