fix(types): augment ref unwrap bail types in appropriate packages
Packages can now augment the ref unwrap bail types in their own `d.ts`. Also updated the build script to auto concat any files in a package's `types` directory to the final generated `d.ts`. - `@vue/reactivity` should no longer require `libs: ["DOM"]` in tsconfig - Properly bail on `VNode` and `ComponentPublicInstance` in runtime-core
This commit is contained in:
@@ -18,9 +18,6 @@
|
||||
"esm-browser",
|
||||
"cjs",
|
||||
"global"
|
||||
],
|
||||
"dts": [
|
||||
"jsx.d.ts"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@@ -14,6 +14,13 @@ import { patchProp } from './patchProp'
|
||||
// Importing from the compiler, will be tree-shaken in prod
|
||||
import { isFunction, isString, isHTMLTag, isSVGTag } from '@vue/shared'
|
||||
|
||||
declare module '@vue/reactivity' {
|
||||
export interface RefUnwrapBailTypes {
|
||||
// Note: if updating this, also update `types/refBail.d.ts`.
|
||||
runtimeDOMBailTypes: Node | Window
|
||||
}
|
||||
}
|
||||
|
||||
const rendererOptions = {
|
||||
patchProp,
|
||||
...nodeOps
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
||||
// build.
|
||||
|
||||
import { Ref, ComponentPublicInstance } from '@vue/runtime-core'
|
||||
|
||||
// This code is based on react definition in DefinitelyTyped published under the MIT license.
|
||||
8
packages/runtime-dom/types/refBail.d.ts
vendored
Normal file
8
packages/runtime-dom/types/refBail.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
||||
// build.
|
||||
|
||||
declare module '@vue/reactivity' {
|
||||
export interface RefUnwrapBailTypes {
|
||||
runtimeDOMBailTypes: Node | Window
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user