import type { FormikProps } from 'formik'; import React from 'react'; import type { WizardPage } from './WizardPage'; import type { IModalComponentProps } from '../../presentation'; import type { TaskMonitor } from '../../task/monitor/TaskMonitor'; export interface IWizardPageInjectedProps { formik: FormikProps; /** WizardModal supplies this incrementor fn, which should be used to supply the WizardPage order prop */ nextIdx: () => number; /** The WizardModal Callback API for use by WizardPage component */ wizard: IWizardModalApi; } export interface IWizardModalProps extends IModalComponentProps { formClassName?: string; heading: string; initialValues: T; loading?: boolean; render: (props: IWizardPageInjectedProps) => React.ReactNode; submitButtonLabel: string; taskMonitor: TaskMonitor; validate?(values: T): any; } export interface IWizardModalState { currentPage: WizardPage; initialized: boolean; pages: Array>; } export interface IWizardModalApi { onWizardPageAdded: (wizardPage: WizardPage) => void; onWizardPageRemoved: (wizardPage: WizardPage) => void; /** * The wrapped WizardPage component can call this when its state changes * and WizardModal will force a re-render */ onWizardPageStateChanged: (_page: WizardPage) => void; } export declare class WizardModal extends React.Component, IWizardModalState> implements IWizardModalApi { private stepsElement; private formikRef; state: IWizardModalState; private static incrementer; get formik(): FormikProps; componentDidMount(): void; onWizardPageAdded: (wizardPage: WizardPage) => void; onWizardPageRemoved: (wizardPage: WizardPage) => void; private setCurrentPage; private handleStepsScroll; private validate; /** Rerender everything when a WizardPage requests it */ onWizardPageStateChanged(_page: WizardPage): void; revalidate: () => Promise>; render(): JSX.Element; }