/**
 * Copyright 2023 Kapeta Inc.
 * SPDX-License-Identifier: MIT
 */
import { Context } from 'react';
import { FormContainer } from './FormContainer';
import { ValidatorList } from '../validation/Validators';
export type ResetListener = (value: any) => void;
interface FormContextData {
    valid: boolean;
    validators?: ValidatorList;
    processing: boolean;
    isDirty: boolean;
    container?: FormContainer;
    onReadyStateChanged: (childName: any, ready: boolean) => void;
    onValueChanged: (name: string, value: any) => void;
    onReset(name: string, callback: ResetListener): () => void;
}
export interface FormContextType extends Context<FormContextData> {
}
export declare const FormContext: FormContextType;
export declare function useFormContextField<T = any>(fieldName: string, resetHandler?: ResetListener): {
    get(defaultValue?: T): T;
    set(value: T): void;
    valid(): void;
    invalid(): void;
};
export declare function FormContextWatcher({ onChange }: {
    onChange: (context: FormContextData) => void;
}): any;
export {};
