1
1
declare module 'intro.js-react' {
2
+ import * as React from 'react' ;
3
+ import { IntroJs , Options } from 'intro.js' ;
4
+
2
5
interface Step {
3
6
/**
4
7
* CSS selector to use for the step.
@@ -7,7 +10,7 @@ declare module 'intro.js-react' {
7
10
/**
8
11
* The tooltip content.
9
12
*/
10
- intro : string | JSX . Element ;
13
+ intro : string | React . ReactNode ;
11
14
/**
12
15
* Position of the tooltip.
13
16
*/
@@ -34,106 +37,7 @@ declare module 'intro.js-react' {
34
37
/**
35
38
* Position of the tooltip.
36
39
*/
37
- hintPosition ?: String ;
38
- }
39
-
40
- interface Options {
41
- /**
42
- * Next button label.
43
- */
44
- nextLabel ?: string ;
45
- /**
46
- * Previous button label.
47
- */
48
- prevLabel ?: string ;
49
- /**
50
- * Skip button label.
51
- */
52
- skipLabel ?: string ;
53
- /**
54
- * Done button label.
55
- */
56
- doneLabel ?: string ;
57
- /**
58
- * Hides the Previous button in the first step.
59
- */
60
- hidePrev ?: boolean ;
61
- /**
62
- * Hide the Next button in the last step.
63
- */
64
- hideNext ?: boolean ;
65
- /**
66
- * Position of the tooltips.
67
- */
68
- tooltipPosition ?: string ;
69
- /**
70
- * CSS class of the tooltips.
71
- */
72
- tooltipClass ?: string ;
73
- /**
74
- * CSS class of the helperLayer.
75
- */
76
- highlightClass ?: string ;
77
- /**
78
- * Exit by pressing Escape.
79
- */
80
- exitOnEsc ?: boolean ;
81
- /**
82
- * Exit by clicking on the overlay layer.
83
- */
84
- exitOnOverlayClick ?: boolean ;
85
- /**
86
- * Show steps number in a red circle.
87
- */
88
- showStepNumbers ?: boolean ;
89
- /**
90
- * Allows navigation between steps using the keyboard.
91
- */
92
- keyboardNavigation ?: boolean ;
93
- /**
94
- * Show navigation buttons.
95
- */
96
- showButtons ?: boolean ;
97
- /**
98
- * Show bullets.
99
- */
100
- showBullets ?: boolean ;
101
- /**
102
- * Show progress indicator.
103
- */
104
- showProgress ?: boolean ;
105
- /**
106
- * Enables scrolling to hidden elements.
107
- */
108
- scrollToElement ?: boolean ;
109
- /**
110
- * Opacity of the overlay.
111
- */
112
- overlayOpacity ?: number ;
113
- /**
114
- * Padding when automatically scrolling to an element.
115
- */
116
- scrollPadding ?: number ;
117
- /**
118
- * Precedence of positions.
119
- */
120
- positionPrecedence ?: string [ ] ;
121
- /**
122
- * Disables interaction inside elements.
123
- */
124
- disableInteraction ?: boolean ;
125
- /**
126
- * Position of the hints.
127
- */
128
40
hintPosition ?: string ;
129
- /**
130
- * Hint button label.
131
- */
132
- hintButtonLabel ?: string ;
133
- /**
134
- * Enables hint animations.
135
- */
136
- hintAnimation ?: boolean ;
137
41
}
138
42
139
43
interface StepsProps {
@@ -151,42 +55,44 @@ declare module 'intro.js-react' {
151
55
*/
152
56
steps : Step [ ] ;
153
57
/**
154
- * Callback called when the steps are disabled
155
- * Required to force keeping track of the state when the steps are dismissed with an Intro.js event and not the enabled prop.
58
+ * Callback called when the steps are disabled.
59
+ * Required to force keeping track of the state when the steps are dismissed with an Intro.js event and not the
60
+ * enabled prop.
156
61
*/
157
- onExit ( stepIndex : number ) : any ;
62
+ onExit ( stepIndex : number ) : void ;
158
63
/**
159
64
* Callback called before exiting the intro.
160
65
* If you want to prevent exiting the intro, you can return false in this callback (available since intro.js 0.2.7).
161
66
*/
162
- onBeforeExit ?( stepIndex : number ) : any ;
67
+ onBeforeExit ?( stepIndex : number ) : void | false ;
163
68
/**
164
69
* Callback called when the steps are enabled.
165
70
*/
166
- onStart ?( stepIndex : number ) : any ;
71
+ onStart ?( stepIndex : number ) : void ;
167
72
/**
168
73
* Callback called when the current step is changed.
169
74
*/
170
- onChange ?( nextStepIndex : number , nextElement : Element ) : any ;
75
+ onChange ?( nextStepIndex : number , nextElement : Element ) : void ;
171
76
/**
172
77
* Callback called before changing the current step.
173
- * If you want to prevent the transition to the next / previous step, you can return false in this callback (available since intro.js 2.8.0).
78
+ * If you want to prevent the transition to the next / previous step, you can return false in this callback
79
+ * (available since intro.js 2.8.0).
174
80
*/
175
- onBeforeChange ?( nextStepIndex : number ) : any ;
81
+ onBeforeChange ?( nextStepIndex : number ) : void | false ;
176
82
/**
177
83
* Callback called after changing the current step.
178
84
*/
179
- onAfterChange ?( newStepIndex : number , newElement : Element ) : any ;
85
+ onAfterChange ?( newStepIndex : number , newElement : Element ) : void ;
180
86
/**
181
87
* Callback called if you prevented transitioning to a new step by returning false in onBeforeChange.
182
88
*/
183
- onPreventChange ?( stepIndex : number ) : any ;
89
+ onPreventChange ?( stepIndex : number ) : void ;
184
90
/**
185
91
* Callback called when all the steps are completed.
186
92
*/
187
- onComplete ?( ) : any ;
93
+ onComplete ?( ) : void ;
188
94
/**
189
- * Intro.js options.”
95
+ * Intro.js options.
190
96
*/
191
97
options ?: Options ;
192
98
}
@@ -198,23 +104,26 @@ declare module 'intro.js-react' {
198
104
*/
199
105
enabled ?: boolean ;
200
106
/**
201
- * All the hints. Hint[]
107
+ * All the hints.
202
108
*/
203
109
hints : Hint [ ] ;
204
110
/**
205
111
* Callback called when a hint is clicked.
206
112
*/
207
- onClick ?( ) : any ;
113
+ onClick ?( ) : void ;
208
114
/**
209
115
* Callback called when a hint is closed.
210
116
*/
211
- onClose ?( ) : any ;
117
+ onClose ?( ) : void ;
212
118
/**
213
119
* Intro.js options.
214
120
*/
215
121
options ?: Options ;
216
122
}
217
123
218
- function Steps ( props : StepsProps ) : JSX . Element ;
219
- function Hints ( props : HintsProps ) : JSX . Element ;
124
+ export class Steps extends React . Component < StepsProps > {
125
+ introJs : IntroJs ;
126
+ }
127
+
128
+ export class Hints extends React . Component < HintsProps > { }
220
129
}
0 commit comments