@data-driven-forms/react-form-renderer
Version:
React Form Renderer. Data Driven Forms converts JSON form definitions into fully functional React forms.
39 lines (38 loc) • 1.1 kB
TypeScript
import { KeyboardEvent } from 'react';
import { Field } from '../common-types';
import { FormOptions } from '../renderer-context';
export type NextStep = string | ((context: {
values: any;
}) => string) | ((context: {
values: any;
}) => Promise<string>) | (any & {
stepMapper: {
[key: string]: string;
[key: number]: string;
};
when: string[] | string;
});
export interface WizardContextValue {
formOptions: FormOptions;
crossroads: string[];
currentStep: {
fields?: Field[];
name: string;
title?: string;
nextStep?: NextStep;
isProgressAfterSubmissionStep?: boolean;
} | undefined;
handlePrev: Function;
onKeyDown?: (e: KeyboardEvent) => void;
jumpToStep: Function;
setPrevSteps: () => void;
handleNext: Function;
navSchema: Record<string, any>[];
activeStepIndex: number;
maxStepIndex: number;
isDynamic: boolean;
prevSteps: string[];
selectNext: Function;
}
declare const WizardContext: import("react").Context<WizardContextValue>;
export default WizardContext;