import { Signal } from '@tempots/dom';
import { Path, PathSegment } from './path';
import { ControllerError, ControllerValidation } from './controller-validation';
import { ValidationMode } from './union-controller';
export declare class Controller<T> {
    #private;
    readonly path: Path;
    readonly change: (value: T) => void;
    readonly signal: Signal<T>;
    readonly status: Signal<ControllerValidation>;
    readonly error: Signal<undefined | string>;
    readonly hasError: Signal<boolean>;
    readonly touched: Signal<boolean>;
    readonly errorVisible: Signal<boolean>;
    readonly dirty: Signal<boolean>;
    readonly dependencyErrors: Signal<undefined | Record<string | number, ControllerError>>;
    protected readonly parent: {
        disabled: Signal<boolean>;
        validationMode?: Signal<ValidationMode>;
    };
    readonly disabled: Signal<boolean>;
    readonly disabledOrHasErrors: Signal<boolean>;
    constructor(path: Path, change: (value: T) => void, signal: Signal<T>, status: Signal<ControllerValidation>, parent: {
        disabled: Signal<boolean>;
        validationMode?: Signal<ValidationMode>;
    }, equals?: (a: T, b: T) => boolean);
    get name(): string;
    readonly onDispose: (callback: () => void) => void;
    readonly dispose: () => void;
    readonly setDisabled: (disabled: boolean) => void;
    readonly disable: () => void;
    readonly enable: () => void;
    readonly markTouched: () => void;
    readonly resetTouched: () => void;
    readonly markPristine: () => void;
    readonly reset: () => void;
    readonly array: (equals?: (a: T, b: T) => boolean) => ArrayController<T extends any[] ? T : never>;
    readonly object: (equals?: (a: T, b: T) => boolean) => ObjectController<T extends Record<string, any> ? T : never>;
    readonly transform: <Out>(transform: (value: T) => Out, untransform: (value: Out) => T, subpath?: PathSegment[], equals?: (a: Out, b: Out) => boolean) => Controller<Out>;
    readonly asyncTransform: <Out>(transform: (value: T) => Promise<Out>, untransform: (value: Out) => Promise<T>, alt: Out, subpath?: PathSegment[], equals?: (a: Out, b: Out) => boolean) => Controller<Out>;
}
export declare class ObjectController<T extends object> extends Controller<T> {
    #private;
    readonly touchedDeep: Signal<boolean>;
    readonly dirtyDeep: Signal<boolean>;
    constructor(path: Path, change: (value: T) => void, signal: Signal<T>, status: Signal<ControllerValidation>, parent: {
        disabled: Signal<boolean>;
    }, equals: (a: T, b: T) => boolean);
    readonly field: <K extends keyof T & string>(field: K) => Controller<T[K]>;
    readonly markAllTouched: () => void;
    readonly markAllPristine: () => void;
}
export declare class ArrayController<T extends unknown[]> extends Controller<T> {
    #private;
    readonly length: Signal<number>;
    readonly touchedDeep: Signal<boolean>;
    readonly dirtyDeep: Signal<boolean>;
    constructor(path: Path, change: (value: T) => void, signal: Signal<T>, status: Signal<ControllerValidation>, parent: {
        disabled: Signal<boolean>;
    }, equals: (a: T, b: T) => boolean);
    readonly item: (index: number) => Controller<T[number]>;
    readonly push: (...value: T[number][]) => void;
    readonly pop: () => void;
    readonly shift: () => void;
    readonly unshift: (...value: T) => void;
    readonly removeAt: (index: number) => void;
    readonly splice: (start: number, deleteCount?: number) => void;
    readonly move: (from: number, to: number, length?: number) => void;
    readonly markAllTouched: () => void;
    readonly markAllPristine: () => void;
}
