-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
156 lines (131 loc) · 5.05 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import * as React from 'react';
declare namespace ReactToImage {
interface Style {
// Flexbox
alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around';
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
flex?: number | string;
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
flexFlow?: number;
flexGrow?: number;
flexShrink?: number;
flexBasis?: number | string;
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between' | 'space-evenly';
gap?: number | string;
rowGap?: number;
columnGap?: number;
// Layout
aspectRatio?: number | string;
bottom?: number | string;
display?: 'flex' | 'none';
left?: number | string;
position?: 'absolute' | 'relative';
right?: number | string;
top?: number | string;
overflow?: 'hidden';
zIndex?: number | string;
// Dimension
height?: number | string;
maxHeight?: number | string;
maxWidth?: number | string;
minHeight?: number | string;
minWidth?: number | string;
width?: number | string;
// Color
backgroundColor?: string;
color?: string;
opacity?: number;
// Text
font?: string;
fontSize?: number | string;
fontFamily?: string;
fontStyle?: string | 'normal';
fontWeight?: number | 'thin' | 'hairline' | 'ultralight' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'demibold' | 'bold' | 'ultrabold' | 'extrabold' | 'heavy' | 'black';
letterSpacing?: number | string;
lineHeight?: number | string;
maxLines?: number; // ?
textAlign?: 'left' | 'right' | 'center' | 'justify'; // ?
textDecoration?: 'line-through' | 'underline' | 'none' | 'line-through underline' | 'underline line-through';
textDecorationColor?: string;
textDecorationStyle?: "dashed" | "dotted" | "solid" | string; // ?
textIndent?: any; // ?
textOverflow?: 'ellipsis';
textTransform?: 'capitalize' | 'lowercase' | 'uppercase';
verticalAlign?: 'sub' | 'super';
// Sizing/positioning
objectFit?: string;
objectPosition?: number | string;
objectPositionX?: number | string;
objectPositionY?: number | string;
// Margin/padding
margin?: number | string;
marginHorizontal?: number | string;
marginVertical?: number | string;
marginTop?: number | string;
marginRight?: number | string;
marginBottom?: number | string;
marginLeft?: number | string;
padding?: number | string;
paddingHorizontal?: number | string;
paddingVertical?: number | string;
paddingTop?: number | string;
paddingRight?: number | string;
paddingBottom?: number | string;
paddingLeft?: number | string;
// Transformations
transform?: string;
transformOrigin?: number | string;
transformOriginX?: number | string;
transformOriginY?: number | string;
// Borders
border?: number | string;
borderWidth?: number | string;
borderColor?: string;
borderStyle?: "dashed" | "dotted" | "solid";
borderTop?: number | string;
borderTopColor?: string;
borderTopStyle?: "dashed" | "dotted" | "solid"; // ?
borderTopWidth?: number | string;
borderRight?: number | string;
borderRightColor?: string;
borderRightStyle?: "dashed" | "dotted" | "solid"; // ?
borderRightWidth?: number | string;
borderBottom?: number | string;
borderBottomColor?: string;
borderBottomStyle?: "dashed" | "dotted" | "solid"; // ?
borderBottomWidth?: number | string;
borderLeft?: number | string;
borderLeftColor?: string;
borderLeftStyle?: "dashed" | "dotted" | "solid"; // ?
borderLeftWidth?: number | string;
borderTopLeftRadius?: number | string;
borderTopRightRadius?: number | string;
borderBottomRightRadius?: number | string;
borderBottomLeftRadius?: number | string;
borderRadius?: number | string
}
interface ViewProps {
style?: Style
}
interface CanvasProps {
width?: number
height?: number
backgroundColor?: string
}
interface ImageProps extends ViewProps {
src: string
}
interface TextProps extends ViewProps {}
class Canvas extends React.Component<React.PropsWithChildren<CanvasProps>> {}
class View extends React.Component<React.PropsWithChildren<ViewProps>> {}
class Image extends React.Component<React.PropsWithChildren<ImageProps>> {}
class Text extends React.Component<React.PropsWithChildren<TextProps>> {}
}
export declare const Canvas: typeof ReactToImage.Canvas;
export declare const View: typeof ReactToImage.View;
export declare const Image: typeof ReactToImage.Image;
export declare const Text: typeof ReactToImage.Text;
export declare const renderToBuffer: (root: React.ReactElement<ReactToImage.CanvasProps>) => Promise<Buffer>
export declare const renderToBlob: (root: React.ReactElement<ReactToImage.CanvasProps>) => Promise<Blob>