Skip to content

Wrong type definition for typescript when using instance #103

@GeenCo86

Description

@GeenCo86

What is wrong:

StepWizard has the wrong type definition for the instance callback.

What I would expect:

interface StepWizardTransitionProps {
    enterRight?: string;
    enterLeft?: string;
    exitRight?: string;
    exitLeft?: string;
    intro?: string;
}
interface StepWizardInstanceProps {
    getHash: () => string;
    getTransitions: () => StepWizardTransitionProps;
    onHashChange: () => void;
    isInvalidStep: (next: number) => boolean;
    setActiveStep: (next: number) => void;
    // do we need onStepChange ??
    currentStep: number;
    totalSteps: number;
    getSteps: () => ReactElement[];
    firstStep: () => void;
    lastStep: () => void;
    nextStep: () => void;
    previousStep: () => void;
    goToStep: (step: number) => void;
    goToNamedStep: (stepName: string) => void;
    updateHash: (activeHash: string) => void;
}

instance: (wizard: StepWizardInstanceProps) => void

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions