-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.d.ts
85 lines (75 loc) · 2.23 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// GlobalComponents for Volar
import type {
ComponentPublicInstance,
ComputedRef,
FunctionalComponent,
Ref,
VNode,
VNodeChild,
} from 'vue';
import type { PropType as VuePropType } from '@vue/runtime-core';
declare module '@vue/runtime-core' {
export interface GlobalComponents {
// ElAffix: typeof import('p-helper')['ElAffix']
TestComponent: typeof import('@p-helper/components')['TestComponent'];
PWaterfall: typeof import('@p-helper/components')['PWaterfall'];
}
// interface ComponentCustomProperties {
// // $message: typeof import('p-helper')['ElMessage']
// }
}
declare global {
type Nullable<T> = T | null;
// export type NonNullable<T> = T extends null | undefined ? never : T;
type Recordable<T = any> = Record<string, T>;
type EmitType = (...args: any[]) => any;
export interface Fn<T = any, R = T> {
(...arg: T[]): R;
}
type ReadonlyRecordable<T = any> = {
readonly [key: string]: T;
};
type Indexable<T = any> = {
[key: string]: T;
};
type DeepPartial<T> = {
[P in keyof T]?: DeepPartial<T[P]>;
};
type TimeoutHandle = ReturnType<typeof setTimeout>;
type IntervalHandle = ReturnType<typeof setInterval>;
interface ChangeEvent extends Event {
target: HTMLInputElement;
}
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
type LabelValueOptions = {
label: string;
value?: any;
[key: string]: string | number | boolean;
}[];
interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
$el: T;
}
type ComponentRef<T extends HTMLElement = HTMLDivElement> =
ComponentElRef<T> | null;
type TargetContext = '_self' | '_blank';
interface WheelEvent {
path?: EventTarget[];
}
function parseInt(s: string | number, radix?: number): number;
function parseFloat(string: string | number): number;
type DynamicProps<T> = {
[P in keyof T]: Ref<T[P]> | T[P] | ComputedRef<T[P]>;
};
// vue
type PropType<T> = VuePropType<T>;
type VueNode = VNodeChild | JSX.Element;
interface PromiseFn<T = any, R = T> {
(...arg: T[]): Promise<R>;
}
}
declare module 'vue' {
export type JSXComponent<Props = any> =
| { new (): ComponentPublicInstance<Props> }
| FunctionalComponent<Props>;
}
export {};