diff --git a/src/index.d.ts b/src/index.d.ts index fe1ec7a..5113e30 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -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 @@ -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 }>