diff --git a/types/react-joyride/index.d.ts b/types/react-joyride/index.d.ts index d081aa87cf..13f691e56e 100644 --- a/types/react-joyride/index.d.ts +++ b/types/react-joyride/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for react-joyride 2.0 // Project: https://github.com/gilbarbara/react-joyride // Definitions by: DongYoon Kang +// Kamran Ayub // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -106,7 +107,7 @@ export interface Props extends OverridableProps { /** * It will be called when Joyride's state changes. It returns a single parameter with the state. */ - callback?(options: (data: State) => any): void; + callback?: (data: State) => any; /** * The tour is played sequentially with the Next button. Defaults to false. @@ -135,6 +136,11 @@ export interface OverridableProps { */ showProgress?: boolean; + /** + * Display a button to skip the tour. + */ + showSkipButton?: boolean; + /** * Disable closing the tooltip on ESC. Defaults to false. */ @@ -150,6 +156,11 @@ export interface OverridableProps { */ disableOverlayClose?: boolean; + /** + * Disable auto scrolling between steps. + */ + disableScrolling?: boolean; + /** * The strings used in the tooltip. Defaults to `{ back: 'Back', close: 'Close', last: 'Last', next: 'Next', skip: 'Skip' }` */ diff --git a/types/react-joyride/react-joyride-tests.tsx b/types/react-joyride/react-joyride-tests.tsx index 82171e98e2..d69d151174 100644 --- a/types/react-joyride/react-joyride-tests.tsx +++ b/types/react-joyride/react-joyride-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import Joyride, { Step } from "react-joyride"; +import Joyride, { Step, State } from "react-joyride"; class NewComponent extends React.Component { j: Joyride; @@ -42,7 +42,7 @@ class NewComponent extends React.Component { }]; render() { - return ; + return ; } doStuff() { @@ -56,4 +56,8 @@ class NewComponent extends React.Component { const { title, placement } = this.j.getProgress().step; } + + onCallback(data: State) { + return; + } }