import { type FormComponentsDef, type Item } from '@defra/forms-model';
import { ComponentBase } from '~/src/server/plugins/engine/components/ComponentBase.js';
import { type ErrorMessageTemplateList, type FileState, type FormPayload, type FormState, type FormStateValue, type FormSubmissionError, type FormSubmissionState, type FormValue, type RepeatItemState, type RepeatListState, type UploadState } from '~/src/server/plugins/engine/types.js';
export declare class FormComponent extends ComponentBase {
    type: FormComponentsDef['type'];
    hint: FormComponentsDef['hint'];
    label: string;
    isFormComponent: boolean;
    constructor(def: FormComponentsDef, props: ConstructorParameters<typeof ComponentBase>[1]);
    get keys(): string[];
    getFormDataFromState(state: FormSubmissionState): FormPayload;
    getFormValueFromState(state: FormSubmissionState): FormValue | FormPayload;
    getFormValue(value?: FormStateValue | FormState): NonNullable<FormStateValue> | undefined;
    getStateFromValidForm(payload: FormPayload): FormState;
    getErrors(errors?: FormSubmissionError[]): FormSubmissionError[] | undefined;
    getFirstError(errors?: FormSubmissionError[]): FormSubmissionError | undefined;
    getViewErrors(errors?: FormSubmissionError[]): FormSubmissionError[] | undefined;
    getViewModel(payload: FormPayload, errors?: FormSubmissionError[]): {
        label: {
            text: string;
        };
        id: string;
        name: string;
        value: FormValue;
        type?: string;
        hint?: {
            id?: string;
            text: string;
        };
        prefix?: import("./types.js").ComponentText;
        suffix?: import("./types.js").ComponentText;
        classes?: string;
        condition?: string;
        errors?: FormSubmissionError[];
        errorMessage?: {
            text: string;
        };
        summaryHtml?: string;
        html?: string;
        attributes: {
            autocomplete?: string;
            maxlength?: number;
            multiple?: string;
            accept?: string;
            inputmode?: string;
        };
        content?: import("./types.js").Content | import("./types.js").Content[] | string;
        maxlength?: number;
        maxwords?: number;
        rows?: number;
        items?: import("./types.js").ListItem[] | import("./types.js").DateInputItem[];
        fieldset?: {
            attributes?: string | Record<string, string>;
            legend?: import("./types.js").Label;
        };
        formGroup?: {
            classes?: string;
            attributes?: string | Record<string, string>;
        };
        components?: import("./types.js").ComponentViewModel[];
        upload?: {
            count: number;
            summaryList: import("~/src/server/plugins/engine/types.js").SummaryList;
        };
    };
    getDisplayStringFromFormValue(value: FormValue | FormPayload): string;
    getDisplayStringFromState(state: FormSubmissionState): string;
    getContextValueFromFormValue(value: FormValue | FormPayload): Item['value'] | Item['value'][] | null;
    getContextValueFromState(state: FormSubmissionState): Item['value'] | Item['value'][] | null;
    isValue(value?: FormStateValue | FormState): value is NonNullable<FormStateValue>;
    isState(value?: FormStateValue | FormState): value is FormState;
    /**
     * For error preview page that shows all possible errors on a component
     */
    getAllPossibleErrors(): ErrorMessageTemplateList;
    /**
     * Static version of getAllPossibleErrors that doesn't require a component instance.
     */
    static getAllPossibleErrors(): ErrorMessageTemplateList;
}
/**
 * Check for form value
 */
export declare function isFormValue(value?: unknown): value is string | number | boolean;
/**
 * Check for form state with nested values
 */
export declare function isFormState(value?: unknown): value is FormState;
/**
 * Check for repeat list state
 */
export declare function isRepeatState(value?: unknown): value is RepeatListState;
/**
 * Check for repeat list value
 */
export declare function isRepeatValue(value?: unknown): value is RepeatItemState;
/**
 * Check for upload state
 */
export declare function isUploadState(value?: unknown): value is UploadState;
/**
 * Check for upload state value
 */
export declare function isUploadValue(value?: unknown): value is FileState;
