rfa
Version:
**React Form Architect** is an ultimate solution for creating and rendering forms in React. Its main focus is to provide users with a tool to define, render and share a form in a browser.
15 lines (14 loc) • 972 B
TypeScript
import { AttributeType, FormStoredElementType, FormSchemaType } from './store';
import { StoreActions } from 'react-simple-hook-store';
export declare type IActions = {
addFormElement: (element: FormStoredElementType) => void;
addFormElementAtIndex: (element: FormStoredElementType, index: number) => void;
removeFormElement: (id: string) => void;
copyFormElement: (id: string, name: string, position: number) => void;
swapFormElements: (groupID: string, elementIndex: number, newPositionIndex: number) => void;
transferElement: (id: string, groupId: string) => void;
setFormElementAttributes: (id: string, attrs: AttributeType) => void;
setFormElementValidations: (id: string, validations: any) => void;
setFormElementAttribute: <T extends keyof FormStoredElementType>(id: string, attribute: T, value: FormStoredElementType[T]) => void;
};
export declare const formElementActions: StoreActions<FormSchemaType, IActions>;