import type { PropType as VuePropType } from 'vue';
/**
 * 定义全局类型
 */


declare global {

    // 可选的自定义泛型
    declare type Recordable<T = any> = Record<string, T>;

    declare type Nullable<T> = T | null;

    declare type TargetContext = '_self' | '_blank';

    declare type EmitType = (event: string, ...args: any[]) => void;

    declare interface Fn<T = any, R = T> {
        (...arg: T[]): R;
    }

    // vue
    declare type PropType<T> = VuePropType<T>;

    namespace JSX {
        // tslint:disable no-empty-interface
        type Element = VNode;
        // tslint:disable no-empty-interface
        type ElementClass = ComponentRenderProxy;
        interface ElementAttributesProperty {
            $props: any;
        }
        interface IntrinsicElements {
            [elem: string]: any;
        }
        interface IntrinsicAttributes {
            [elem: string]: any;
        }
    }
    declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
    declare type TimeoutHandle = ReturnType<typeof setTimeout>;
}
declare module 'vue' {
    export type JSXComponent<Props = any> =
        | { new(): ComponentPublicInstance<Props> }
        | FunctionalComponent<Props>;
}
