forked from FormidableLabs/spectacle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
321 lines (262 loc) · 7.44 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
// Definitions by: Zachary Maybury <https://github.com/zmaybury>
// Kylie Stewart <https://github.com/kale-stew>
declare module 'spectacle' {
import * as CSS from 'csstype';
import * as React from 'react';
/**
* Alignment Types for Spectacle
*/
type alignType =
| 'flex-start flex-start'
| 'flex-start center'
| 'flex-start flex-end'
| 'center flex-start'
| 'center center'
| 'center flex-end'
| 'flex-end flex-start'
| 'flex-end center'
| 'flex-end flex-end';
/**
* Animation Types for Spectacle
*/
type easeType =
| 'back'
| 'backIn'
| 'backOut'
| 'backInOut'
| 'bounce'
| 'bounceIn'
| 'bounceOut'
| 'bounceInOut'
| 'circle'
| 'circleIn'
| 'circleOut'
| 'circleInOut'
| 'linear'
| 'linearIn'
| 'linearOut'
| 'linearInOut'
| 'cubic'
| 'cubicIn'
| 'cubicOut'
| 'cubicInOut'
| 'elastic'
| 'elasticIn'
| 'elasticOut'
| 'elasticInOut'
| 'exp'
| 'expIn'
| 'expOut'
| 'expInOut'
| 'poly'
| 'polyIn'
| 'polyOut'
| 'polyInOut'
| 'quad'
| 'quadIn'
| 'quadOut'
| 'quadInOut'
| 'sin'
| 'sinIn'
| 'sinOut'
| 'sinInOut';
/**
* Progress Types for Spectacle
*/
type progressType = 'pacman' | 'bar' | 'number' | 'none';
/**
* S Types for StyledS in Spectacle
*/
type sType = 'italic' | 'bold' | 'line-through' | 'underline';
/**
* Target Types for links
*/
type targetType = '_blank' | '_self' | '_parent' | '_top';
/**
* Theme Types for CodePane in Spectacle
*/
type themeType = 'dark' | 'light' | 'external';
/**
* Transition Types for Spectacle
*/
type transitionType = 'slide' | 'zoom' | 'fade' | 'spin';
/**
* All available DOM style properties and their types
* https://www.npmjs.com/package/csstype
*/
interface CSSProperties extends CSS.Properties<string | number> {}
interface AnimProps {
easing: easeType;
fromStyle: CSSProperties | CSSProperties[];
onAnim?: (forwards?: boolean, animIndex?: number) => void;
order?: number;
route?: object;
style?: CSSProperties;
toStyle: CSSProperties | CSSProperties[];
transitionDuration: number;
}
interface AppearProps {
easing?: easeType;
endValue?: object;
fid?: string;
order?: number;
startValue?: object;
style?: BaseProps['style'];
transitionDuration?: number;
}
/**
* Base props for many Spectacle components
*/
interface BaseProps {
bgColor?: string;
bgDarken?: number;
bgImage?: string;
bold?: boolean;
caps?: boolean;
className?: string;
italic?: boolean;
margin?: number | string;
padding?: number | string;
style?: CSSProperties;
textAlign?: string;
textColor?: string;
textFont?: string;
textSize?: string;
}
interface CodePaneProps {
className?: BaseProps['className'];
contentEditable?: boolean;
lang?: string;
source?: string;
style?: BaseProps['style'];
theme?: themeType;
}
interface ComponentPlaygroundProps {
code?: string;
previewBackgroundColor?: string;
scope?: object;
theme?: themeType;
transformCode?: (code: string) => string;
}
interface DeckProps {
autoplay?: boolean;
autoplayDuration?: number;
autoplayLoop?: boolean;
autoplayOnStart?: boolean;
controls?: boolean;
globalStyles?: boolean;
history?: any; // Needs a type, see https://github.com/ReactTraining/history
showFullscreenControl?: boolean;
onStateChange?: (previousState?: string, nextState?: string) => void;
progress?: progressType;
theme?: Theme;
transition?: transitionType[];
transitionDuration?: number;
}
interface FillProps {
className?: string;
style?: CSSProperties;
}
interface FitProps extends FillProps {} // tslint:disable-line:no-empty-interface
interface GoToActionProps {
margin?: BaseProps['margin'];
padding?: BaseProps['padding'];
render?: (goToSlide?: (slide: number | string) => void) => void;
slide?: number | string;
style?: BaseProps['style'];
}
interface HeadingProps extends BaseProps {
fit?: boolean;
lineHeight?: number;
size?: number;
}
interface ImageProps {
alt?: string;
className?: BaseProps['className'];
display?: string;
height?: number | string;
margin?: BaseProps['margin'];
padding?: BaseProps['padding'];
src?: string;
width?: number | string;
}
interface LayoutProps {
style?: CSSProperties;
}
interface LinkProps extends BaseProps {
href?: string;
target?: targetType;
}
interface MarkdownProps {
mdastConfig?: { [key: string]: number | string };
source?: string;
}
interface SlideProps extends BaseProps {
align?: alignType;
contentStyles?: CSSProperties;
controlColor?: string;
dispatch?: () => void;
hash?: number | string;
progressColor?: string;
history?: any; // Needs a type, see https://github.com/ReactTraining/history
id?: string;
lastSlideIndex?: number;
notes?: string;
onActive?: (slideIndex: string | number) => void;
slideIndex?: number;
state?: string;
transition?: transitionType[];
transitionDuration?: number;
transitionIn?: transitionType[];
transitionOut?: transitionType[];
}
interface SProps extends BaseProps {
type?: sType | sType[];
}
interface TextProps extends BaseProps {
fit?: boolean;
lineHeight?: number;
}
interface Theme {
[key: string]: number | string;
}
class Anim extends React.Component<AnimProps> {}
class Appear extends React.Component<AppearProps> {}
class BlockQuote extends React.Component<BaseProps> {}
class Cite extends React.Component<BaseProps> {}
class Code extends React.Component<BaseProps> {}
class CodePane extends React.Component<CodePaneProps> {}
class ComponentPlayground extends React.Component<ComponentPlaygroundProps> {}
class Deck extends React.Component<DeckProps> {}
class Fill extends React.Component<FillProps> {}
class Fit extends React.Component<FitProps> {}
class GoToAction extends React.Component<GoToActionProps> {}
class Heading extends React.Component<HeadingProps> {}
class Image extends React.Component<ImageProps> {}
class Layout extends React.Component<LayoutProps> {}
class Link extends React.Component<LinkProps> {}
class List extends React.Component<BaseProps> {}
class ListItem extends React.Component<BaseProps> {}
class Markdown extends React.Component<MarkdownProps> {}
class Notes extends React.Component<BaseProps> {}
class Quote extends React.Component<BaseProps> {}
class S extends React.Component<SProps> {}
class Slide extends React.Component<SlideProps> {}
class SlideSet extends React.Component<BaseProps> {}
class Table extends React.Component<BaseProps> {}
class TableBody extends React.Component<BaseProps> {}
class TableHeader extends React.Component<BaseProps> {}
class TableHeaderItem extends React.Component<BaseProps> {}
class TableItem extends React.Component<BaseProps> {}
class TableRow extends React.Component<BaseProps> {}
class Text extends React.Component<TextProps> {}
}
declare module 'spectacle/lib/utils/preloader' {
const preloader: (obj: object) => void;
export default preloader;
}
declare module 'spectacle/lib/themes/default' {
import { Theme } from 'spectacle';
const createTheme: (...args: object[]) => Theme;
export default createTheme;
}