import { Signal } from '@tempots/dom';
import { Path } from './path';
import { Controller } from './controller';
import { ControllerValidation } from './controller-validation';
/**
 * Union type definition for the controller
 */
export interface UnionBranch<T = unknown> {
    /** Unique identifier for this branch */
    key: string;
    /** Display label for this branch */
    label: string;
    /** Type guard function to detect if a value belongs to this branch */
    detect: (value: unknown) => boolean;
    /** Function to convert a value to this branch type */
    convert?: (value: unknown) => {
        ok: true;
        value: T;
    } | {
        ok: false;
    };
    /** Default value for this branch when switching to it */
    defaultValue: () => T;
}
export type ValidationMode = 'onSubmit' | 'continuous' | 'touchedOrSubmit';
/**
 * Controller for union types that manages multiple possible value types
 */
export declare class UnionController<T> extends Controller<T> {
    #private;
    readonly branches: readonly UnionBranch[];
    readonly activeBranch: Signal<string>;
    constructor(path: Path, change: (value: T) => void, signal: Signal<T>, status: Signal<ControllerValidation>, parent: {
        disabled: Signal<boolean>;
        validationMode?: Signal<ValidationMode>;
    }, branches: UnionBranch[], equals?: (a: T, b: T) => boolean);
    /**
     * Get the controller for the currently active branch
     */
    get activeController(): Controller<unknown>;
    /**
     * Get a controller for a specific branch
     */
    getBranchController(branchKey: string): Controller<unknown>;
    /**
     * Switch to a different branch
     */
    switchToBranch(branchKey: string, confirmChange?: boolean): boolean;
    /**
     * Get the current active branch definition
     */
    get activeBranchDefinition(): UnionBranch | undefined;
}
