import React from 'react'; import { type fieldsData } from '../typings'; export declare const FieldsContext: React.Context<{}>; export declare const SetValueContext: React.Context<() => void>; /** * Initiates a scope of new form. */ declare const Form: ({ fields, mandatory: mandatoryFields, allMandatory, component, onChange, isFieldGroup, runOnChangeInitially, onEnterPress, className, children, }: FormProps) => import("react/jsx-runtime").JSX.Element; export interface FormProps { /** * Names of all fields prescribed for a form */ fields: string[]; /** * Names of fields that should be mandatory */ mandatory?: string[]; /** * Sets all fields as mandatory */ allMandatory?: boolean; /** * Replace `
` with another HTML tag or component */ component?: React.ComponentType; /** * Function to run on each fields change */ onChange?: (fieldsData: fieldsData, hasErrors: boolean, fieldName?: string) => void; /** * Prop used by Fieldgroup component. */ isFieldGroup?: boolean; /** * Runs onChange function also on initial render */ runOnChangeInitially?: boolean; /** * Submit function called when pressing enter within input */ onEnterPress?: (fieldsData: fieldsData) => void; /** * Give form element a class */ className?: string; children: React.ReactNode; } export default Form;