import { type FormComponentsDef, type UkAddressFieldComponent } from '@defra/forms-model'; import { type ObjectSchema } from 'joi'; import { ComponentCollection } from '~/src/server/plugins/engine/components/ComponentCollection.js'; import { FormComponent } from '~/src/server/plugins/engine/components/FormComponent.js'; import { type FormRequestPayload, type FormResponseToolkit } from '~/src/server/plugins/engine/types/index.js'; import { type ErrorMessageTemplateList, type FormPayload, type FormState, type FormStateValue, type FormSubmissionError, type FormSubmissionState, type PostcodeLookupExternalArgs } from '~/src/server/plugins/engine/types.js'; export declare class UkAddressField extends FormComponent { options: UkAddressFieldComponent['options']; formSchema: ObjectSchema; stateSchema: ObjectSchema; collection: ComponentCollection; shortDescription: FormComponentsDef['shortDescription']; constructor(def: UkAddressFieldComponent, props: ConstructorParameters[1]); getFormValueFromState(state: FormSubmissionState): UkAddressState | undefined; getContextValueFromFormValue(value: UkAddressState | undefined): string[] | null; getContextValueFromState(state: FormSubmissionState): string[] | null; getDisplayStringFromFormValue(value: UkAddressState | undefined): string; getDisplayStringFromState(state: FormSubmissionState): string; /** * Returns one error per child field */ getViewErrors(errors?: FormSubmissionError[]): FormSubmissionError[] | undefined; getViewModel(payload: FormPayload, errors?: FormSubmissionError[]): { value: string | undefined; fieldset: { attributes?: string | Record; legend?: import("~/src/server/plugins/engine/types/index.js").Label; }; components: import("~/src/server/plugins/engine/types/index.js").ComponentViewModel[]; usePostcodeLookup: boolean; label: { text: string; }; id: string; name: string; 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[]; formGroup?: { classes?: string; attributes?: string | Record; }; showFieldsetError?: boolean; upload?: { count: number; summaryList: import("~/src/server/plugins/engine/types.js").SummaryList; }; }; isState(value?: FormStateValue | FormState): value is UkAddressState; /** * For error preview page that shows all possible errors on a component */ getAllPossibleErrors(): ErrorMessageTemplateList; private shouldUsePostcodeLookup; /** * Static version of getAllPossibleErrors that doesn't require a component instance. */ static getAllPossibleErrors(): ErrorMessageTemplateList; static isUkAddress(value?: FormStateValue | FormState): value is UkAddressState; static dispatcher(request: FormRequestPayload, h: FormResponseToolkit, args: PostcodeLookupExternalArgs): Promise; } export interface UkAddressState extends Record { uprn: string; addressLine1: string; addressLine2: string; town: string; county: string; postcode: string; }