Skip to content

Commit 136dfdf

Browse files
committed
feat(types): emit GlobalDirectives
closes #21475
1 parent f9288ad commit 136dfdf

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/vuetify/build/rollup.types.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,14 @@ async function getShims (useImport) {
7676
.map(name => ` ${name}: ${name}`).join('\n')
7777
}
7878

79+
const directives = importMap.directives.map(name => (
80+
` v${name}: typeof import('vuetify/directives')['${name}']`
81+
)).join('\n')
82+
7983
return (await fs.readFile(fileURLToPath(new URL('../src/shims.d.ts', import.meta.url)), { encoding: 'utf8' }))
8084
.replaceAll(/^\s*\/\/ @skip-build\s[\s\S]*?\s$/gm, '')
8185
.replace(/^\s*\/\/ @generate-components$/gm, components)
86+
.replace(/^\s*\/\/ @generate-directives$/gm, directives)
8287
}
8388

8489
/** @type {import("rollup").RollupOptions[]} */

packages/vuetify/src/shims.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ declare module 'vue' {
4545
export interface GlobalComponents {
4646
// @generate-components
4747
}
48+
export interface GlobalDirectives {
49+
// @generate-directives
50+
}
4851
}

0 commit comments

Comments
 (0)