11import { ReactNode } from "react" ;
2- import { Field } from "@data-driven-forms/react-form-renderer" ;
2+ import { Field , AnyObject , FormOptions } from "@data-driven-forms/react-form-renderer" ;
33
44export interface WizardButtonLabels {
55 submit ?: ReactNode ;
@@ -8,6 +8,53 @@ export interface WizardButtonLabels {
88 next ?: ReactNode ;
99}
1010
11+ export interface WizardNextStepFunctionArgument {
12+ values ?: AnyObject ;
13+ value ?: any ;
14+ }
15+
16+ export interface WizardNextStepFunction {
17+ ( formState : WizardNextStepFunctionArgument ) : string ;
18+ }
19+
20+ export interface WizardStepMapper {
21+ [ key : string ] : string | number ;
22+ }
23+
24+ export interface WizardNextStepMapper {
25+ when : string ;
26+ stepMapper : WizardStepMapper ;
27+ }
28+
29+ export type WizardNextStep = string | WizardNextStepMapper | WizardNextStepFunction ;
30+
31+ export interface WizardButtonsProps {
32+ ConditionalNext : React . ComponentType ;
33+ SubmitButton : React . ComponentType ;
34+ SimpleNext : React . ComponentType ;
35+ formOptions : FormOptions ;
36+ disableBack ?: boolean ;
37+ handlePrev : any ;
38+ nextStep ?: string | number ;
39+ FieldProvider ?: React . ComponentType ;
40+ handleNext : any ;
41+ buttonsClassname ?: string ;
42+ buttonLabels : AnyObject ;
43+ renderNextButton : any ;
44+ }
45+
46+ export interface WizardField {
47+ name : string | number ;
48+ fields : Field [ ] ;
49+ nextStep ?: WizardNextStep ;
50+ substepOf ?: string | number ;
51+ title ?: ReactNode ;
52+ showTitle ?: boolean ;
53+ customTitle ?: ReactNode ;
54+ disableForwardJumping ?: boolean ;
55+ buttons ?: ReactNode | React . ComponentType < WizardButtonsProps > ;
56+ }
57+
1158export interface WizardProps {
1259 buttonLabels ?: WizardButtonLabels ;
1360 buttonsClassName ?: string ;
@@ -20,7 +67,7 @@ export interface WizardProps {
2067 isDynamic ?: boolean ;
2168 showTitles ?: boolean ;
2269 crossroads ?: string [ ] ;
23- fields : Field [ ] ;
70+ fields : WizardField [ ] ;
2471}
2572
2673declare const Wizard : React . ComponentType < WizardProps > ;
0 commit comments