Improve OnboardingFlow API and typescript types

This commit is contained in:
fragosti
2018-05-24 11:24:10 -07:00
parent d057b77dc5
commit f8f8bd95ca
4 changed files with 27 additions and 14 deletions

View File

@@ -37,17 +37,34 @@ declare module 'react-joyride' {
[prop: string]: any;
}
interface StyleOptionsProp {
export interface StyleOptionsProp {
options: StyleOptions;
}
interface CallbackMetadata {
type:
| 'tour:start'
| 'step:before'
| 'beacon'
| 'tooltip'
| 'close'
| 'step:after'
| 'tour:end'
| 'tour:status'
| 'error:target_not_found'
| 'error';
step: number;
}
export type CallbackData = CallbackMetadata & State;
export interface Props {
steps?: Step[];
beaconComponent?: React.ReactNode;
disableOverlayClose?: boolean;
run?: boolean;
stepIndex?: number;
callback?: (options: any) => void;
callback?: (data: CallbackData) => void;
debug?: boolean;
styles?: StyleOptionsProp;
}