import { type FormMetadata, type PaymentFieldComponent } from '@defra/forms-model';
import { type ObjectSchema } from 'joi';
import { FormComponent } from '../../../../server/plugins/engine/components/FormComponent.js';
import { type PaymentState } from '../../../../server/plugins/engine/components/PaymentField.types.js';
import { type FormModel } from '../../../../server/plugins/engine/models/index.js';
import { type FormContext, type FormRequestPayload, type FormResponseToolkit } from '../../../../server/plugins/engine/types/index.js';
import { type ErrorMessageTemplateList, type FormPayload, type FormState, type FormStateValue, type FormSubmissionError, type FormSubmissionState, type PaymentExternalArgs } from '../../../../server/plugins/engine/types.js';
export declare class PaymentField extends FormComponent {
    options: PaymentFieldComponent['options'];
    formSchema: ObjectSchema;
    stateSchema: ObjectSchema;
    isAppendageStateSingleObject: boolean;
    constructor(def: PaymentFieldComponent, props: ConstructorParameters<typeof FormComponent>[1]);
    /**
     * Gets the PaymentState from form submission state
     */
    getPaymentStateFromState(state: FormSubmissionState): PaymentState | undefined;
    getDisplayStringFromState(state: FormSubmissionState): string;
    getViewModel(payload: FormPayload, errors?: FormSubmissionError[]): {
        amount: string;
        description: string;
        paymentState: PaymentState | undefined;
        label: {
            text: string;
        };
        id: string;
        name: string;
        value: import("../../../../server/plugins/engine/types.js").FormValue;
        type?: string;
        hint?: {
            id?: string;
            text: string;
        };
        prefix?: import("../../../../server/plugins/engine/types/index.js").ComponentText;
        suffix?: import("../../../../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("../../../../server/plugins/engine/types/index.js").Content | import("../../../../server/plugins/engine/types/index.js").Content[] | string;
        maxlength?: number;
        maxwords?: number;
        rows?: number;
        items?: import("../../../../server/plugins/engine/types/index.js").ListItem[] | import("../../../../server/plugins/engine/types/index.js").DateInputItem[];
        fieldset?: {
            attributes?: string | Record<string, string>;
            legend?: import("../../../../server/plugins/engine/types/index.js").Label;
        };
        formGroup?: {
            classes?: string;
            attributes?: string | Record<string, string>;
        };
        showFieldsetError?: boolean;
        components?: import("../../../../server/plugins/engine/types/index.js").ComponentViewModel[];
        upload?: {
            count: number;
            summaryList: import("../../../../server/plugins/engine/types.js").SummaryList;
        };
    };
    /**
     * Type guard to check if value is PaymentState
     */
    isPaymentState(value: unknown): value is PaymentState;
    /**
     * Static type guard to check if value is PaymentState
     */
    static isPaymentState(value: unknown): value is PaymentState;
    /**
     * Override base isState to validate PaymentState
     */
    isState(value?: FormStateValue | FormState): value is FormState;
    getFormValue(value?: FormStateValue | FormState): NonNullable<FormStateValue> | undefined;
    getContextValueFromState(state: FormSubmissionState): string;
    /**
     * For error preview page that shows all possible errors on a component
     */
    getAllPossibleErrors(): ErrorMessageTemplateList;
    /**
     * Static version of getAllPossibleErrors that doesn't require a component instance.
     */
    static getAllPossibleErrors(): ErrorMessageTemplateList;
    /**
     * Resolves the payment amount from conditional amounts configuration.
     * Evaluates conditions in order; first true condition wins.
     * Falls back to the default options.amount.
     */
    static resolveAmount(options: PaymentFieldComponent['options'], model: FormModel, state: FormState): number;
    /**
     * Dispatcher for external redirect to GOV.UK Pay
     */
    static dispatcher(request: FormRequestPayload, h: FormResponseToolkit, args: PaymentExternalArgs): Promise<unknown>;
    /**
     * Called on form submission to capture the payment
     * @see https://docs.payments.service.gov.uk/delayed_capture/#delay-taking-a-payment
     */
    onSubmit(request: FormRequestPayload, _metadata: FormMetadata, context: FormContext): Promise<void>;
    /**
     * Updates payment state to mark capture as successful
     * This ensures we don't try to re-capture on submission retry
     */
    private markPaymentCaptured;
}
/**
 * Session data stored when dispatching to GOV.UK Pay
 */
export interface PaymentSessionData {
    uuid: string;
    formId: string;
    reference: string;
    amount: number;
    description: string;
    paymentId: string;
    componentName: string;
    returnUrl: string;
    failureUrl: string;
    isLivePayment: boolean;
}
