import { type FileUploadFieldComponent, type FormMetadata } from '@defra/forms-model'; import joi, { type ArraySchema } from 'joi'; import { FormComponent } from '~/src/server/plugins/engine/components/FormComponent.js'; import { type ErrorMessageTemplateList, type FileState, type FileUpload, type FileUploadMetadata, type FormContext, type FormPayload, type FormState, type FormStateValue, type FormSubmissionError, type FormSubmissionState, type SummaryList, type UploadState, type UploadStatusFileResponse, type UploadStatusResponse } from '~/src/server/plugins/engine/types.js'; import { type FormQuery, type FormRequestPayload } from '~/src/server/routes/types.js'; export declare const uploadIdSchema: joi.StringSchema; export declare const fileSchema: joi.ObjectSchema; export declare const tempFileSchema: joi.ObjectSchema; export declare const formFileSchema: joi.ObjectSchema; export declare const metadataSchema: joi.ObjectSchema; export declare const tempStatusSchema: joi.ObjectSchema; export declare const formStatusSchema: joi.ObjectSchema; export declare const itemSchema: joi.ObjectSchema; export declare const tempItemSchema: joi.ObjectSchema; export declare const formItemSchema: joi.ObjectSchema; export declare class FileUploadField extends FormComponent { options: FileUploadFieldComponent['options']; schema: FileUploadFieldComponent['schema']; formSchema: ArraySchema; stateSchema: ArraySchema; constructor(def: FileUploadFieldComponent, props: ConstructorParameters[1]); getFormValueFromState(state: FormSubmissionState): UploadState | undefined; getFormValue(value?: FormStateValue | FormState): UploadState | undefined; getDisplayStringFromFormValue(files: FileState[] | undefined): string; getDisplayStringFromState(state: FormSubmissionState): string; getContextValueFromFormValue(files: UploadState | undefined): string[] | null; getContextValueFromState(state: FormSubmissionState): string[] | null; getViewModel(payload: FormPayload, errors?: FormSubmissionError[], query?: FormQuery): { upload: { count: number; summaryList: SummaryList; }; multiple?: boolean | undefined; value: string; name: string; label: { text: string; }; id: string; 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; legend?: import("./types.js").Label; }; formGroup?: { classes?: string; attributes?: string | Record; }; showFieldsetError?: boolean; components?: import("./types.js").ComponentViewModel[]; }; isValue(value?: FormStateValue | FormState): value is UploadState; /** * For error preview page that shows all possible errors on a component */ getAllPossibleErrors(): ErrorMessageTemplateList; onSubmit(request: FormRequestPayload, metadata: FormMetadata, context: FormContext): Promise; /** * Static version of getAllPossibleErrors that doesn't require a component instance. */ static getAllPossibleErrors(): ErrorMessageTemplateList; }