import { type FormComponentsDef, type FormMetadata, type Item } from '@defra/forms-model'; import { ComponentBase } from '~/src/server/plugins/engine/components/ComponentBase.js'; import { type FormContext, type FormRequestPayload } from '~/src/server/plugins/engine/types/index.js'; import { type ErrorMessageTemplateList, type Feature, type FileState, type FormPayload, type FormState, type FormStateValue, type FormSubmissionError, type FormSubmissionState, type FormValue, type GeospatialState, 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; isAppendageStateSingleObject: boolean; constructor(def: FormComponentsDef, props: ConstructorParameters[1]); get keys(): string[]; getFormDataFromState(state: FormSubmissionState): FormPayload; getFormValueFromState(state: FormSubmissionState): FormValue | FormPayload; getFormValue(value?: FormStateValue | FormState): NonNullable | 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("~/src/server/plugins/engine/types/index.js").ComponentText; suffix?: import("~/src/server/plugins/engine/types/index.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("~/src/server/plugins/engine/types/index.js").Content | import("~/src/server/plugins/engine/types/index.js").Content[] | string; maxlength?: number; maxwords?: number; rows?: number; items?: import("~/src/server/plugins/engine/types/index.js").ListItem[] | import("~/src/server/plugins/engine/types/index.js").DateInputItem[]; fieldset?: { attributes?: string | Record; legend?: import("~/src/server/plugins/engine/types/index.js").Label; }; formGroup?: { classes?: string; attributes?: string | Record; }; showFieldsetError?: boolean; components?: import("~/src/server/plugins/engine/types/index.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; 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; onSubmit(_request: FormRequestPayload, _metadata: FormMetadata, _context: FormContext): Promise; } /** * 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 geospatial state */ export declare function isGeospatialState(value?: unknown): value is GeospatialState; /** * Check for upload state value */ export declare function isUploadValue(value?: unknown): value is FileState; /** * Check for geospatial state value */ export declare function isGeospatialValue(value?: unknown): value is Feature;