forked from Tencent/tdesign-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.ts
More file actions
52 lines (37 loc) · 1.54 KB
/
common.ts
File metadata and controls
52 lines (37 loc) · 1.54 KB
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
/** Vue2 特有全局类型 */
export type TNodeReturnValue = import('vue/types/vnode').ScopedSlotReturnValue;
export type TNode<T = undefined> = T extends undefined
? (h: Vue.CreateElement) => TNodeReturnValue
: (h: Vue.CreateElement, props: T) => TNodeReturnValue;
export type JsxNode = TNodeReturnValue;
export type AttachNodeReturnValue = HTMLElement | Element | Document;
export type AttachNode = CSSSelector | ((triggerNode?: HTMLElement) => AttachNodeReturnValue);
// 与滚动相关的容器类型,因为 document 上没有 scroll 相关属性, 因此排除 document
export type ScrollContainerElement = Window | HTMLElement;
export type ScrollContainer = (() => ScrollContainerElement) | CSSSelector;
export type FormResetEvent = Event;
// export type FormSubmitEvent = SubmitEvent; (for higher typescript version)
export type FormSubmitEvent = Event;
export interface Styles {
[css: string]: string | number;
}
/** 通用全局类型 */
export type OptionData = {
label?: string;
value?: string | number;
} & { [key: string]: any };
export type TreeOptionData = {
children?: Array<TreeOptionData>;
} & OptionData;
export type SizeEnum = 'small' | 'medium' | 'large';
export type HorizontalAlignEnum = 'left' | 'center' | 'right';
export type VerticalAlignEnum = 'top' | 'middle' | 'bottom';
export type ClassName = { [className: string]: any } | ClassName[] | string;
export type CSSSelector = string;
export interface KeysType {
value?: string;
label?: string;
}
export interface HTMLElementAttributes {
[css: string]: string;
}