import type { FormDefinition } from '../validation/form'; export type SubmissionValue = string | number | boolean; export interface SubmissionInput { fields: Record; consent: true; idempotencyKey: string; formVersion: number; /** Inquiry attribution; excluded from submission identity. */ sourcePath?: string; metadata?: Record; } export interface SubmissionReceipt { id: string; receivedAt: string; } export interface FormSubmission { readonly form: string; readonly fields: Readonly>; readonly idempotencyKey: string; readonly sourcePath?: string; readonly metadata?: Readonly>; } export interface SubmissionFieldError { field: string; code: string; } export interface SubmissionRejection { status: number; code: string; message?: string; } export interface SubmissionLedger extends Record { documentId: string; createdAt: string; form: string; payloadHash: string; targetUid: string; targetDocumentId?: string; deliveries?: unknown[]; } /** Read-only view of the public submission request passed to validate hooks. * Consumers read headers (for example a session token) without a Koa import. */ export interface FormHookRequest { readonly headers: Readonly>; readonly method?: string; readonly url?: string; readonly ip?: string; } export interface FormHooks { validate?: (submission: FormSubmission, context: { form: Readonly; request?: FormHookRequest; }) => void | SubmissionRejection | Promise; afterSave?: (context: { submission: FormSubmission; record: Readonly>; ledger: Readonly; }) => void | Promise; } export interface BuilderFormsConfig { hooks?: Record; } export declare class SubmissionServiceError extends Error { readonly status: number; readonly code: string; readonly details: SubmissionFieldError[]; constructor(status: number, code: string, details?: SubmissionFieldError[], message?: string); } //# sourceMappingURL=forms.d.ts.map