|
1 |
| -declare module 'intro.js-react' { |
2 |
| - import * as React from 'react'; |
3 |
| - import { IntroJs, Options } from 'intro.js'; |
| 1 | +import * as React from 'react'; |
| 2 | +import { IntroJs, Options } from 'intro.js'; |
4 | 3 |
|
5 |
| - interface Step { |
6 |
| - /** |
7 |
| - * CSS selector or element to use for the step. |
8 |
| - */ |
9 |
| - element?: string | HTMLElement | Element; |
10 |
| - /** |
11 |
| - * The tooltip content. |
12 |
| - */ |
13 |
| - intro: string | React.ReactNode; |
14 |
| - /** |
15 |
| - * Position of the tooltip. |
16 |
| - */ |
17 |
| - position?: string; |
18 |
| - /** |
19 |
| - * The tooltip title. |
20 |
| - */ |
21 |
| - title?: string |
22 |
| - /** |
23 |
| - * CSS class of the tooltip. |
24 |
| - */ |
25 |
| - tooltipClass?: string; |
26 |
| - /** |
27 |
| - * CSS class of the helperLayer. |
28 |
| - */ |
29 |
| - highlightClass?: string; |
30 |
| - } |
31 |
| - |
32 |
| - interface Hint { |
33 |
| - /** |
34 |
| - * CSS selector to use for the hint. |
35 |
| - */ |
36 |
| - element: string; |
37 |
| - /** |
38 |
| - * The tooltip text. |
39 |
| - */ |
40 |
| - hint: string; |
41 |
| - /** |
42 |
| - * Position of the tooltip. |
43 |
| - */ |
44 |
| - hintPosition?: string; |
45 |
| - } |
| 4 | +interface Step { |
| 5 | + /** |
| 6 | + * CSS selector or element to use for the step. |
| 7 | + */ |
| 8 | + element?: string | HTMLElement | Element; |
| 9 | + /** |
| 10 | + * The tooltip content. |
| 11 | + */ |
| 12 | + intro: string | React.ReactNode; |
| 13 | + /** |
| 14 | + * Position of the tooltip. |
| 15 | + */ |
| 16 | + position?: string; |
| 17 | + /** |
| 18 | + * The tooltip title. |
| 19 | + */ |
| 20 | + title?: string; |
| 21 | + /** |
| 22 | + * CSS class of the tooltip. |
| 23 | + */ |
| 24 | + tooltipClass?: string; |
| 25 | + /** |
| 26 | + * CSS class of the helperLayer. |
| 27 | + */ |
| 28 | + highlightClass?: string; |
| 29 | +} |
46 | 30 |
|
47 |
| - interface StepsProps { |
48 |
| - /** |
49 |
| - * Defines if the steps are visible or not. |
50 |
| - * @default false |
51 |
| - */ |
52 |
| - enabled?: boolean; |
53 |
| - /** |
54 |
| - * Step index to start with when showing the steps. |
55 |
| - */ |
56 |
| - initialStep: number; |
57 |
| - /** |
58 |
| - * All the steps. |
59 |
| - */ |
60 |
| - steps: Step[]; |
61 |
| - /** |
62 |
| - * Callback called when the steps are disabled. |
63 |
| - * Required to force keeping track of the state when the steps are dismissed with an Intro.js event and not the |
64 |
| - * enabled prop. |
65 |
| - */ |
66 |
| - onExit(stepIndex: number): void; |
67 |
| - /** |
68 |
| - * Callback called before exiting the intro. |
69 |
| - * If you want to prevent exiting the intro, you can return false in this callback (available since intro.js 0.2.7). |
70 |
| - */ |
71 |
| - onBeforeExit?(stepIndex: number): void | false; |
72 |
| - /** |
73 |
| - * Callback called when the steps are enabled. |
74 |
| - */ |
75 |
| - onStart?(stepIndex: number): void; |
76 |
| - /** |
77 |
| - * Callback called when the current step is changed. |
78 |
| - */ |
79 |
| - onChange?(nextStepIndex: number, nextElement: Element): void; |
80 |
| - /** |
81 |
| - * Callback called before changing the current step. |
82 |
| - * If you want to prevent the transition to the next / previous step, you can return false in this callback |
83 |
| - * (available since intro.js 2.8.0). |
84 |
| - */ |
85 |
| - onBeforeChange?(nextStepIndex: number, nextElement: Element): void | false | Promise<void | false>; |
86 |
| - /** |
87 |
| - * Callback called after changing the current step. |
88 |
| - */ |
89 |
| - onAfterChange?(newStepIndex: number, newElement: Element): void; |
90 |
| - /** |
91 |
| - * Callback called if you prevented transitioning to a new step by returning false in onBeforeChange. |
92 |
| - */ |
93 |
| - onPreventChange?(stepIndex: number): void; |
94 |
| - /** |
95 |
| - * Callback called when all the steps are completed. |
96 |
| - */ |
97 |
| - onComplete?(): void; |
98 |
| - /** |
99 |
| - * Intro.js options. |
100 |
| - */ |
101 |
| - options?: Options; |
102 |
| - } |
| 31 | +interface Hint { |
| 32 | + /** |
| 33 | + * CSS selector to use for the hint. |
| 34 | + */ |
| 35 | + element: string; |
| 36 | + /** |
| 37 | + * The tooltip text. |
| 38 | + */ |
| 39 | + hint: string; |
| 40 | + /** |
| 41 | + * Position of the tooltip. |
| 42 | + */ |
| 43 | + hintPosition?: string; |
| 44 | +} |
103 | 45 |
|
104 |
| - interface HintsProps { |
105 |
| - /** |
106 |
| - * Defines if the hints are visible or not. |
107 |
| - * @default false |
108 |
| - */ |
109 |
| - enabled?: boolean; |
110 |
| - /** |
111 |
| - * All the hints. |
112 |
| - */ |
113 |
| - hints: Hint[]; |
114 |
| - /** |
115 |
| - * Callback called when a hint is clicked. |
116 |
| - */ |
117 |
| - onClick?(): void; |
118 |
| - /** |
119 |
| - * Callback called when a hint is closed. |
120 |
| - */ |
121 |
| - onClose?(): void; |
122 |
| - /** |
123 |
| - * Intro.js options. |
124 |
| - */ |
125 |
| - options?: Options; |
126 |
| - } |
| 46 | +interface StepsProps { |
| 47 | + /** |
| 48 | + * Defines if the steps are visible or not. |
| 49 | + * @default false |
| 50 | + */ |
| 51 | + enabled?: boolean; |
| 52 | + /** |
| 53 | + * Step index to start with when showing the steps. |
| 54 | + */ |
| 55 | + initialStep: number; |
| 56 | + /** |
| 57 | + * All the steps. |
| 58 | + */ |
| 59 | + steps: Step[]; |
| 60 | + /** |
| 61 | + * Callback called when the steps are disabled. |
| 62 | + * Required to force keeping track of the state when the steps are dismissed with an Intro.js event and not the |
| 63 | + * enabled prop. |
| 64 | + */ |
| 65 | + onExit(stepIndex: number): void; |
| 66 | + /** |
| 67 | + * Callback called before exiting the intro. |
| 68 | + * If you want to prevent exiting the intro, you can return false in this callback (available since intro.js 0.2.7). |
| 69 | + */ |
| 70 | + onBeforeExit?(stepIndex: number): void | false; |
| 71 | + /** |
| 72 | + * Callback called when the steps are enabled. |
| 73 | + */ |
| 74 | + onStart?(stepIndex: number): void; |
| 75 | + /** |
| 76 | + * Callback called when the current step is changed. |
| 77 | + */ |
| 78 | + onChange?(nextStepIndex: number, nextElement: Element): void; |
| 79 | + /** |
| 80 | + * Callback called before changing the current step. |
| 81 | + * If you want to prevent the transition to the next / previous step, you can return false in this callback |
| 82 | + * (available since intro.js 2.8.0). |
| 83 | + */ |
| 84 | + onBeforeChange?(nextStepIndex: number, nextElement: Element): void | false | Promise<void | false>; |
| 85 | + /** |
| 86 | + * Callback called after changing the current step. |
| 87 | + */ |
| 88 | + onAfterChange?(newStepIndex: number, newElement: Element): void; |
| 89 | + /** |
| 90 | + * Callback called if you prevented transitioning to a new step by returning false in onBeforeChange. |
| 91 | + */ |
| 92 | + onPreventChange?(stepIndex: number): void; |
| 93 | + /** |
| 94 | + * Callback called when all the steps are completed. |
| 95 | + */ |
| 96 | + onComplete?(): void; |
| 97 | + /** |
| 98 | + * Intro.js options. |
| 99 | + */ |
| 100 | + options?: Options; |
| 101 | +} |
127 | 102 |
|
128 |
| - export class Steps extends React.Component<StepsProps> { |
129 |
| - public introJs: IntroJs; |
130 |
| - public updateStepElement(stepIndex: number): void; |
131 |
| - } |
| 103 | +interface HintsProps { |
| 104 | + /** |
| 105 | + * Defines if the hints are visible or not. |
| 106 | + * @default false |
| 107 | + */ |
| 108 | + enabled?: boolean; |
| 109 | + /** |
| 110 | + * All the hints. |
| 111 | + */ |
| 112 | + hints: Hint[]; |
| 113 | + /** |
| 114 | + * Callback called when a hint is clicked. |
| 115 | + */ |
| 116 | + onClick?(): void; |
| 117 | + /** |
| 118 | + * Callback called when a hint is closed. |
| 119 | + */ |
| 120 | + onClose?(): void; |
| 121 | + /** |
| 122 | + * Intro.js options. |
| 123 | + */ |
| 124 | + options?: Options; |
| 125 | +} |
132 | 126 |
|
133 |
| - export class Hints extends React.Component<HintsProps> {} |
| 127 | +export class Steps extends React.Component<StepsProps> { |
| 128 | + public introJs: IntroJs; |
| 129 | + public updateStepElement(stepIndex: number): void; |
134 | 130 | }
|
| 131 | + |
| 132 | +export class Hints extends React.Component<HintsProps> {} |
0 commit comments