forked from EddieUp/antd-table-saveas-excel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.d.ts
113 lines (112 loc) · 2.38 KB
/
app.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// 表格列属性
export interface IExcelColumn {
title: any;
dataIndex: string | string[];
width?: number;
children?: IExcelColumn[];
align?: 'left' | 'right' | 'center';
colSpan?: number;
render?: (text: any, record: any, index: number) => React.ReactNode | object;
excelRender?: (
text: any,
record: any,
index: number,
) => string | object;
__style__?: IStyle;
__numFmt__?: INumFmt;
__cellType__?: ICellType;
__excelTitle__?: string;
}
// 单元格属性
export interface ICellProps {
value: string;
hMerge?: number;
vMerge?: number;
cellType?: ICellType;
numFmt?: INumFmt;
formula?: string;
style?: IStyle;
}
export interface ITbodyConfig {
// 字符串能转化成数字就转化成数字
str2num?: boolean;
// 内容结尾为%符号的是否自动转换为对应百分比格式
str2Percent?: boolean;
}
export interface IDataSource extends Object {
__style__?: IStyle;
__numFmt__?: INumFmt;
__cellType__?: ICellType;
[key: string]: any;
}
export type IStyle = {
height?: number;
width?: number;
border?: boolean;
borderColor?: string;
background?: string;
fontSize?: number;
fontName?: string;
color?: string;
bold?: boolean;
i?: boolean;
u?: boolean;
h?: IHorizontal;
indent?: number;
shrinkToFit?: boolean;
textRotation?: number;
v?: IVertical;
wrapText?: boolean;
};
export type IHorizontal = 'general' | 'center' | 'left' | 'right';
export type IVertical = 'general' | 'top' | 'bottom' | 'center';
export type ICellType =
| 'TypeString'
| 'TypeBool'
| 'TypeNumeric'
| 'TypeDate'
| 'TypeFormula'
| 'TypeError'
| 'TypeGeneral';
export type INumFmt =
| 'general'
| '0'
| '0.0'
| '0.00'
| '0.000'
| '0.0000'
| '#,##0'
| '#,##0.0'
| '#,##0.00'
| '#,##0.000'
| '#,##0.0000'
| '0%'
| '0.0%'
| '0.00%'
| '0.000%'
| '0.0000%'
| '0.00e+00'
| '# ?/?'
| '# ??/??'
| 'mm-dd-yy'
| 'd-mmm-yy'
| 'd-mmm'
| 'mmm-yy'
| 'h:mm am/pm'
| 'h:mm:ss am/pm'
| 'h:mm'
| 'h:mm:ss'
| 'm/d/yy h:mm'
| '#,##0 ;(#,##0)'
| '#,##0 ;[red](#,##0)'
| '#,##0.00;(#,##0.00)'
| '#,##0.00;[red](#,##0.00)'
| '_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)'
| '_("$"* #,##0_);_("$* (#,##0);_("$"* "-"_);_(@_)'
| '_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'
| '_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)'
| 'mm:ss'
| '[h]:mm:ss'
| 'mmss.0'
| '##0.0e+0'
| '@';