types: ComponentInstance (#8154)

This commit is contained in:
neverland
2021-02-14 17:07:26 +08:00
committed by GitHub
parent 0fb0186fad
commit 4cb974ab02
8 changed files with 40 additions and 41 deletions
+3 -2
View File
@@ -1,6 +1,5 @@
import { PropType } from 'vue';
import { PropType, ComponentPublicInstance } from 'vue';
// eslint-disable-next-line @typescript-eslint/no-empty-function
export function noop() {}
export const inBrowser = typeof window !== 'undefined';
@@ -8,6 +7,8 @@ export const inBrowser = typeof window !== 'undefined';
// unknown type for Vue prop
export const UnknownProp = (null as unknown) as PropType<unknown>;
export type ComponentInstance = ComponentPublicInstance<any>;
export function isDef<T>(val: T): val is NonNullable<T> {
return val !== undefined && val !== null;
}