import { HTTP_METHOD_GET, HTTP_METHOD_POST, NEXT_ACTION_TYPE_REDIRECT, NEXT_ACTION_TYPE_STRIPE_CONFIRM, NEXT_ACTION_TYPE_DONE, NEXT_ACTION_TYPE_PAYPAL_ORDER, NEXT_ACTION_TYPE_OXXO_VOUCHER } from '../constants';
import type { NextActionType } from '../constants';
type BaseNextAction = {
    type: NextActionType;
    onSuccess?: () => Promise<void>;
};
type NextActionDone = BaseNextAction & {
    type: typeof NEXT_ACTION_TYPE_DONE;
};
type NextActionRedirectGetDetails = {
    url: string;
    method?: typeof HTTP_METHOD_GET;
};
type NextActionRedirectGet = BaseNextAction & {
    type: typeof NEXT_ACTION_TYPE_REDIRECT;
    redirect: NextActionRedirectGetDetails;
    details?: NextActionRedirectGetDetails;
};
type NextActionRedirectPostDetails = {
    url: string;
    method: typeof HTTP_METHOD_POST;
    postData?: Record<string, any>;
};
type NextActionRedirectPost = BaseNextAction & {
    type: typeof NEXT_ACTION_TYPE_REDIRECT;
    redirect: NextActionRedirectPostDetails;
    details?: NextActionRedirectPostDetails;
};
type NextActionRedirect = NextActionRedirectGet | NextActionRedirectPost;
type NextActionStripeConfirmDetails = {
    client_secret: string;
    return_url: string;
    url?: string;
};
type NextActionStripeConfirm = BaseNextAction & {
    type: typeof NEXT_ACTION_TYPE_STRIPE_CONFIRM;
    stripe_confirmation_details: NextActionStripeConfirmDetails;
    details?: NextActionStripeConfirmDetails;
};
type NextActionPayPalOrderDetails = {
    order_id: string;
};
type NextActionPayPalOrder = BaseNextAction & {
    type: typeof NEXT_ACTION_TYPE_PAYPAL_ORDER;
    paypal_details: NextActionPayPalOrderDetails;
    details?: NextActionPayPalOrderDetails;
};
type NextActionOxxoVoucherDetails = {
    url: string;
};
type NextActionOxxoVoucher = BaseNextAction & {
    type: typeof NEXT_ACTION_TYPE_OXXO_VOUCHER;
    oxxo_voucher: NextActionOxxoVoucherDetails;
    details?: NextActionOxxoVoucherDetails;
};
export type NextActionDetails = Record<string, any>;
export type NextAction = undefined | null | NextActionDone | NextActionRedirect | NextActionStripeConfirm | NextActionPayPalOrder | NextActionOxxoVoucher;
export {};
