-
Notifications
You must be signed in to change notification settings - Fork 183
/
index.d.ts
137 lines (113 loc) · 3.28 KB
/
index.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* index.d.ts (C) react-data-export */
// TypeScript Version: 2.2
declare module 'react-data-export' {
import * as React from 'react'
export interface ExcelFileProps {
filename?: string;
fileExtension?: string;
element?: any; //Download Element
children?: Array<React.ReactChild> | React.ReactChild; // Array<ExcelSheetProps>;
}
export interface ExcelSheetProps {
name: string;
data?: Array<object>;
dataSet?: Array<ExcelSheetData>;
value?: Array<string> | Function;
children?: Array<React.ReactChild> | React.ReactChild; // Array<ExcelColumnProps>
}
export interface ExcelSheetData {
xSteps?: number;
ySteps?: number;
columns: Array<string>;
data: Array<ExcelCellData>;
}
export type ExcelCellData = ExcelValue | ExcelCell | Array<ExcelValue>;
export type ExcelValue = string | number | Date | boolean;
export interface ExcelCell {
value: ExcelCell;
style: ExcelStyle;
}
export interface ExcelColumnProps {
label: string;
value: number | boolean | string | Function;
}
export interface ExcelStyle {
fill?: ExcelCellFillType;
font?: ExcelFont;
numFmt?: ExcelNumFormat;
alignment?: ExcelAlignment;
border?: ExcelBorder;
}
/* ExcelCell Fill Type */
export type ExcelCellPatternType = "solid" | "none";
export interface ExcelColorSpec {
auto?: number; //default 1
rgb?: string; //hex ARGB color
theme?: ExcelTheme;
indexed?: number;
}
export interface ExcelTheme {
theme: string;
tint: string;
}
export interface ExcelCellFillType {
patternType?: ExcelCellPatternType;
fgColor?: ExcelColorSpec;
bgColor?: ExcelColorSpec;
}
/* Excel Font */
export interface ExcelFont {
name?: string; // default `"Calibri"`
sz?: number; //font size in points default 11
color?: ExcelColorSpec;
bold?: boolean;
underline?: boolean;
italic?: boolean;
strike?: boolean;
outline?: boolean;
shadow?: boolean;
vertAlign?: boolean;
}
/* ExcelNumFormat */
export type ExcelNumFormat = "0" | "0.00%" | "0.0%" | "0.00%;\\(0.00%\\);\\-;@" | "m/dd/yy" | string;
/* ExcelAlignment */
export interface ExcelAlignment {
vertical?: ExcelAlignmentType;
horizontal?: ExcelAlignmentType;
wrapText?: boolean;
readingOrder?: ExcelReadingOrder;
textRotation?: ExcelTextRotation;
}
export type ExcelTextRotation = 0 | 45 | 90 | 135 | 180 | 255;
export enum ExcelReadingOrder { LeftToRight = 1, RightToLeft}
export type ExcelAlignmentType = "bottom" | "center" | "top";
/* ExcelBorder */
export interface ExcelBorder {
style: ExcelBorderStyle;
color: ExcelColorSpec;
}
export type ExcelBorderStyle =
"thin"
| "medium"
| "thick"
| "dotted"
| "hair"
| "dashed"
| "mediumDashed"
| "dashDot"
| "mediumDashDot"
| "dashDotDot"
| "mediumDashDotDot"
| "slantDashDot";
export class ExcelColumn extends React.Component<ExcelColumnProps, any> {
}
export class ExcelSheet extends React.Component<ExcelSheetProps, any> {
}
export class ExcelFile extends React.Component<ExcelFileProps, any> {
}
export namespace ReactExport {
export class ExcelFile extends React.Component<ExcelFileProps, any> {
}
}
export default ReactExport
}