diff --git a/packages/runtime-dom/src/index.ts b/packages/runtime-dom/src/index.ts index 344cbf37584..64bfacef22f 100644 --- a/packages/runtime-dom/src/index.ts +++ b/packages/runtime-dom/src/index.ts @@ -33,9 +33,17 @@ import type { vShow } from './directives/vShow' import type { VOnDirective } from './directives/vOn' import type { VModelDirective } from './directives/vModel' +/** + * This is a stub implementation to prevent the need to use dom types. + * + * To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`. + */ +type DomStub = {} +type DomType = typeof globalThis extends { window: unknown } ? T : DomStub + declare module '@vue/reactivity' { export interface RefUnwrapBailTypes { - runtimeDOMBailTypes: Node | Window + runtimeDOMBailTypes: DomType } }