import { type SubmitResponsePayload } from '@defra/forms-model'; import { type checkFormStatus } from '~/src/server/plugins/engine/helpers.js'; import { type FormModel } from '~/src/server/plugins/engine/models/index.js'; import { type DetailItem } from '~/src/server/plugins/engine/models/types.js'; import { type FormContext, type RichFormValue } from '~/src/server/plugins/engine/types.js'; /** * Payment data for the machine output format * Defined locally to avoid circular dependency with types.ts */ interface PaymentOutput { paymentId: string; reference: string; amount: number; description: string; createdAt: string; } export declare function format(context: FormContext, items: DetailItem[], model: FormModel, _submitResponse: SubmitResponsePayload, _formStatus: ReturnType): string; /** * Categories the form submission data into the "main" body and "repeaters". * * { * main: { * componentName: 'componentValue', * }, * repeaters: { * repeaterName: [ * { * textComponentName: 'componentValue' * }, * { * richComponentName: { foo: 'bar', 'baz': true } * } * ] * }, * files: { * fileComponentName: [ * { * fileId: '123-456-789', * fileName: 'example.pdf', * userDownloadLink: 'https://forms-designer/file-download/123-456-789' * } * ] * }, * payments: { * paymentComponentName: { * paymentId: 'abc123', * reference: 'REF-123', * amount: 10.00, * description: 'Application fee', * createdAt: '2025-01-23T10:30:00.000Z' * } * } * } */ export declare function categoriseData(items: DetailItem[]): { main: Record; repeaters: Record[]>; files: Record; payment?: PaymentOutput; }; export {};