import { type FormMetadata, type Page } from '@defra/forms-model';
import { type RouteOptions } from '@hapi/hapi';
import { SummaryViewModel, type FormModel } from '../../../../server/plugins/engine/models/index.js';
import { type Detail, type DetailItem } from '../../../../server/plugins/engine/models/types.js';
import { QuestionPageController } from '../../../../server/plugins/engine/pageControllers/QuestionPageController.js';
import { type FormContext, type FormContextRequest } from '../../../../server/plugins/engine/types.js';
import { type FormRequest, type FormRequestPayload, type FormRequestPayloadRefs, type FormResponseToolkit } from '../../../../server/routes/types.js';
export declare class SummaryPageController extends QuestionPageController {
    pageDef: Page;
    allowSaveAndExit: boolean;
    /**
     * The controller which is used when Page["controller"] is defined as "./pages/summary.js"
     */
    /**
     * Finds the PaymentField component across all pages in the model.
     * Payment pages are skipped in the normal page walk
     */
    private findPaymentField;
    constructor(model: FormModel, pageDef: Page);
    getSummaryViewModel(request: FormContextRequest, context: FormContext): SummaryViewModel;
    private buildPaymentDetails;
    /**
     * Returns an async function. This is called in plugin.ts when there is a GET request at `/{id}/{path*}`,
     */
    makeGetRouteHandler(): (request: FormRequest, context: FormContext, h: FormResponseToolkit) => Promise<import("@hapi/hapi").ResponseObject>;
    /**
     * Checks if the resolved payment amount has changed since pre-auth
     * and invalidates stale payment state if so.
     */
    private reconcilePaymentState;
    /**
     * Returns an async function. This is called in plugin.ts when there is a POST request at `/{id}/{path*}`.
     * If a form is incomplete, a user will be redirected to the start page.
     */
    makePostRouteHandler(): (request: FormRequestPayload, context: FormContext, h: FormResponseToolkit) => Promise<import("@hapi/hapi").ResponseObject>;
    handleFormSubmit(request: FormRequestPayload, context: FormContext, h: FormResponseToolkit): Promise<import("@hapi/hapi").ResponseObject>;
    /**
     * Handles errors during form submission
     */
    private handleSubmissionError;
    /**
     * Handles InvalidComponentStateError during submission
     */
    private handleInvalidComponentStateError;
    /**
     * Handles PaymentPreAuthError during submission
     */
    private handlePaymentPreAuthError;
    /**
     * Handles PaymentSubmissionError during submission
     */
    private handlePaymentSubmissionError;
    get postRouteOptions(): RouteOptions<FormRequestPayloadRefs>;
}
export declare function submitForm(context: FormContext, formMetadata: FormMetadata, request: FormRequestPayload, summaryViewModel: SummaryViewModel, model: FormModel, emailAddress: string): Promise<void>;
export declare function getFormSubmissionData(context: FormContext, details: Detail[], model: FormModel): DetailItem[];
