Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(change type definition): Transition props and StepWizard instance #104

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 29 additions & 8 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
// Initial typings by dmk99 - https://github.com/jcmcneal/react-step-wizard/issues/31#issuecomment-505399131
import * as React from "react"

export interface StepWizardTransitionProps {
enterRight?: string;
enterLeft?: string;
exitRight?: string;
exitLeft?: string;
intro?: string;
}


export interface StepWizardInstanceProps {
getHash: () => string;
getTransitions: () => StepWizardTransitionProps;
onHashChange: () => void;
isInvalidStep: (next: number) => boolean;
setActiveStep: (next: number) => void;
currentStep: number;
totalSteps: number;
getSteps: () => JSX.Element[] | React.ReactElement[];
firstStep: () => void;
lastStep: () => void;
nextStep: () => void;
previousStep: () => void;
goToStep: (step: number) => void;
goToNamedStep: (stepName: string) => void;
updateHash: (activeHash: string) => void;
}

export type StepWizardProps = Partial<{
className: string

hashKey: string
stepName: string
initialStep: number
instance: (wizard: StepWizardProps) => void
instance: (wizard: StepWizardInstanceProps) => void
isHashEnabled: boolean
isLazyMount: boolean
nav: JSX.Element
Expand All @@ -17,13 +44,7 @@ export type StepWizardProps = Partial<{
activeStep: number
}) => void

transitions: {
enterRight?: string
enterLeft?: string
exitRight?: string
exitLeft?: string
intro?: string
}
transitions: StepWizardTransitionProps;

children: JSX.Element | JSX.Element[] | React.ReactElement
}>
Expand Down