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:
@@ -87,6 +87,23 @@ export {
|
||||
|
||||
// Types -----------------------------------------------------------------------
|
||||
|
||||
import { VNode } from './vnode'
|
||||
import { ComponentInternalInstance } from './component'
|
||||
|
||||
// Augment Ref unwrap bail types.
|
||||
// Note: if updating this, also update `types/refBail.d.ts`.
|
||||
declare module '@vue/reactivity' {
|
||||
export interface RefUnwrapBailTypes {
|
||||
runtimeCoreBailTypes:
|
||||
| VNode
|
||||
| {
|
||||
// directly bailing on ComponentPublicInstance results in recursion
|
||||
// so we use this as a bail hint
|
||||
$: ComponentInternalInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
ReactiveEffect,
|
||||
ReactiveEffectOptions,
|
||||
|
||||
14
packages/runtime-core/types/refBail.d.ts
vendored
Normal file
14
packages/runtime-core/types/refBail.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
||||
// build.
|
||||
|
||||
declare module '@vue/reactivity' {
|
||||
export interface RefUnwrapBailTypes {
|
||||
runtimeCoreBailTypes:
|
||||
| VNode
|
||||
| {
|
||||
// directly bailing on ComponentPublicInstance results in recursion
|
||||
// so we use this as a bail hint
|
||||
$: ComponentInternalInstance
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user