import { Ref, ComputedRef } from 'vue' export type WizardStepValidator = () => boolean | Promise export type ValidationState = { index: number, valid: boolean } export type WizardStep = { title: string, key?: string, validate?: WizardStepValidator, } export type WizardNavigation = { success: boolean, newIndex: number, } export type UseWizard = { steps: Ref, currentStepIndex: Ref, currentStep: Ref, furthestStepIndex: Ref, loading: Ref, next: () => Promise, previous: () => Promise, goto: { (key: string): Promise, // eslint-disable-next-line @typescript-eslint/unified-signatures (index: number): Promise, // eslint-disable-next-line @typescript-eslint/unified-signatures (step: WizardStep): Promise, }, getStepIndex: { (key: string): number, // eslint-disable-next-line @typescript-eslint/unified-signatures (step: WizardStep): number, }, getStep: { (key: string): WizardStep | undefined, // eslint-disable-next-line @typescript-eslint/unified-signatures (index: number): WizardStep | undefined, }, setStep: (key: string, step: WizardStep) => void, isValid: (index?: number) => Promise, } export type UseWizardStep = { wizard: UseWizard, step: ComputedRef, defineValidate: (validate: WizardStepValidator) => void, }