import { Observable } from 'rxjs';
import { MicroAgent } from '@newrelic/browser-agent/loaders/micro-agent';

declare class Container {
    protected selector: string;
    constructor(selector: string);
    isExist(): boolean;
    getStyles<T>(allowValue: string[]): T | {};
    on(name: any, cb: (event: MouseEvent) => void): void;
    getAttr<T>(allowValue: string[]): T | {};
    getElement(): Element;
    getSelector(): string;
    private convertConfigs;
}

declare class EventEmitter {
    private events;
    emit<T>(eventName: string, data?: T): void;
    emitWithResult<T, R>(eventName: string, data?: T): Promise<R[]>;
    subscribe<T>(eventName: string, handler: (data: T) => void): () => void;
}

declare enum PageType {
    CART = "cart",
    PRODUCT = "product"
}
interface IAfterpayOnSiteMessagingConfig {
    mpid: string;
    placement_id: string;
    page_type: PageType;
    amount?: string;
    currency: string;
    consumer_locale?: string;
    item_skus?: string;
    item_categories?: string;
    is_eligible?: boolean;
}
interface IAfterpayOnSiteMessagingService {
    load(container: Container): void;
}

/**
 * Afterpay On Site Messaging constructor
 *
 * @param {string} selector - Selector of html element. Container for Afterpay On Site Messaging.
 * @param {IAfterpayOnSiteMessagingConfig} config - Required configuration for the Afterpay On Site Messaging.
 *
 * @example
 * var afterpayOnSiteMessaging = new AfterpayOnSiteMessaging('#afterpayButton', config);
 */
declare class AfterpayOnSiteMessaging {
    protected container: Container;
    protected eventEmitter: EventEmitter;
    protected service: IAfterpayOnSiteMessagingService;
    /** @constructs */ constructor(selector: string, config?: IAfterpayOnSiteMessagingConfig);
    /**
     * The final method after configuring the AfterpayOnSiteMessaging to
     * start the load process.
     */
    load(): void;
    /**
     * Callback for onError method.
     *
     * @callback OnErrorCallback
     * @param {unknown|null} data
     */
    /**
     * If the process fails, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * AfterpayOnSiteMessaging.onError((eventData) => console.log('Some error occur'));
     *
     * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
     */
    onError(callback?: (data?: unknown) => void): () => void;
}

declare class ApiCharge {
    protected api: Api;
    constructor(api: Api);
    /**
     * Current method allows to work with charge related endpoints
     *
     * @example
     * api.charge().preAuth('payload', cb);
     *
     * @param {object} payload - Payload for pre authorization.
     * @param {number} payload.amount - Charge amount.
     * @param {string} payload.currency - Charge currency.
     * @param {string} payload.token - Payment source token.
     * @param {string} [payload._3ds.redirect_url] - Redirect url after 3d secure processing.
     * @param {listener} [cb]
     */
    preAuth(payload: PreAuthBody, cb?: (data: any) => void): void | Promise<PreAuthResponse>;
}
interface PreAuthResponse {
    _3ds: {
        token: string;
        id: string;
    };
    status: string;
}
interface PreAuthBody {
    token: string;
    amount: string | number;
    currency: string;
    _3ds?: {
        redirect_url?: string;
    };
}

type EnvironmentConfiguration = {
    env: string;
    url: string;
};
type EnvironmentConfigurations = EnvironmentConfiguration[];
interface IEnvironment {
    getConf(): EnvironmentConfiguration;
    getEnv(): string;
    setEnv(environmentId: string, alias?: string): void;
}

declare class Env implements IEnvironment {
    private alias;
    private environmentConfigurations;
    private environmentId;
    constructor(configs: EnvironmentConfigurations, defaultEnv?: string);
    setEnv(environmentId: string, alias?: string): void;
    getEnv(): string;
    getConf(): EnvironmentConfiguration;
    private validateAlias;
    private validateEnvironmentId;
}

type HttpRequestMethod = 'GET' | 'POST';
type HttpRequestUrl = string | URL;

type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
type AgentMethodNames = keyof AgentPrototype;
type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
type InstrumentationClient = {
    call<T extends AgentMethodNames>(method: T, ...args: AgentMethodParameters<T>): void;
};
declare class InstrumentationAgent extends MicroAgent {
    private static agent;
    private static available;
    private static initialized;
    private static readonly noopClient;
    private constructor();
    static get instance(): InstrumentationClient;
    isAvailable(): boolean;
    call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
}

interface CustomEventDTO {
    environment: string;
    appId?: never;
    timestamp?: never;
    [x: string]: unknown;
}
interface ReportBaseContext {
    sdkVersion: string | null;
    description?: string;
    environment?: string;
    [x: string]: SerializableValue | undefined;
}
type SerializableValue = string | number | symbol | object | null;

type ReportErrorFn = (repository: ErrorRepository, error: string | Error, ctx: ReportBaseContext & ({
    className: string;
    classMethod: string;
    functionName?: never;
} | {
    className?: never;
    classMethod?: never;
    functionName: string;
})) => void;
declare class ErrorRepository {
    private readonly agent;
    constructor();
    createError(...args: Parameters<InstrumentationAgent['noticeError']>): Promise<void>;
}

type ReportEventFn = (repository: EventRepository, actionName: string, ctx: ReportBaseContext & CustomEventDTO) => void;
declare class EventRepository {
    private readonly agent;
    constructor();
    createEvent(...args: Parameters<InstrumentationAgent['addPageAction']>): Promise<void>;
}

declare enum API_AUTH_TYPE {
    PUBLIC_KEY = 0,
    TOKEN = 1
}
declare class ApiBase {
    protected env: Env;
    auth: string;
    authType: API_AUTH_TYPE;
    constructor(auth: string, authType?: API_AUTH_TYPE);
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * widget.setEnv('production');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): ApiBase;
    requestObservable<Req extends object, Res>(method: 'GET' | 'POST', url: string, requestBody: Req): Observable<Res>;
    private makeRequest;
    private onRequestLoad;
    private onRequestError;
    setAuthType(): API_AUTH_TYPE;
    getClient(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
        config: XMLHttpRequest;
        send: (body: any, cb?: (data) => void, errorCb?: (data: any) => any) => void;
    };
    getClientPromise<Req extends object, Res>(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
        config: XMLHttpRequest;
        send: (body: Req) => Promise<Res>;
    };
    parser({ text, status }: {
        text: string;
        status: number;
    }, cb: any, errorCb: any): any;
    parserPromise<Res>({ text, status, }: {
        text: string;
        status: number;
    }): Promise<Res>;
    reportEvent: ReportEventFn;
    reportError: ReportErrorFn;
    protected newApiRequest(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): XMLHttpRequest;
    get ctx(): {
        sdkVersion: string;
        className: string;
        environment: string;
    };
}

/**
 * Interface for browser details response.
 * @interface BrowserDetails
 *
 * @param {string} [name]
 * @param {string} [java_enabled]
 * @param {string} [language]
 * @param {string} [screen_height]
 * @param {string} [screen_width]
 * @param {string} [time_zone]
 * @param {string} [color_depth]
 * */
interface BrowserDetails {
    name: string;
    java_enabled: string;
    language: string;
    screen_height: string;
    screen_width: string;
    time_zone: string;
    color_depth: string;
}
/**
 * Class Api include method for working with paydock api
 * @constructor
 *
 * @param {string} publicKey - PayDock users public key
 * @example
 * var api = new Api('publicKey');
 *
 *
 **/
declare class Api extends ApiBase {
    publicKey: String;
    /** @constructs */ constructor(publicKey: string);
    /**
     * Method for getting browser details
     *
     * @example
     * api.getBrowserDetails();
     *
     * @return {BrowserDetails} Browser details object
     */
    getBrowserDetails(): BrowserDetails;
    /**
     * Current method allows to work with charge related endpoints
     *
     * @example
     * api.charge();
     */
    charge(): ApiCharge;
}

/**
 * List of available form field validators dedicated to cards and their definition
 *
 * @const CARD_VALIDATORS
 *
 * @type {Record<string, string>}
 *
 * @param {string} CVV=cardCvvValidation
 *  Asserts that CVV contains zero or more digits and is a number
 * @param {string} EXPIRY_DATE=expireDateValidation
 *  Asserts value is a date in the future with format MM/YY
 * @param {string} HOLDER_NAME=cardHoldernameValidation
 *  Asserts value is a name that respects the
ITU-T T.50 standard (@see https://www.itu.int/rec/T-REC-T.50/en)
 * @param {string} NUMBER=cardNumberValidation
    Asserts the value matches a known card scheme and as a the correct length.
    E.g., matches a 13, 16 or 19 digit bank card, **or**, a 13 to 25 digit Vii Gift card
 * @param {string} PIN=cardPinValidation
    Asserts the value is a number with exactly 4 digits
 */
declare const CARD_VALIDATORS: {
    readonly CVV: "cardCvvValidator";
    readonly EXPIRY_DATE: "expireDateValidation";
    readonly HOLDER_NAME: "cardHoldernameValidator";
    readonly NUMBER: "cardNumberValidator";
    readonly PIN: "cardPinValidator";
};
type CardValidatorValue = (typeof CARD_VALIDATORS)[keyof typeof CARD_VALIDATORS];
/**
 * List of available generic form field validators and their definition
 *
 * @const GENERIC_VALIDATORS
 *
 * @type {Record<string, string>}
 *
 * @param {string} REQUIRED=required
 *  Asserts the input or form field has a value defined truthy value
 */
declare const GENERIC_VALIDATORS: {
    readonly REQUIRED: "required";
};
type GenericValidatorValue = (typeof GENERIC_VALIDATORS)[keyof typeof GENERIC_VALIDATORS];

declare const FORM_FIELD: {
    CARD_NAME: string;
    CARD_NUMBER: string;
    EXPIRE_MONTH: string;
    EXPIRE_YEAR: string;
    CARD_CCV: string;
    CARD_PIN: string;
    ACCOUNT_NAME: string;
    ACCOUNT_BSB: string;
    ACCOUNT_NUMBER: string;
    ACCOUNT_ROUTING: string;
    ACCOUNT_HOLDER_TYPE: string;
    ACCOUNT_BANK_NAME: string;
    ACCOUNT_TYPE: string;
    FIRST_NAME: string;
    LAST_NAME: string;
    EMAIL: string;
    PHONE: string;
    PHONE2: string;
    ADDRESS_LINE1: string;
    ADDRESS_LINE2: string;
    ADDRESS_STATE: string;
    ADDRESS_COUNTRY: string;
    ADDRESS_CITY: string;
    ADDRESS_POSTCODE: string;
    ADDRESS_COMPANY: string;
    SAVE_CARD_CONSENT_ACCEPTED: string;
    ENABLE_CVV_TOKENIZATION_MODE: string;
    CARD_NUMBER_LAST4: string;
    ENABLE_CVV_VALIDATION: string;
};
declare const STYLE: {
    BACKGROUND_COLOR: string;
    BACKGROUND_ACTIVE_COLOR: string;
    TEXT_COLOR: string;
    BORDER_COLOR: string;
    ICON_SIZE: string;
    BUTTON_COLOR: string;
    ERROR_COLOR: string;
    SUCCESS_COLOR: string;
    FONT_SIZE: string;
    FONT_FAMILY: string;
};
declare const VAULT_DISPLAY_STYLE: {
    BACKGROUND_COLOR: string;
    TEXT_COLOR: string;
    BORDER_COLOR: string;
    BUTTON_COLOR: string;
    FONT_SIZE: string;
    FONT_FAMILY: string;
};
declare const TEXT: {
    TITLE: string;
    TITLE_H1: string;
    TITLE_H2: string;
    TITLE_H3: string;
    TITLE_H4: string;
    TITLE_H5: string;
    TITLE_H6: string;
    FINISH: string;
    TITLE_DESCRIPTION: string;
    SUBMIT_BUTTON: string;
    SUBMIT_BUTTON_PROCESSING: string;
};
declare const ELEMENT: {
    SUBMIT_BUTTON: string;
    TABS: string;
};
declare const SUPPORTED_CARD_TYPES: {
    AMEX: string;
    AUSBC: string;
    DINERS: string;
    DISCOVER: string;
    JAPCB: string;
    LASER: string;
    MASTERCARD: string;
    SOLO: string;
    VISA: string;
    VISA_WHITE: string;
    EFTPOS: string;
    EFTPOS_WHITE: string;
    UNIONPAY: string;
};
interface IIcons {
    paypal_checkout_button?: string;
    afterpay_checkout_button?: string;
    zipmoney_checkout_button?: string;
}
interface IFormPropertyOption {
    card_name?: string;
    card_number?: string;
    expire_month?: string;
    expire_year?: string;
    card_ccv?: string;
    card_pin?: string;
    account_name?: string;
    account_bsb?: string;
    account_number?: string;
    account_routing?: string;
    account_holder_type?: string;
    account_bank_name?: string;
    first_name?: string;
    last_name?: string;
    email?: string;
    phone?: string;
    phone2?: string;
    address_line1?: string;
    address_line2?: string;
    address_state?: string;
    address_country?: string;
    address_city?: string;
    address_postcode?: string;
    address_company?: string;
    card_number_last4?: string;
    enable_cvv_validation?: string;
}
interface IFormValues extends IFormPropertyOption {
}
interface IFormLabels extends IFormPropertyOption {
}
interface IFormPlaceholders extends IFormPropertyOption {
}
interface IFormElement {
    field: string;
    label?: string;
    placeholder?: string;
    value?: string;
}
type ValidatorFieldsMapKey = CardValidatorValue | GenericValidatorValue;
type ValidatorFieldsMap = Partial<Record<ValidatorFieldsMapKey, string[]>>;
interface IFormValidation {
    form_valid?: boolean;
    invalid_fields?: string[];
    invalid_showed_fields?: string[];
    validators?: ValidatorFieldsMap;
}
interface IStyles$1 {
    background_color?: string;
    background_active_color?: string;
    text_color?: string;
    border_color?: string;
    button_color?: string;
    icon_size?: string;
    error_color?: string;
    success_color?: string;
    font_size?: string;
    font_family?: string;
}
interface ITexts {
    title?: string;
    title_h1?: string;
    title_h2?: string;
    title_h3?: string;
    title_h4?: string;
    title_h5?: string;
    title_h6?: string;
    finish_text?: string;
    title_description?: string;
    submit_button?: string;
    submit_button_processing?: string;
}
interface ICommonParams {
    sdk_version?: string;
    sdk_type?: string;
}
interface ISRCParams extends ICommonParams {
    public_key?: string;
    service_id?: string;
    meta?: string;
}
interface IWalletParams extends IStyles$1, ITexts, ICommonParams {
    token: string;
    credentials: string;
    currency: string;
    amount: number;
    gateway_mode: string;
}
interface IParams extends IStyles$1, ITexts, ICommonParams {
    access_token?: string;
    public_key?: string;
    token?: string;
    configuration_token?: string;
    configuration_tokens?: string;
    ref_id?: string;
    supported_card_types?: string;
    validate_card_types?: boolean;
    fields_validation?: boolean;
    hidden_elements?: string;
    icons?: string;
    form_values?: string;
    form_labels?: string;
    form_placeholders?: string;
    query_token?: string;
    limit?: number;
    widget_id?: string;
    gateway_id?: string;
    gateway_ids?: string;
    payment_source_types?: string;
    element_styles?: string;
    use_country_phone_mask?: boolean;
    phone_mask_preferred_countries?: string;
    phone_mask_default_country?: string;
    phone_mask_only_countries?: string;
    language?: string;
    vault_display_token?: string;
    sdk_origin?: boolean;
    hide_ui_errors?: boolean;
    save_card_consent_accepted?: string;
    enable_cvv_tokenization_mode?: string;
    card_number_last4?: string;
}
interface ICountryPhoneMask {
    preferred_countries?: string[];
    default_country?: string;
    only_countries?: string[];
}
interface IPayPalMeta {
    brand_name?: string;
    cart_border_color?: string;
    reference?: string;
    email?: string;
    hdr_img?: string;
    logo_img?: string;
    pay_flow_color?: string;
    first_name?: string;
    last_name?: string;
    address_line?: string;
    address_line2?: string;
    address_city?: string;
    address_state?: string;
    address_postcode?: string;
    address_country?: string;
    phone?: string;
    hide_shipping_address?: boolean;
}
interface IBamboraMeta {
    customer_storage_number?: string;
    tokenise_algorithm?: number;
}
interface IZipmoneyMeta {
    first_name: string;
    last_name: string;
    phone?: string;
    tokenize?: boolean;
    email: string;
    gender?: string;
    date_of_birth?: string;
    charge: {
        amount: number;
        currency?: string;
        reference?: string;
        shipping_type?: string;
        items: Array<{
            name: string;
            amount: number;
            quantity: number;
            type?: string;
            reference?: string;
            item_uri?: string;
            image_url?: string;
        }>;
        shipping_address?: {
            first_name?: string;
            last_name?: string;
            line1: string;
            line2?: string;
            country: string;
            postcode: string;
            city: string;
            state: string;
        };
        billing_address: {
            first_name?: string;
            last_name?: string;
            line1: string;
            line2?: string;
            country: string;
            postcode: string;
            city: string;
            state: string;
        };
    };
    statistics: {
        account_created?: string;
        sales_total_number?: number;
        sales_total_amount?: number;
        sales_avg_value?: number;
        sales_max_value?: number;
        refunds_total_amount?: number;
        previous_chargeback?: boolean;
        currency?: string;
        last_login?: string;
    };
    hide_shipping_address?: boolean;
}
interface IAfterpayMeta {
    amount: number;
    currency: string;
    email: string;
    first_name: string;
    last_name: string;
    address_line: string;
    address_line2: string;
    address_city: string;
    address_state: string;
    address_postcode: string;
    address_country: string;
    phone: string;
}
interface VaultDisplayStyle {
    background_color?: string;
    text_color?: string;
    border_color?: string;
    button_color?: string;
    font_size?: string;
    font_family?: string;
}
interface IApplePayShippingOption$1 {
    id: string;
    label: string;
    detail: string;
    amount: string;
    type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
}
interface IGooglePayShippingOption {
    id: string;
    label: string;
    detail?: string;
    type?: 'ELECTRONIC' | 'GROUND' | 'NOT_SHIPPED' | 'OVERNIGHT' | 'PICKUP' | 'PRIORITY' | 'SAME_DAY';
}
interface IPayPalShippingOption {
    id: string;
    label: string;
    amount: string;
    currency: string;
    type: 'SHIPPING' | 'PICKUP';
}
type IShippingOption = IApplePayShippingOption$1 | IGooglePayShippingOption | IPayPalShippingOption;
declare enum WALLET_TYPE {
    GOOGLE = "google",
    APPLE = "apple",
    FLYPAY = "flypay",
    FLYPAY_V2 = "flypayV2",
    PAYPAL = "paypal",
    AFTERPAY = "afterpay"
}
interface ApplePayStyles {
    button_type?: 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
    button_style?: 'black' | 'white' | 'white-outline';
}
interface GooglePayStyles {
    button_type?: 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'pay' | 'plain' | 'subscribe';
    button_size_mode?: 'static' | 'fill';
    button_color?: 'default' | 'black' | 'white';
}
interface AfterpayStyles {
    button_type?: 'black' | 'mint' | 'white';
    height?: string;
}
type WalletStyles = {
    apple?: ApplePayStyles;
    google?: GooglePayStyles;
    afterpay?: AfterpayStyles;
} | object;
type WalletRawDataInitialization = {
    apple?: ApplePayRawDataInitialization;
    google?: GooglePayRawDataInitialization;
} | object;
type ApplePayRawDataInitialization = ApplePayJS.ApplePayPaymentRequest;
type GooglePayRawDataInitialization = google.payments.api.IsReadyToPayPaymentMethodSpecification | google.payments.api.PaymentMethodSpecification;
interface IWalletMeta {
    amount_label?: string;
    country?: string;
    pay_later?: boolean;
    hide_message?: boolean;
    standalone?: boolean;
    show_billing_address?: boolean;
    request_payer_name?: boolean;
    request_payer_email?: boolean;
    request_payer_phone?: boolean;
    request_shipping?: boolean;
    shipping_options?: IShippingOption[];
    merchant_name?: string;
    raw_data_initialization?: WalletRawDataInitialization;
    access_token?: string;
    refresh_token?: string;
    style?: WalletStyles;
    wallets?: WALLET_TYPE[];
    client_id?: string;
    apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
}

declare class Link {
    protected env: Env;
    protected linkResource: string;
    protected params: IParams;
    protected widgetId: string;
    constructor(linkResource: string);
    getNetUrl(): string;
    getUrl(): string;
    setParams(params: IParams | IWalletParams | ISRCParams): void;
    concatParams(params: IParams): void;
    getParams(): IParams;
    setEnv(env: string, alias?: string): void;
    getEnv(): string;
    getBaseUrl(): string;
}

declare class IFrame {
    protected container: Container;
    constructor(container: Container);
    load(link: string, options?: {
        title?: string;
        attributes?: Record<string, string>;
        styles?: Record<string, string>;
    }, iframeClass?: string): void;
    loadFromHtml(content: string, options?: {
        title?: string;
    }, iframeClass?: string): void;
    remove(): void;
    show(): void;
    hide(saveSize?: boolean): void;
    isExist(): boolean;
    getElement(): HTMLIFrameElement;
    setStyle(property: string, value: string): void;
    setIframeHeight(iframeElement: HTMLIFrameElement, iFrameDocument: Document, selector: string): void;
    private setStyles;
}

/**
 * List of available payment source types
 *
 * @type {object}
 * @param {string} CARD=card
 * @param {string} BANK_ACCOUNT=bank_account
 * @param {string} CHECKOUT=checkout
 */
declare const PAYMENT_TYPE: {
    CARD: string;
    GIFT_CARD: string;
    BANK_ACCOUNT: string;
    CHECKOUT: string;
    BSB: string;
};
/**
 * Purposes
 * @type {object}
 * @param {string} PAYMENT_SOURCE=payment_source
 * @param {string} CARD_PAYMENT_SOURCE_WITH_CVV=card_payment_source_with_cvv
 * @param {string} CARD_PAYMENT_SOURCE_WITHOUT_CVV=card_payment_source_without_cvv
 * */
declare enum PURPOSE {
    PAYMENT_SOURCE = "payment_source",
    CARD_PAYMENT_SOURCE_WITH_CVV = "card_payment_source_with_cvv",
    CARD_PAYMENT_SOURCE_WITHOUT_CVV = "card_payment_source_without_cvv"
}
interface IGeneral {
    purpose: PURPOSE;
    predefined_fields: IPredefinedFields;
    defined_form_fields?: string[];
    webhook_destination?: string;
    success_redirect_url?: string;
    error_redirect_url?: string;
    meta?: IPayPalMeta;
    label?: string;
    dynamic_fields_position?: boolean;
    disable_result_message?: boolean;
}
interface IPredefinedFields {
    gateway_id: string;
    type?: string;
    card_scheme?: string;
    card_processing_network?: string;
}
/**
 * Class Configuration include methods for creating configuration token
 * @constructor
 *
 * @example
 * var config = new Configuration('gatewayId'); // short
 *
 * var config = new Configuration('gatewayId', 'bank_account', 'paymentSource'); // extend
 *
 * var config = new Configuration('not_configured'); // without gateway
 *
 * @param {string} [gatewayID=default] - gateway ID. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
 * @param {string} paymentType - Type of payment source which shows in widget form. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
 * @param {string} purpose - Param which describes payment purpose. By default uses Available parameters [PURPOSE]{@link PURPOSE}
 */
declare class Configuration {
    private configs;
    private env;
    static createEachToken(accessToken: string, configs: Configuration[]): Promise<string[]>;
    private static addTokenInBase64;
    /** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: PURPOSE);
    /**
     * Destination, where customer will receive all successful responses.
     * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
     *
     * @example
     * config.setWebHookDestination('http://google.com');
     *
     * @param {string} url - Your endpoint for post request.
     */
    setWebHookDestination(url: string): void;
    /**
     * URL to which the Customer will be redirected to after the success finish
     *
     * @example
     * config.setSuccessRedirectUrl('google.com/search?q=success');
     *
     * @param {string}  url
     */
    setSuccessRedirectUrl(url: string): void;
    /**
     * URL to which the Customer will be redirected to if an error is triggered in the process of operation
     *
     * @example
     * config.setErrorRedirectUrl('google.com/search?q=error');
     *
     * @param {string} url
     */
    setErrorRedirectUrl(url: string): void;
    /**
     *  Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
     *
     * @example
     * config.setFormFields(['phone', 'email', 'first_name*']);
     *
     * @param {string[]} fields - name of fields which can be shown in a widget.
     *   If after a name of a field, you put “*”, this field will be required on client-side.
     *   (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
     */
    setFormFields(fields: string[]): void;
    /**
     * Method for setting meta information for checkout page
     *
     * @example
     * config.setMeta({
            brand_name: 'paydock',
            reference: '15',
            email: 'wault@paydock.com'
        });
     *
     * @param {IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta} object -
     *    data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta} [IBamboraMeta]{@link IBamboraMeta}
     */
    setMeta(meta: IPayPalMeta | IZipmoneyMeta | IAfterpayMeta | IBamboraMeta): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * config.setEnv('production');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    /**
     * Title for tab which can be set instead of default
     *
     * @example
     * config.setLabel('custom label');
     *
     * @param {string} label - Text label for tab
     */
    setLabel(label: string): void;
    getEnv(): string;
    /**
     * createToken - method which exactly create payment one time token
     *
     * @example
     * config.createToken('582035346f65cdd57ee81192d6e5w65w4e5',
     *  function (data) {
     *      console.log(data);
     *  }, function (error) {
     *      console.log(error);
     * });
     *
     * @param {string} accessToken - Customer access token or public key which provided for each client
     * @param {createToken~requestCallback} cb - The callback that handles the success response.
     * @param {createToken~requestCallback} errorCb - The callback that handles the failed response.
     */
    createToken(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
    getDefaultGateway<T>(accessToken: string, method: HttpRequestMethod, url: HttpRequestUrl): Promise<T>;
    private send;
    getConfigs(): IGeneral;
    private getUrl;
    private getDefaultGatewayUrl;
    setGiftCardSchemeData(giftCardScheme: any, processingNetwork: any): void;
    disableResultMessage(): void;
}

interface ITriggerData {
    configuration_token?: string;
    tab_number?: number;
    elements?: string;
    form_values?: string;
}
/**
 * Interface for classes that represent a trigger data.
 * @interface ITriggerData
 *
 * @param {string} [configuration_token]
 * @param {string} [tab_number]
 * @param {string} [elements]
 * @param {string} [form_values]
 * */
/**
 * List of available triggers
 *
 * @type {object}
 * @param {string} SUBMIT_FORM=submit_form
 * @param {string} CHANGE_TAB=tab
 * @param {string} HIDE_ELEMENTS=hide_elements
 * @param {string} SHOW_ELEMENTS=show_elements
 * @param {string} REFRESH_CHECKOUT=refresh_checkout
 * @param {string} UPDATE_FORM_VALUES=update_form_values
 * @param {string} INIT_CHECKOUT=init_checkout
 * @param {string} INJECT_CUSTOMER_DATA=inject_customer_data
 */
declare const TRIGGER: {
    SUBMIT_FORM: string;
    CHANGE_TAB: string;
    HIDE_ELEMENTS: string;
    SHOW_ELEMENTS: string;
    REFRESH_CHECKOUT: string;
    UPDATE_FORM_VALUES: string;
    INIT_CHECKOUT: string;
    INJECT_CUSTOMER_DATA: string;
};
declare class Trigger {
    protected iFrame: IFrame;
    constructor(iFrame: IFrame);
    push(triggerName: string, data?: ITriggerData): void;
}

/**
 * Current constant include available type of element for styling
 * @const STYLABLE_ELEMENT
 * @type {object}
 * @param {string} INPUT=input.
 *   These states are available: [STYLABLE_ELEMENT_STATE.ERROR]{@link STYLABLE_ELEMENT_STATE}, [STYLABLE_ELEMENT_STATE.FOCUS]{@link STYLABLE_ELEMENT_STATE}.
 *   These styles are available [IElementStyleInput]{@link IElementStyleInput}
 * @param {string} SUBMIT_BUTTON=submit_button
 *   These states are available: [STYLABLE_ELEMENT_STATE.HOVER]{@link STYLABLE_ELEMENT_STATE}.
 *   These styles are available [IElementStyleSubmitButton]{@link IElementStyleSubmitButton}
 * @param {string} LABEL=label.
 *   These styles are available [IElementStyleLabel]{@link IElementStyleLabel}
 * @param {string} TITLE=title.
 *   These styles are available [IElementStyleTitle]{@link IElementStyleTitle}
 * @param {string} TITLE_DESCRIPTION=title_description.
 *   These styles are available [IElementStyleTitleDescription]{@link IElementStyleTitleDescription}
 * */
declare const STYLABLE_ELEMENT: {
    INPUT: string;
    SUBMIT_BUTTON: string;
    LABEL: string;
    TITLE: string;
    TITLE_DESCRIPTION: string;
};
/**
 * Current constant include available states of element for styling
 * @const STYLABLE_ELEMENT_STATE
 * @type {object}
 * @param {string} ERROR=error client|server validation. This state applies to: input
 * @param {string} FOCUS=focus focus. This state applies to: input
 * @param {string} HOVER=hover focus. This state applies to: submit_button
 * */
declare const STYLABLE_ELEMENT_STATE: {
    ERROR: string;
    FOCUS: string;
    HOVER: string;
};
interface IElementStyleInput {
    color?: string;
    border?: string;
    border_radius?: string;
    background_color?: string;
    height?: string;
    text_decoration?: string;
    font_size?: string;
    font_family?: string;
    padding?: string;
    margin?: string;
    transition?: string;
    line_height?: string;
    font_weight?: string;
}
interface IElementStyleSubmitButton {
    color?: string;
    border?: string;
    border_radius?: string;
    background_color?: string;
    text_decoration?: string;
    font_size?: string;
    font_family?: string;
    padding?: string;
    margin?: string;
    transition?: string;
    line_height?: string;
    font_weight?: string;
    opacity?: string;
}
interface IElementStyleLabel {
    color?: string;
    text_decoration?: string;
    font_size?: string;
    font_family?: string;
    line_height?: string;
    font_weight?: string;
    padding?: string;
    margin?: string;
}
interface IElementStyleTitle {
    color?: string;
    text_decoration?: string;
    font_size?: string;
    font_family?: string;
    line_height?: string;
    font_weight?: string;
    padding?: string;
    margin?: string;
}
interface IElementStyleTitleDescription {
    color?: string;
    text_decoration?: string;
    font_size?: string;
    font_family?: string;
    line_height?: string;
    font_weight?: string;
    padding?: string;
    margin?: string;
}

declare const ERROR_CATEGORY: {
    readonly CONFIGURATION: "configuration";
    readonly IDENTITY: "identity_access_management";
    readonly INTERNAL: "internal";
    readonly PROCESS: "process";
    readonly RESOURCE: "resource";
    readonly VALIDATION: "validation";
};
type ErrorCategory = (typeof ERROR_CATEGORY)[keyof typeof ERROR_CATEGORY];
declare const ERROR_CAUSE: {
    readonly ABORTED: "aborted";
    readonly ACCESS_FORBIDDEN: "access_forbidden";
    readonly ALREADY_EXISTS: "already_exists";
    readonly CANCELED: "canceled";
    readonly INVALID_CONFIGURATION: "invalid_configuration";
    readonly INVALID_INPUT: "invalid_input";
    readonly NOT_FOUND: "not_found";
    readonly NOT_IMPLEMENTED: "not_implemented";
    readonly RATE_LIMITED: "rate_limited";
    readonly SERVER_BUSY: "server_busy";
    readonly SERVICE_UNREACHABLE: "service_unreachable";
    readonly UNAUTHORIZED: "unauthorized";
    readonly UNKNOWN: "unknown_error";
    readonly UNPROCESSABLE_ENTITY: "unprocessable_entity";
};
type ErrorCause = (typeof ERROR_CAUSE)[keyof typeof ERROR_CAUSE];
interface ErrorDetails {
    cause: ErrorCause;
    contextId: string;
    message: string;
    timestamp: string;
}
interface IEventError {
    cause: ErrorCause;
    category: ErrorCategory;
    retryable: boolean;
    details: ErrorDetails;
}

/**
 *
 * Class MultiWidget include method for for creating iframe url
 * @constructor
 *
 * @param {string} accessToken - PayDock users access token or public key
 * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
 *
 * @example
 * var widget = new MultiWidget('accessToken','configurationToken'); // With a pre-created configuration token
 *
 * var widget = new MultiWidget('accessToken',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
 *
 * var widget = new MultiWidget('accessToken', new Configuration('gatewayId')); With Configuration
 *
 * var widget = new MultiWidget('accessToken',[ With Configurations
 *      Configuration('gatewayId'),
 *      Configuration('gatewayId', 'bank_account')
 * ]);
 */
declare class MultiWidget {
    protected link: Link;
    protected configs: Configuration[];
    protected configTokens: string[];
    protected accessToken: string;
    protected event: IFrameEvent;
    constructor(accessToken: string, confTokens: string[]);
    constructor(accessToken: string, confToken: string);
    constructor(accessToken: string, configs: Configuration[]);
    constructor(accessToken: string, conf: Configuration);
    /**
     * Object contain styles for widget
     *
     * @example
     * widget.setStyles({
     *       background_color: 'rgb(0, 0, 0)',
     *       border_color: 'yellow',
     *       text_color: '#FFFFAA',
     *       button_color: 'rgba(255, 255, 255, 0.9)',
     *       font_size: '20px'
     *       fort_family: 'fantasy'
     *   });
     * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
     */
    setStyles(styles: IStyles$1): void;
    /**
     * Method to set a country code mask for the phone input.
     *
     * @example
     * widget.usePhoneCountryMask();
     *
     * @example
     * widget.usePhoneCountryMask({
     *       default_country: 'au',
     *       preferred_countries: ['au', 'gb'],
     *       only_countries: ['au', 'gb', 'us', 'ua']
     *   });
     *
     * @param {object} [options] - Options for configure the phone mask.
     * @param {string} [options.default_country] - Set a default country for the mask.
     * @param {Array.<string>} [options.preferred_countries] - Set list of preferred countries for the top of the select box .
     * @param {Array.<string>} [options.only_countries] - Set list of countries to show in the select box.
     */
    usePhoneCountryMask(options?: ICountryPhoneMask): void;
    setStyle(param: string, value: string): void;
    /**
     * Method for set different texts inside the widget
     *
     * @example
     * widget.setTexts({
     *       title: 'Your card',
     *       finish_text: 'Payment resource was successfully accepted',
     *       title_description: '* indicates required field',
     *       submit_button: 'Save',
     *       submit_button_processing: 'Load...',
     *   });
     *
     * @param {ITexts} fields - name of text items which can be shown in widget [TEXT]{@link TEXT}
     */
    setTexts(texts: ITexts): void;
    setText(param: string, value: string): void;
    setElementStyle(element: string, state: string, styles: IElementStyleInput | IElementStyleSubmitButton | IElementStyleLabel): any;
    setElementStyle(element: string, styles: IElementStyleInput | IElementStyleSubmitButton | IElementStyleLabel | IElementStyleTitle | IElementStyleTitleDescription): any;
    /**
   * The method to set the predefined values for the form fields inside the widget
   *
   * @example
   *   widget.setFormValues({
   *       email: 'predefined@email.com',
   *       card_name: 'Houston'
   *   });
   *
   * @param { Object } fieldValues - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, The object value is what we are expecting
   */
    setFormValues(fieldValues: IFormValues): void;
    setFormValue(key: string, value: string): void;
    /**
     * The method to set custom form field labels
     *
     * @example
     *   widget.setFormPlaceholders({
     *       card_name: 'Card Holder Name',
     *       email: 'Email For Receipt'
     *   })
     *
     * @param { Object } fieldLabels - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, The object value is what we are expecting
     */
    setFormLabels(fieldLabels: IFormLabels): void;
    setFormLabel(key: string, label: string): void;
    /**
     * The method to set custom form fields placeholders
     *
     * @example
     *   widget.setFormPlaceholders({
     *       card_name: 'Input your card holder name...',
     *       email: 'Input your email, like test@example.com'
     *   })
     *
     * @param { Object } fieldPlaceholders - Key of object is one of [FORM_FIELD]{@link FORM_FIELD}, Value of object is expected placeholder
     */
    setFormPlaceholders(fieldPlaceholders: IFormPlaceholders): void;
    setFormPlaceholder(key: string, placeholder: string): void;
    /**
     * The method to set the full configuration for the all specific form elements (label, placeholder, value)
     * You can also use the other method for the partial configuration like: setFormValues, setFormPlaceholder, setFormLabel
     *
     * @example
     *   widget.setFormElements([
     *       {
     *           field:  'card_name',
     *           placeholder: 'Input your card holder name...',
     *           label: 'Card Holder Name',
     *           value: 'Houston',
     *       },
     *       {
     *           field:  'email',
     *           placeholder: 'Input your email, like test@example.com',
     *           label: 'Email For Receipt',
     *           value: 'predefined@email.com',
     *       },
     *   ])
     *
     * @param { string } elements - The list of elements
     * @param { string } elements[].field - Field name of the element [FORM_FIELD]{@link FORM_FIELD}
     * @param { string } elements[].placeholder - Set custom form field placeholder
     * @param { string } elements[].label - Set custom labels near form field
     * @param { string } elements[].value - Set predefined values for the form field
     */
    setFormElements(elements: IFormElement[]): void;
    setFormElement(element: IFormElement): void;
    /**
     * The method to change the widget icons
     *
     * @deprecated
     */
    setIcons(icons: IIcons): void;
    setIcon(key: string, value: string): void;
    /**
     * Using this method you can set hidden elements inside widget
     *
     * @example
     * widget.setHiddenElements(['submit_button', 'email']);
     *
     * @param {string[]} elements -  list of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
     */
    setHiddenElements(elements: string[]): void;
    /**
     * Current method can set custom ID to identify the data in the future
     *
     * @example
     * widget.setRefId('id');
     *
     * @param {string} refId - custom id
     */
    setRefId(refId: string): void;
    /**
     * Current method can add visual validation from gateway to widget's form fields
     *
     * @example
     * widget.useGatewayFieldValidation();
     */
    useGatewayFieldValidation(): void;
    /**
     * Current method can set icons of supported card types
     *
     * @example
     *
     * widget.setSupportedCardIcons(['mastercard', 'visa'], validateCardNumberInput);
     *
     * @param {string[]} elements - [SUPPORTED_CARD_TYPES]{@link SUPPORTED_CARD_TYPES}
     * @param {boolean} validateCardNumberInput - [validateCardNumberInput=false] - using this param you allow validation for card number input on supported card types
     */
    setSupportedCardIcons(elements: string[], validateCardNumberInput?: boolean): void;
    /**
     * Current method can hide prevent the widget from showing the error messages
     *
     * @example
     * widget.hideUiErrors('id');
     */
    hideUiErrors(): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * widget.setEnv('production', 'paydock.com');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    getEnv(): void;
    /**
     * Method for creating iframe url
     *
     * @example
     * widget.loadIFrameUrl(function (url) {
     *      console.log(url);
     * }, function (errors) {
     *      console.log(errors);
     * });
     */
    loadIFrameUrl(cb: (url: string) => void, errorCb?: (error: any) => void): void;
    /**
     * Method for setting a custom language code
     *
     * @example
     * config.setLanguage('en');
     * @param {string} code - ISO 639-1
     */
    setLanguage(code: any): void;
    getLink(): Link;
    protected handleErrorEvent(event: EventTypes, error: IEventError, purpose: PURPOSE): void;
    /**
     * The Current method can set a consent checkbox to save card
     *
     * @example
     * widget.enableSaveCardConsentCheckbox();
     *
     */
    enableSaveCardConsentCheckbox(): void;
    /**
     * This method enables the CVV mode for card forms.
     * CVV validation can be enabled using the `enable_cvv_validation` option.
     *
     * @example
     * widget.enableCvvTokenizationMode({ enable_cvv_validation : true });
     *
    */
    enableCvvTokenizationMode(options?: {
        enable_cvv_validation?: boolean;
    }): void;
}

interface IEventMetaData extends IEventData$1 {
    configuration_token: string;
    type: string;
    account_name?: string;
    account_number?: string;
    card_number_last4?: string;
    card_number_length?: number;
    card_scheme?: string;
    gateway_type?: string;
}
interface IEventFinishData extends IEventData$1 {
    address_city?: string;
    address_country?: string;
    address_line1?: string;
    address_line2?: string;
    address_postcode?: string;
    address_state?: string;
    card_scheme?: string;
    email?: string;
    expire_month?: string;
    expire_year?: string;
    first_name?: string;
    last_name?: string;
    payment_source: string;
    payment_source_token?: string;
    phone?: string;
    save_card_consent_accepted?: boolean;
}
/**
 * Interface of data from validation event.
 *
 * @interface IFormValidation
 *
 * @param {string} event The name of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 * @param {boolean} [form_valid] Indicates wether or not the form is valid.
 * @param {Array<string>} [invalid_fields] Names of form fields with invalid data.
 * @param {Array<string>} [invalid_showed_fields] Names of invalid form fields which are already displaying the error.
 * @param {Partial<Record<CardValidatorValue | GenericValidatorValue, Array<string>>>} [validators] Object containing validator identifiers as keys and the fields subject to that validator as an array of form field names.
 *  See list of available [Generic Vallidators]{@link GENERIC_VALIDATORS} and [Card Validators]{@link CARD_VALIDATORS},
 */
/**
 * Contains basic information associated with the event and additional meta data
 * specific to the event. E.g., card info, gateway info, etc.
 *
 * @interface IEventMetaData
 *
 * @param {string} event The name of the event.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 * @param {string} configuration_token Token received from our API with widget data
 * @param {string} type Payment type 'card', 'bank_account'
 * @param {string} gateway_type Gateway type
 * @param {string} [card_number_last4] Last 4 digit of your card
 * @param {string} [card_scheme] Card scheme, e.g., (Visa, Mastercard and American Express (AmEx))
 * @param {number} [card_number_length] Card number length
 * @param {string} [account_name] Bank account account name
 * @param {string} [account_number] Bank account account number
 * */
/**
 * Interface of data from event.
 * @interface IEventAfterLoadData
 *
 * @param {string} event The name of the event.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 * */
/**
 * Interface of data from event.
 * @interface IEventFinishData
 *
 * @param {string} event The name of the event.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 * @param {string} payment_source One time token. Result from this endpoint [API docs](https://docs.paydock.com/#tokens)
 * */
/**
 * List of available event's name
 * @const EVENT
 *
 * @type {object}
 * @param {string} AFTER_LOAD=afterLoad
 * @param {string} SUBMIT=submit
 * @param {string} FINISH=finish
 * @param {string} VALIDATION=validation
 * @param {string} VALIDATION_ERROR=validationError
 * @param {string} SYSTEM_ERROR=systemError
 * @param {string} META_CHANGE=metaChange
 * @param {string} RESIZE=resize
 */
/**
 * List of available event's name
 * @const VAULT_DISPLAY_EVENT
 *
 * @type {object}
 * @param {string} AFTER_LOAD=afterLoad
 * @param {string} SYSTEM_ERROR=system_error
 * @param {string} CVV_SECURE_CODE_REQUESTED=cvv_secure_code_requested
 * @param {string} CARD_NUMBER_SECURE_CODE_REQUESTED=card_number_secure_code_requested
 * @param {string} ACCESS_FORBIDDEN=access_forbidden
 * @param {string} SESSION_EXPIRED=systemError
 * @param {string} SYSTEM_ERROR=session_expired
 * @param {string} OPERATION_FORBIDDEN=operation_forbidden
 */
/**
 * Class HtmlMultiWidget include method for working with html
 * @constructor
 * @extends MultiWidget
 *
 * @param {string} selector - Selector of html element. Container for widget
 * @param {string} publicKey - PayDock users public key
 * @param {(Configuration | string | Configuration[] | string[])} conf - exemplar[s] Configuration class OR configuration token
 * @example
 * var widget = new MultiWidget('#widget', 'publicKey','configurationToken'); // With a pre-created configuration token
 *
 * var widget = new MultiWidget('#widget', 'publicKey',['configurationToken', 'configurationToken2']); // With pre-created configuration tokens
 *
 * var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
 *
 * var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
 *      Configuration(), // default gateway_id,
 *      Configuration('not_configured'), // without gateway,
 *      Configuration('gatewayId'),
 *      Configuration('gatewayId', 'bank_account')
 * ]);
 */
declare class HtmlMultiWidget extends MultiWidget {
    protected container: Container;
    protected iFrame: IFrame;
    protected triggerElement: Trigger;
    protected validationData: IFormValidation;
    /** @constructs */ constructor(selector: string, publicKey: string, conf: any);
    /**
     * Loads the widget.
     *
     * Calling this method results in an iframe element being inserted and rendered in the DOM.
     */
    load(): void;
    /**
     * Registers a form validation callback for validation events.
     */
    protected afterLoad(): void;
    /**
     * Listen to events of widget
     *
     * @example
     *
     * ```javascript
     * widget.on('form_submit', function (data) {
     *      console.log(data);
     * });
     * ```
     *
     * @example
     *
     * ```javascript
     * widget.on('form_submit').then(function (data) {
     *      console.log(data);
     * });
     * ```
     *
     * @typedef {(data: IEventData | IEventMetaData | IEventFinishData | IFormValidation) => void} EventListenerCallback
     *
     * @param {string} eventName - The name of the event that should be listened. Available event names [EVENT]{@link EVENT}.
     * @param {EventListenerCallback} [cb] - A function to be invoked whenever the event occurs.
     *
     * @return {Promise<IEventData | IEventMetaData | IEventFinishData | IFormValidation> | void}
     */
    on(eventName: string): Promise<IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation>;
    on(eventName: string, cb: (data: IEventData$1 | IEventMetaData | IEventFinishData | IFormValidation) => void): any;
    /**
     * Registers callback that will be invoked for every trigger.
     *
     * @param {'submit_form' | 'tab'} triggers - The Widget element identifier that caused the trigger.
     * @param {ITriggerData} data - Data that will be sent to the widget when the trigger occurs.
     */
    trigger(triggerName: string, data?: ITriggerData): void;
    /**
     * Gets a reference to the form current validation state.
     *
     * !Warning: do not directly modify the values of the returned object.
     *
     * @return {IFormValidation} Form validation object
     */
    getValidationState(): IFormValidation;
    /**
     * Checks if a given form is valid.
     *
     * A form is valid if all form fields are valid.
     *
     * @return {boolean} Indicates wether or not form is valid.
     */
    isValidForm(): boolean;
    /**
     * Using this method you can check if a specific form field is invalid
     *
     * @param {string} field - Field name
     * @return {boolean} Field is invalid
     */
    isInvalidField(field?: string): boolean;
    /**
     * Checks if a given form field is displaying an error.
     *
     * @param {string} field - The form field name
     *
     * @return {boolean} Indicates wether or not the Error message is being displayed on the associated field.
     */
    isFieldErrorShowed(field?: string): boolean;
    /**
     * Checks if a given form field is valid or invalid by name.
     *
     * @param {string} field - The form field name
     * @param validator - The name of the validator.
     *
     * @return {boolean} Indicates wether or not the field is invalid based on validator intepretation.
     */
    isInvalidFieldByValidator(field: string, validator: ValidatorFieldsMapKey): boolean;
    /**
     * Hides the widget.
     *
     * E.g., use this method to hide the widget after it loads.
     *
     * @param {boolean} [saveSize=false] Wether the original iframe element size should be saved before being hidden.
     */
    hide(saveSize: boolean): void;
    /**
     * Shows the widget.
     *
     * E.g., use this method to show the widget after it was explicitly hidden.
     */
    show(): void;
    /**
     * Reloads the widget.
     */
    reload(): void;
    /**
     * Hides the specified Widget elements by their identifier.
     *
     * @example
     *
     * ```javascript
     * widget.hideElements(['submit_button', 'email']);
     * ```
     *
     * @param {string[]} elements - List of element which can be hidden [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
     */
    hideElements(elements: string[]): void;
    /**
     * Shows the specified Widget elements by their identifier.
     *
     * @example
     *
     * ```javascript
     * widget.showElements(['submit_button', 'email']);
     * ```
     *
     * @param {string[]} elements - List of elements which can be showed [ELEMENT]{@link ELEMENT} || [FORM_FIELD]{@link FORM_FIELD}
     */
    showElements(elements: string[]): void;
    /**
     * Updates the form field values inside the widget.
     *
     * @example
     *
     * ```javascript
     * widget.updateFormValues({
     *   email: 'predefined@email.com',
     *   card_name: 'Houston'
     * });
     *```
     *
     * @param {IFormValues} fieldValues - Fields with values
     */
    updateFormValues(fieldValues: IFormValues): void;
    /**
     * Updates a single form field values inside the widget by the form field name.
     *
     * @example
     *
     * ```javascript
     * widget.updateFormValue("card_name", "John Doe");
     *```
     *
     * @param {string} key - The form field name
     * @param {string} value - The form field value
     */
    updateFormValue(key: string, value: string): void;
    /**
     * Inserts the event data (after finish event) onto the input field associated with the provided CSS selector.
     *
     * @param {string} selector - A CSS selector. E.g., ".my-class", "#my-id", or others
     * @param {string} dataType - The data type of IEventData object.
     */
    onFinishInsert(selector: string, dataType: string): void;
    /**
     * Intercepts a form submission and delegates processing to the widget.
     *
     * An simplified example of the process:
     * - User clicks submit button in your form
     * - This implicitly triggers a submission to the widget
     * - The widget submits your form
     *
     * @note The widget's submit button will be hidden.
     *
     * @param {string} selector - css selector of your form
     *
     * @example
     *
     * ```html
     * <body>
     *  <form id="myForm">
     *      <input name="amount">
     *      <button type="submit">Submit</button>
     *  </form>
     *  <script>
     *     widget.interceptSubmitForm('#myForm');
     *  </script>
     * </body>
     * ```
     */
    interceptSubmitForm(selector: string): void;
    /**
     * This method hides a submit button and automatically execute form submit
     */
    useCheckoutAutoSubmit(): void;
    /**
     * Use this method for resize iFrame according content height
     *
     * @example
     *
     * ```javascript
     * widget.useAutoResize();
     *```
     */
    useAutoResize(): void;
}

/**
 * Class Widget include method for working on html and include extended by HtmlMultiWidget methods
 * @constructor
 * @extends HtmlMultiWidget
 * @extends MultiWidget
 *
 * @example
 * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID'); // short
 *
 * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID', 'bank_account', 'payment_source'); // extend
 *
 * var widget = new HtmlWidget('#widget', 'publicKey', 'not_configured'); // without gateway
 *
 * @param {string} selector - Selector of html element. Container for widget
 * @param {string} publicKey - PayDock users public key
 * @param {string} [gatewayID=default] - ID of a gateway connected to PayDock. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
 * @param {string} [paymentType=card] - Type of payment source which shows in widget form. Available parameters : “card”, “bank_account”.
 * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
 */
declare class HtmlWidget extends HtmlMultiWidget {
    /** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: PURPOSE);
    /**
     * Destination, where customer will receive all successful responses.
     * Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
     *
     * @example
     * widget.setWebHookDestination('http://google.com');
     *
     * @param {string} url - Your endpoint for post request.
     */
    setWebHookDestination(url: string): void;
    /**
     * URL to which the Customer will be redirected to after the success finish
     *
     * @example
     * widget.setSuccessRedirectUrl('google.com/search?q=success');
     *
     * @param {string}  url
     */
    setSuccessRedirectUrl(url: string): void;
    /**
     * URL to which the Customer will be redirected to if an error is triggered in the process of operation
     *
     * @example
     * widget.setErrorRedirectUrl('google.com/search?q=error');
     *
     * @param {string} url
     */
    setErrorRedirectUrl(url: string): void;
    /**
     *  Set list with widget form field, which will be shown in form. Also you can set the required validation for these fields
     *
     * @example
     * widget.setFormFields(['phone', 'email', 'first_name*']);
     *
     * @param {string[]} fields - name of fields which can be shown in a widget.
     * If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
     */
    setFormFields(fields: string[]): void;
    /**
     * The method to set the full configuration for the all specific form elements (visibility, required, label, placeholder, value)
     * You can also use the other method for the partial configuration like: setFormFields, setFormValues, setFormPlaceholder, setFormLabel
     *
     * @example
     *   widget.setFormElements([
     *       {
     *           field:  'card_name*',
     *           placeholder: 'Input your card holder name...',
     *           label: 'Card Holder Name',
     *           value: 'Houston',
     *       },
     *       {
     *           field:  'email',
     *           placeholder: 'Input your email, like test@example.com',
     *           label: 'Email for the receipt',
     *           value: 'predefined@email.com',
     *       },
     *   ])
     *
     * @param { Object[] } elements - List of elements
     * @param { string } elements[].field - Field name of element. If after a name of a field, you put “*”, this field will be required on client-side. (For validation, you can specify any fields, even those that are shown by default: card_number, expiration, etc... ) [FORM_FIELD]{@link FORM_FIELD}
     * @param { string } elements[].placeholder - Set custom placeholders in form fields
     * @param { string } elements[].label - Set a custom labels near the form field
     * @param { string } elements[].value - Set predefined values for the form field
     */
    setFormElements(elements: IFormElement[]): void;
    setFormElement(element: IFormElement): void;
    /**
       * The method to set meta information for the checkout page
       *
       * @example
       * config.setMeta({
              brand_name: 'paydock',
              reference: '15',
              email: 'wault@paydock.com'
          });
       *
       * @param {IPayPalMeta | IBamboraMeta} object - data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IBamboraMeta]{@link IBamboraMeta}
       */
    setMeta(meta: IPayPalMeta | IBamboraMeta): void;
    setGiftCardScheme(giftCardScheme: any, processingNetwork: any): void;
    disableResultMessage(): void;
}

/**
 * Contains basic information associated with the event.
 *
 * Including event (name), source of the message, purpose and a unique identifier
 * for the event.
 *
 * @interface IEventData
 *
 * @param {string} event The name of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 */
interface IEventData$1 {
    event: string;
    message_source: string;
    purpose: PURPOSE;
    widget_id: string;
    data?: any;
    ref_id?: string;
    error?: IEventError;
}
declare const EVENT$2: {
    readonly AFTER_LOAD: "afterLoad";
    readonly SUBMIT: "submit";
    readonly FINISH: "finish";
    readonly VALIDATION_ERROR: "validationError";
    readonly SYSTEM_ERROR: "systemError";
    readonly ERROR: "error";
    /** @deprecated */
    readonly CHECKOUT_SUCCESS: "checkoutSuccess";
    readonly CHECKOUT_READY: "checkoutReady";
    readonly CHECKOUT_ERROR: "checkoutError";
    readonly CHECKOUT_COMPLETED: "checkoutCompleted";
    readonly CHECKOUT_POPUP_OPEN: "checkoutPopupOpen";
    readonly CHECKOUT_POPUP_CLOSE: "checkoutPopupClose";
    readonly RECOGNITION_TOKEN_REQUESTED: "recognitionTokenRequested";
    readonly RECOGNITION_TOKEN_DROPPED: "recognitionTokenDropped";
    readonly VALIDATION: "validation";
    readonly SELECT: "select";
    readonly UNSELECT: "unselect";
    readonly NEXT: "next";
    readonly PREV: "prev";
    readonly META_CHANGE: "metaChange";
    readonly RESIZE: "resize";
    readonly CHARGE_AUTH_SUCCESS: "chargeAuthSuccess";
    readonly CHARGE_AUTH_REJECT: "chargeAuthReject";
    readonly CHARGE_AUTH_CANCELLED: "chargeAuthCancelled";
    readonly ADDITIONAL_DATA_SUCCESS: "additionalDataCollectSuccess";
    readonly ADDITIONAL_DATA_REJECT: "additionalDataCollectReject";
    readonly CHARGE_AUTH: "chargeAuth";
    readonly DISPATCH_SUCCESS: "dispatchSuccess";
    readonly DISPATCH_ERROR: "dispatchError";
};
type EventTypes = typeof EVENT$2[keyof typeof EVENT$2];
interface Listener {
    event: string;
    listener: (event: any) => void;
    widget_id: string;
}
declare type Listeners = Listener[];
declare class IFrameEvent {
    protected listeners: Listeners;
    constructor(subject: Window | null);
    emit(data: IEventData$1): void;
    on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
    clear(): void;
    private subscribe;
}

declare class Standalone3dsService {
    protected container: Container;
    protected eventEmitter: EventEmitter;
    protected env: string;
    protected alias: string;
    constructor(container: Container, eventEmitter: any);
    load(token: string, options: {
        title: string;
    }): void;
    setEnv(env: string, alias?: string): void;
}

/**
 * List of available token's content formats
 * @enum TOKEN_FORMAT
 *
 * @type {object}
 * @param {string} HTML=html
 */
declare enum TOKEN_FORMAT {
    HTML = "html",
    URL = "url",
    STANDALONE_3DS = "standalone_3ds"
}
/**
 * List of available event's name
 * @const EVENT
 *
 * @type {object}
 * @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
 * @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
 * @param {string} ADDITIONAL_DATA_SUCCESS=additionalDataCollectSuccess
 * @param {string} ADDITIONAL_DATA_REJECT=additionalDataCollectReject
 * @param {string} CHARGE_AUTH=chargeAuth
 */
/**
 * List of available event's name for Standalone 3ds flow
 * @const STANDALONE_3DS_EVENT
 *
 * @type {object}
 * @param {string} CHARGE_AUTH_SUCCESS=chargeAuthSuccess
 * @param {string} CHARGE_AUTH_REJECT=chargeAuthReject
 * @param {string} CHARGE_AUTH_DECOUPLED=chargeAuthDecoupled
 * @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
 * @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
 * @param {string} ERROR=error
*/
/**
 * Class Canvas3ds include method for working on html
 * @constructor
 *
 * @param {string} selector - Selector of html element. Container for widget
 * @param {string} token - Pre authorized token
 * @example
 * var widget = new Canvas3ds('#widget', 'token');
 *
 *
 */
declare class Canvas3ds {
    protected link: Link;
    protected configs: Configuration[];
    protected publicKey: string;
    protected token: {
        content: string;
        format: TOKEN_FORMAT;
        charge_3ds_id: string;
    };
    protected standalone3dsService: Standalone3dsService;
    protected container: Container;
    protected iFrame: IFrame;
    protected event: IFrameEvent;
    protected eventEmitter: EventEmitter;
    /** @constructs */ constructor(selector: string, token: string);
    protected static extractToken(token: string): {
        content: string;
        format: TOKEN_FORMAT;
        charge_3ds_id: string;
    };
    /**
     * The final method to beginning, the load process of widget to html
     *
     */
    load(): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * widget.setEnv('production');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    getEnv(): string;
    on(eventName: string): Promise<IEventData$1>;
    on(eventName: string, cb: (data: IEventData$1) => void): any;
    /**
     * Using this method you can hide widget after load
     * @param {boolean} [saveSize=false] - using this param you can save iframe's size
     */
    hide(saveSize: boolean): void;
    /**
     * Using this method you can show widget after using hide method
     *
     */
    show(): void;
    /**
     * Using this method you can reload widget
     *
     */
    reload(): void;
}

declare class ApiChargeInternal {
    protected api: ApiInternal;
    constructor(api: ApiInternal);
    walletCapture(payload: WalletCaptureBody): Promise<WalletCaptureResponse>;
    walletCallback(payload: WalletCallbackBody): Promise<WalletCallbackResponse>;
    standalone3dsProcess(payload: Standalone3dsProcessBody): Promise<ProcessAuthenticationResponse>;
    standalone3dsHandle(): Promise<HandleResponseInterface>;
}
interface WalletCaptureResponse {
    id: string;
    amount: number;
    currency: string;
    status: string;
}
interface WalletCaptureBody {
    payment_method_id?: string;
    customer?: {
        payment_source?: {
            type?: string;
            card_name?: string;
            card_scheme?: string;
            card_number_last4?: string;
            expire_month?: number;
            expire_year?: number;
            address_line1?: string;
            address_line2?: string;
            address_city?: string;
            address_postcode?: string;
            address_state?: string;
            address_country?: string;
            external_payer_id?: string;
            ref_token?: string;
            wallet_express?: boolean;
        };
    };
}
interface WalletCallbackBody {
    request_type: string;
}
interface WalletCallbackResponse {
    id: string;
    status: string;
    callback_method: string;
    callback_rel: string;
    callback_url: string;
}
interface Standalone3dsProcessBody {
    charge_3ds_id: string;
}
interface HandleResponseInterface {
    status: string;
    error: string;
    result: {
        reference: string;
        reference_2: string;
        identifier: string;
        identifier_2: string;
        identifier_3: string;
        identifier_4: string;
        identifier_5: string;
        type: string;
        status: string;
        status_2: string;
        status_code: string;
        ref_token: string;
        cancellation: string;
        count: string;
        version: string;
        whitelist: {
            status: string;
            source: string;
        };
        result: string;
    };
}
interface ProcessAuthenticationResponse {
    status: string;
    error?: string;
    result?: {
        challenge: string;
        challenge_url: string;
        decoupled_challenge: boolean;
        frictionless: boolean;
        identifier: string;
        identifier_3: string;
        identifier_4: string;
        reference: string;
        reference_2: string;
        secondary_url: string;
        skipped: boolean;
        status: string;
        type: string;
        version: string;
        description?: string;
    };
}

declare class ApiGatewayInternal {
    protected api: ApiInternal;
    constructor(api: ApiInternal);
    getWalletConfig(gateway_id: string): Promise<GetWalletConfigResponse>;
}
interface GetWalletConfigResponse {
    type: string;
    mode: string;
    credentials?: object;
}

declare class ApiServiceInternal {
    protected api: ApiInternal;
    constructor(api: ApiInternal);
    getConfig(service_id: string): Promise<GetConfigResponse>;
}
interface GetConfigResponse {
    type: SERVICE_TYPES;
    merchant: string;
    username: string;
    password: string;
    certificate: string;
    certificate_passphrase: string;
}
declare enum SERVICE_TYPES {
    ACCERTIFY = "Accertify",
    BOOKING = "Booking",
    GPAYMENTS = "GPayments",
    CLICK_TO_PAY = "ClickToPay",
    MASTERCARD_NT = "MastercardSCOF",
    VISA_NT = "VisaVTS",
    FORTER = "Forter",
    APPLE_PAY = "ApplePay",
    GOOGLE_PAY = "GooglePay"
}

declare enum PAYLOAD_FORMAT {
    ENCRYPTED_STRING = "encrypted_string"
}

declare enum SERVICE_GROUP {
    CLICK_TO_PAY = "click_to_pay",
    WALLET = "wallet"
}

/**
 * Token types returned in the OTT (One-Time Token) creation response.
 */
declare enum TOKEN_TYPE {
    /** FPAN - Funding Primary Account Number (Google Pay only). */
    CARD = "card",
    /** DPAN - Device Primary Account Number (Apple Pay & Google Pay). */
    CARD_SCHEME_TOKEN = "card_scheme_token"
}

type WalletType = WALLET_TYPES;
declare enum WALLET_TYPES {
    APPLE_PAY = "apple",
    GOOGLE_PAY = "google"
}

interface CreateOTTResponse {
    temp_token: string;
    token_type: TOKEN_TYPE;
}
interface Billing {
    address_line1: string;
    address_line2: string;
    address_country: string;
    address_city: string;
    address_postcode: string;
    address_state: string;
}
interface CardInfo {
    card_scheme: string;
    card_number_last4?: string;
}
interface CreateOTTData {
    amount: number;
    shipping: Shipping;
    billing: Billing;
    card_info: CardInfo;
    ref_token: string;
}
interface CreateOTTRequest {
    service_id: string;
    service_type: SERVICE_TYPES;
    service_group: SERVICE_GROUP;
    payload: string;
    payload_format: PAYLOAD_FORMAT;
}
interface CreateSessionRequest {
    service_id: string;
    session_id: string;
    request_shipping?: boolean;
    store_name: string;
}
interface CreateSessionResponse {
    id: string;
    status: string;
    callback_method: string;
    callback_rel: string;
    callback_url: string;
}
type CheckoutResponse = ApplePayJS.ApplePayPaymentAuthorizedEvent | google.payments.api.PaymentAuthorizationResult | google.payments.api.PaymentData;
declare enum CheckoutActionCode {
    COMPLETE = "COMPLETE",
    CANCEL = "CANCEL",
    ERROR = "ERROR",
    CHANGE_CARD = "CHANGE_CARD",
    ADD_CARD = "ADD_CARD",
    SWITCH_CONSUMER = "SWITCH_CONSUMER"
}
interface OTTResponse {
    token: string;
    token_type: string;
    three_ds_required?: boolean;
    wallet_type: WalletType;
}
interface Shipping {
    method?: string;
    options?: IShippingOption[];
    address_line1?: string;
    address_line2?: string;
    address_city?: string;
    address_postcode?: string;
    address_state?: string;
    address_country?: string;
    address_company?: string;
    address_origin_postcode?: string;
    contact?: {
        first_name?: string;
        last_name?: string;
        email?: string;
        phone?: string;
        phone2?: string;
    };
}

declare class ApiPaymentSourceInternal {
    protected api: ApiInternal;
    constructor(api: ApiInternal);
    createOTT(payload: CreateOTTRequest): Promise<CreateOTTResponse>;
    createSession(payload: CreateSessionRequest): Promise<CreateSessionResponse>;
}

declare class ApiInternal extends ApiBase {
    charge(): ApiChargeInternal;
    service(): ApiServiceInternal;
    checkout(): ApiCheckoutInternal;
    gateway(): ApiGatewayInternal;
    paymentSource(): ApiPaymentSourceInternal;
}

declare class ApiCheckoutInternal {
    protected api: ApiInternal;
    constructor(api: ApiInternal);
    instructions(): Observable<object>;
    private getInstructionLink;
    callback(payload: Object): Promise<Object>;
    status(id: string): Promise<Object>;
}

type Instruction = new (selector: string, api: ApiInternal, checkoutWidget: Checkout, formSelector?: string) => InstructionHandler & InstructionDestroyable & InstructionDecorated;
interface InstructionHandleable {
    handle(payload: object, eventEmitter: EventEmitter): void;
}
interface InstructionDecorated {
    instruction: string;
}
interface InstructionDestroyable {
    destroy(): void;
}
declare abstract class InstructionHandler implements InstructionHandleable, InstructionDestroyable, InstructionDecorated {
    selector: string;
    api: ApiInternal;
    protected checkoutWidget?: Checkout;
    formSelector?: string;
    constructor(selector: string, api: ApiInternal, checkoutWidget?: Checkout, formSelector?: string);
    instruction: string;
    abstract handle(context: object, eventEmitter?: any): void;
    destroy(): void;
    getEnv(instruction_token: string): string;
}

declare class InstructionModule {
    instructions: any[];
    getInstruction(id: string): Instruction | null;
}

interface IntentTokenPayload {
    env: string;
    intent_id: string;
    version: number;
    env_alias: string;
    whitelist_domains: string[];
}
/**
 * Class CheckoutButton transform usual button into checkout
 *
 * @constructor
 *
 * @param {string} selector - Selector of html element.
 * @param {string} intentToken - PayDock intent token
 * @example
 * var widget = new Checkout('#widget', 'intent_token');
 **/
declare class Checkout {
    protected selector: string;
    protected intentToken: string;
    protected debug: boolean;
    protected window: Window;
    protected eventEmitter: EventEmitter;
    protected container: Container;
    protected intentTokenPayload: IntentTokenPayload;
    protected api: ApiInternal;
    protected checkoutApi: ApiCheckoutInternal;
    protected instructions: InstructionModule;
    protected currentInstruction: InstructionDestroyable & InstructionHandleable;
    private checkoutVersionHandler;
    private timeoutTimer;
    private requestInFlight;
    private inTimeoutRange;
    private checkoutFinished;
    constructor(selector: string, intentToken: string, debug?: boolean);
    fetchInstruction(): void;
    finaliseCheckout(): void;
    private setupTimeoutTimer;
    private extractIntentTokenPayload;
    validateJWTWhitelistedDomains(whitelist_domains: string[]): boolean;
    private ready;
    private initContractVersion;
    private isTimeoutInstruction;
    private handleInstruction;
    private handleTimeoutInstructions;
    private getInstructionFromResponse;
    private extractInstructionPayloadFromResponse;
    private setEnv;
    /**
     * If the payment was successful, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * widget.onPaymentSuccessful((data) => {
     *      console.log('Payment successful!');
     * });
     */
    onPaymentSuccessful(handler: (data: IEventData$1) => void): () => void;
    /**
     * If the payment was not successful, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * widget.onPaymentError((err) => {
     *      console.log('Payment not successful');
     * });
     */
    onPaymentFailure(handler: (data: IEventData$1) => void): () => void;
    /**
     * If the payment was expired, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * widget.onPaymentInReview((data) => {
     *      console.log('Payment in fraud review');
     * });
     */
    onPaymentExpired(handler: (data: IEventData$1) => void): () => void;
    createWidgetStructure(): void;
    private changeLoadingSpinnerVisibility;
}

declare class InstructionDebugger {
    constructor(selector: string, version: number, instructionName: string, context: object, token?: string);
}

/**
 * @type {object}
 * @param {string} CLICK=click
 * @param {string} POPUP_REDIRECT=popup_redirect
 * @param {string} ERROR=error
 * @param {string} ACCEPTED=accepted
 * @param {string} FINISH=finish
 * @param {string} CLOSE=close
 */
declare const CHECKOUT_BUTTON_EVENT: {
    CLICK: string;
    POPUP_REDIRECT: string;
    REDIRECT: string;
    ERROR: string;
    REFERRED: string;
    DECLINED: string;
    CANCELLED: string;
    ACCEPTED: string;
    FINISH: string;
    CLOSE: string;
};
/**
 * @type {object}
 * @param {string} CONTEXTUAL=contextual
 * @param {string} REDIRECT=redirect
 */
declare enum CHECKOUT_MODE {
    CONTEXTUAL = "contextual",
    REDIRECT = "redirect"
}
/**
 * @type {object}
 * @param {string} ZIPMONEY=Zipmoney
 * @param {string} PAYPAL=PaypalClassic
 * @param {string} AFTERPAY=Afterpay
 */
declare enum GATEWAY_TYPE {
    ZIPMONEY = "Zipmoney",
    PAYPAL = "PaypalClassic",
    AFTERPAY = "Afterpay"
}
interface IEventCheckoutFinishData {
    payment_source_token: string;
    checkout_email: string;
    checkout_holder: string;
    gateway_type: string;
}

/**
 * Class Background create overlay for checkout
 *
 * @example
 * var overlay = new Background();
 */
declare class Background {
    protected description: string;
    protected title: string;
    protected overlay: HTMLElement;
    protected style: HTMLStyleElement;
    protected eventEmitter: EventEmitter;
    protected showControl: boolean;
    protected showLoader: boolean;
    constructor();
    initControl(): void;
    initLoader(): void;
    private eventHandler;
    clear(): void;
    private createLoader;
    protected createTemplate(): void;
    private createStyles;
    setBackdropDescription(text: string): void;
    setBackdropTitle(text: string): void;
    onTrigger(triggerName: string, cb: () => void): void;
    isInit(): boolean;
    hideContinueControl(): void;
    turnOffControl(): void;
    turnOffLoader(): void;
}

declare type SuccessCb = (data: any, status: number) => void;
declare type ErrorCb = (err: any, status: number) => void;
declare abstract class HttpCore {
    private env;
    constructor();
    setEnv(env: string, alias?: string): void;
    getEnv(): string;
    protected getUrl(): string;
    protected create(accessToken: string, data: any, cb: SuccessCb, errorCb: ErrorCb): void;
    protected get(accessToken: string, cb: SuccessCb, errorCb: ErrorCb): void;
    protected parser(text: any, status: number, cb: SuccessCb, errorCb: ErrorCb): void;
    protected abstract getLink(): string;
}

interface IBody$1 {
    gateway_id: string;
    success_redirect_url: string;
    error_redirect_url: string;
    redirect_url: string;
    meta: IPayPalMeta;
    description?: string;
}
interface ICheckout {
    gateway_id: string;
    checkout_type: string;
    gateway_type: string;
    link: string;
    reference_id: string;
    token: string;
    mode?: string;
}
declare class Builder$1 extends HttpCore {
    private body;
    constructor(gatewayID: string, successRedirectUrl: string, errorRedirectUrl: string);
    protected getLink(): string;
    setDescriptions(text: string): void;
    setMeta(meta: IPayPalMeta): void;
    getConfigs(): IBody$1;
    send(publicKey: string, cb: (checkout: ICheckout) => void, errorCb?: (error: any, code: string) => void): void;
}

interface IDetails {
    checkout_email: string;
    checkout_holder: string;
    status: string;
    gateway_type: string;
}
declare class Checker extends HttpCore {
    token: string;
    constructor(token: string);
    protected getLink(): string;
    send(accessToken: string, cb: (details: IDetails) => void, errorCb?: (error: any) => void): void;
}

type AdditionalParams = Record<string, string | number | boolean>;
interface IRunner {
    next(checkoutData: ICheckout, params?: AdditionalParams): void;
    error(error: string, code: string, cb: (close: boolean) => void): void;
    getSuccessRedirectUri(): string;
    getErrorRedirectUri(): string;
    setEnv(env: string, alias?: string): void;
}

interface IDispatcherData {
    message_source: string;
    event: string;
}

interface IContextualRunner extends IRunner {
    run(): void;
    isRunning(): boolean;
    continue(): void;
    stop(): void;
    onStop(cb: () => void): void;
    onCheckout<T extends IDispatcherData>(event: string, cb: (checkout: ICheckout, data?: T) => void): void;
    setBackgroundTitle(text: string): void;
    setBackgroundDescription(text: string): void;
    turnOffBackdrop(): void;
    setSuspendedRedirectUri(uri: string): void;
}

interface IRedirectRunner extends IRunner {
    setRedirectUrl(url: string): void;
    getRedirectUrl(): string;
    getProxyRedirectUrl(): string;
}

interface CheckoutContextualHandlerParams {
    accessToken: string;
    gatewayId: string;
}
declare class CheckoutContextualHandler {
    protected background: Background;
    protected runner: IContextualRunner;
    protected eventEmitter: EventEmitter;
    protected params: CheckoutContextualHandlerParams;
    protected env: string;
    protected details: IDetails;
    constructor(background: Background, runner: IContextualRunner, eventEmitter: EventEmitter, params: CheckoutContextualHandlerParams);
    init(env: string): void;
    setEnv(env: string): void;
    protected checkToken(token: string, cb: () => void): void;
    protected createOneTimeToken(token: string): void;
}

/**
 * Class CheckoutButton transform usual button into checkout
 *
 * @constructor
 *
 * @param {string} selector - Selector of html element.
 * @param {string} aceessToken - PayDock access token or users public key
 * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
 * @param {string} [type=PaypalClassic] - Type of gateway (PaypalClassic, Zipmoney)
 * @example
 * var widget = new CheckoutButton('#button', 'accessToken','gatewayId');
 */
declare class CheckoutButton {
    protected accessToken: string;
    protected gatewayId: string;
    protected gatewayType: GATEWAY_TYPE;
    protected mode: CHECKOUT_MODE;
    protected window: Window;
    protected eventEmitter: EventEmitter;
    protected container: Container;
    protected meta: IPayPalMeta;
    protected runner: IContextualRunner | IRedirectRunner;
    protected background?: Background;
    protected checkoutHandler?: CheckoutContextualHandler;
    protected env: string;
    protected alias?: string;
    /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string, gatewayType?: GATEWAY_TYPE, mode?: CHECKOUT_MODE);
    protected chooseRunner(gatewayType: GATEWAY_TYPE, mode: CHECKOUT_MODE): void;
    protected buildAdditionalParams(): AdditionalParams;
    protected initCheckout(container: Container): void;
    /**
     * This callback will be called for each event in payment source widget
     *
     * @callback listener
     */
    /**
     * Listen to events of widget
     *
     * @example
     *
     * widget.on('click', function () {
     *
     * });
     * @param {string} eventName - Available event names [CHECKOUT_BUTTON_EVENT]{@link CHECKOUT_BUTTON_EVENT}
     * @param {listener} cb
     */
    on<T = object>(name: string, handler: (data: T) => void): void;
    /**
     * Close popup window forcibly.
     * Only for 'contextual' mode.
     *
     */
    close(): void;
    /**
     * After finish event of checkout button, data (dataType) will be insert to input (selector)
     *
     * @param {string} selector - css selector . [] #
     * @param {string} dataType - data type of IEventCheckoutFinishData [IEventCheckoutFinishData]{@link #IEventCheckoutFinishData}.
     */
    onFinishInsert(selector: string, dataType: string): void;
    /**
     * Method for setting meta information for checkout page
     *
     * @example
     * button.setMeta({
            brand_name: 'paydock',
            reference: '15',
            email: 'wault@paydock.com'
        });
     *
     * @param {(IPayPalMeta|IAfterpayMeta|IZipmoneyMeta)} meta - Data which can be shown on checkout page [IPayPalMeta]{@link IPayPalMeta} [IZipmoneyMeta]{@link IZipmoneyMeta} [IAfterpayMeta]{@link IAfterpayMeta}
     */
    setMeta(meta: IPayPalMeta | IAfterpayMeta | IZipmoneyMeta): void;
    /**
     * Method for setting backdrop description.
     * Only for 'contextual' mode.
     *
     * @example
     * button.setBackdropDescription('Custom description');
     *
     * @param {string} text - description which can be shown in overlay of back side checkout page
     */
    setBackdropDescription(text: string): void;
    /**
     * Method for setting backdrop title.
     * Only for 'contextual' mode.
     *
     * @example
     * button.setBackdropTitle('Custom title');
     *
     * @param {text} string - title which can be shown in overlay of back side checkout page
     */
    setBackdropTitle(text: string): void;
    /**
     * Method for setting suspended redirect uri. Redirect after referred checkout.
     * Only for 'contextual' mode.
     *
     * @param {uri} string - uri for redirect (by default)
     */
    setSuspendedRedirectUri(uri: string): void;
    /**
     * Method for setting the merchant redirect URL.
     * Merchant's customers redirect after successfull checkout.
     * Only for 'redirect' mode.
     *
     * @param {url} string - redirect url
     */
    setRedirectUrl(url: string): void;
    getSuccessRedirectUri(): string;
    /**
     * Method for disable backdrop on the page.
     * Only for 'contextual' mode.
     *
     * @example
     * button.turnOffBackdrop();
     *
     */
    turnOffBackdrop(): void;
    protected turnOffControlBackdrop(): void;
    protected turnOffLoaderBackdrop(): void;
    setEnv(env: string, alias?: string): void;
    getEnv(): string;
    private getRunnerByMode;
    private assertMethodSupport;
}

interface ZipmoneyRunnerParams extends AdditionalParams {
    gateway_id: string;
    public_key: string;
}

/**
 * Class ZipmoneyCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
 *
 * @extends CheckoutButton
 *
 * @constructor
 *
 * @param {string} selector - Selector of html element.
 * @param {string} publicKey - PayDock users public key
 * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
 * @param {string} [gatewayId=default] - Checkout mode, it could be set to 'contextual' or 'redirect'. By default it 'contextual'
 * @example
 * var widget = new ZipmoneyCheckoutButton('#button', 'publicKey','gatewayId');
 */
declare class ZipmoneyCheckoutButton extends CheckoutButton {
    protected publicKey: string;
    protected gatewayId: string;
    protected mode: CHECKOUT_MODE;
    /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string, mode?: CHECKOUT_MODE);
    /**
       * Method for setting suspended redirect uri. Redirect after referred checkout
       *
       * The URI is used for a redirect after the checkout is complete.
       * This can be provided, even if using in-context checkout (sdk). By default, the standard styled page will be used.
       * If using in-context (sdk) we will not automatically redirect to this URI.
       *
  
       * @param {uri} string - uri for suspended redirect (by default)
       */
    setSuspendedRedirectUri(uri: string): void;
    /**
     * Method for setting the merchant redirect URL.
     * The merchant's customers would be redirected to the specified URL
     * at the end of ZipMoney checkout flow.
     *
     * Once the redirect URL would be set, the checkout flow would be immediately switched
     * from 'contextual' mode to the 'redirect' mode.
     * The merchant's customer would be automatically redirected to this URL after the checkout is complete.
     *
     * @param {url} string - URL for redirect
     */
    setRedirectUrl(url: string): void;
    protected buildAdditionalParams(): ZipmoneyRunnerParams;
    /**
     * Subscribe to the click event with an async handler.
     * The checkout flow will wait for the async handler to complete before proceeding.
     * If the handler resolves to `false`, the checkout flow will be cancelled.
     *
     * @param handler - Async function to be called when the button is clicked
     *
     * @example
     * button.onClick(async () => {
     *     const isValid = await fetchDataFromServer();
     *     return isValid; // return false to stop checkout
     * });
     */
    onClick<T>(handler: (data?: T) => Promise<boolean | void>): void;
}

/**
 * Class AfterpayCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
 *
 * @extends CheckoutButton
 *
 * @constructor
 *
 * @param {string} selector - Selector of html element.
 * @param {string} accessToken - PayDock access-token or users public key
 * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
 * @example
 * var widget = new AfterpayCheckoutButton('#button', 'access-token','gatewayId');
 */
declare class AfterpayCheckoutButton extends CheckoutButton {
    protected accessToken: string;
    protected gatewayId: string;
    protected showETP: boolean;
    /** @constructs */ constructor(selector: string, accessToken: string, gatewayId?: string);
    /**
     * Method which toggles the "Enhanced Tracking Protection" warning popup to 'on' mode.
     *
     * This popup with a warning about "Enhanced Tracking Protection" limitations
     * would be shown in the Mozilla Firefox browser version 100+
     *
     * By default, the popup would not be shown, until
     * the flag would be set to `true`

     * @param {doShow} boolean - flag which toggle the popup visibility
     */
    showEnhancedTrackingProtectionPopup(doShow: boolean): void;
    protected buildAdditionalParams(): AdditionalParams;
}

/**
 * Class PaypalCheckoutButton is wrapper of CheckoutButton transform usual button into checkout
 *
 * @extends CheckoutButton
 *
 * @constructor
 *
 * @param {string} selector - Selector of html element.
 * @param {string} publicKey - PayDock users public key
 * @param {string} [gatewayId=default] - PayDock's gatewayId. By default or if put 'default', it will use the selected default gateway
 * @example
 * var widget = new PaypalCheckoutButton('#button', 'publicKey','gatewayId');
 */
declare class PaypalCheckoutButton extends CheckoutButton {
    protected publicKey: string;
    protected gatewayId: string;
    /** @constructs */ constructor(selector: string, publicKey: string, gatewayId?: string);
}

type Mode = (typeof MODES)[number];
declare const MODES: readonly ["live", "test"];
type FraudPreventionProvider = (typeof PROVIDERS)[keyof typeof PROVIDERS];
declare const PROVIDERS: {
    readonly FORTER: "forter";
};

declare const NAMESPACE = "fraudPrevention";
declare const TYPES: {
    readonly FINGERPRINT_TOKEN_ERROR: "fingerprint-token-error";
    readonly FINTERPRINT_TOKEN_READY: "fingerprint-token-ready";
};
declare const FRAUD_PREVENTION_EVENTS: {
    readonly NAMESPACE: "fraudPrevention";
    readonly TYPES: {
        readonly FINGERPRINT_TOKEN_ERROR: "fingerprint-token-error";
        readonly FINTERPRINT_TOKEN_READY: "fingerprint-token-ready";
    };
    readonly PROVIDERS: {
        readonly FORTER: "forter";
    };
};
type FraudPreventionEventType = (typeof TYPES)[keyof typeof TYPES];
type FraudPreventionEventFingerprintTokenReady = {
    type: Extract<FraudPreventionEventType, 'fingerprint-token-ready'>;
    provider: FraudPreventionProvider;
    payload: {
        token: string;
    };
};
type FraudPreventionEventFingerprintTokenError = {
    type: Extract<FraudPreventionEventType, 'fingerprint-token-error'>;
    provider: FraudPreventionProvider;
    payload: {
        code: 'unexpected_token_type';
        message: string;
    };
};
type FraudPreventionEvent = FraudPreventionEventFingerprintTokenReady | FraudPreventionEventFingerprintTokenError;
interface IFraudPreventionEventMap {
    [NAMESPACE]: CustomEvent<FraudPreventionEvent>;
}
declare global {
    interface DocumentEventMap extends IFraudPreventionEventMap {
    }
}

type ResultFailure<F> = Readonly<[null, F]>;
type ResultSuccess<S> = Readonly<[S, null]>;
type Result<S = unknown, F = unknown> = ResultFailure<F> | ResultSuccess<S>;

/**
 * Configuration options for the Forter Device Agent
 *
 * @typedef {Object} ForterDeviceAgentConfig
 * @property {string} siteId - Your Forter site ID or subsite merchant ID
 * @property {boolean} csp - Set to true if your site uses Content-Security-Policy
 * @property {'live' | 'test'} mode - Environment mode, must be either 'live' or 'test'
 */
type ForterDeviceAgentConfig = {
    siteId: string;
    csp: boolean;
    mode: Mode;
};
/**
 * A class that manages Forter's device fingerprinting integration.
 * It handles script injection and token management.
 *
 * @example
 *
 * ```js
 * const agent = new ForterDeviceAgent({
 *   siteId: 'your-site-id',
 *   csp: false,
 *   mode: 'test'
 * }).init();
 *
 * // Later, access the token
 * const token = agent.token;
 * ```
 */
declare class ForterDeviceAgent {
    private readonly config;
    private cookieToken;
    /**
     * Creates a new instance of ForterDeviceAgent
     *
     * @param {ForterDeviceAgentConfig} config - Configuration object for Forter integration
     */
    constructor(config: ForterDeviceAgentConfig);
    /**
     * Returns the current Forter token if available
     *
     * @returns {string | null} The Forter token or null if not yet available
     *
     * @example
     *
     * ```js
     * const token = forterAgent.token;
     * if (token) {
     *   // Use the token
     * }
     * ```
     */
    get token(): string | null;
    /**
     * Initializes the Forter Device Agent by injecting the required script
     * and setting up event listeners.
     *
     * @returns {ForterDeviceAgent} The current instance for method chaining
     *
     * @example
     *
     * ```js
     * const agent = new ForterDeviceAgent(config).init();
     * ```
     */
    init(): ForterDeviceAgent;
    private emit;
    private emitFingerprintTokenWrongTypeError;
    private emitFingerprintTokenReady;
    private getScriptContent;
    private injectScript;
    private subscribeSdkEvents;
    private validateCsp;
    private validateMode;
    private validateSiteId;
}

type FraudPreventionConfig = {
    mode: Mode;
    environmentAlias?: string;
    environmentId: string;
};
/**
 * A class to manage integration fraud prevention integrations.
 *
 * @example
 *
 * ```js
 * const fps = new FraudPreventionService({
 *   environmentId: 'production',
 *   mode: 'live',
 * });
 * ```
 */
declare class FraudPreventionService {
    private readonly environment;
    private readonly httpFetcherFactory;
    private readonly mode;
    private authorizationStrategy;
    private forterDeviceAgent;
    /**
     * @constructs
     *
     * @param {Object} config - FraudPreventionService configuration object
     * @param {string} config.mode - Environment mode, must be either 'test' or 'live'
     * @param {string} config.environmentId - Environment identifier
     * @param {string} [config.environmentAlias] - Optional environment alias for API requests
     */
    constructor(config: FraudPreventionConfig);
    /**
     * Automatically detects and sets the authorization strategy the service should use
     * based on the shape of the provided string.
     *
     * If the value is a JWT token, it will use an access token strategy, otherwise it will use
     * a public key strategy.
     *
     * @param value - The authorization value (either JWT token or public key)
     *
     * @returns The FraudPreventionService instance for method chaining
     *
     * @example
     * ```ts
     * // With JWT token
     * fps.withAuthorization('eyJhbGciOiJIUzI1NiIs...');
     *
     * // With public key
     * fps.withAuthorization('pk_example_...');
     * ```
     */
    withAuthorization(value: string): FraudPreventionService;
    /**
     * Sets the authorization strategy to use access token authentication.
     *
     * @param accessToken - The JWT access token
     * @returns The FraudPreventionService instance for method chaining
     *
     * @example
     *
     * ```ts
     * fps.withAccessTokenStrategy('eyJhbGciOiJIUzI1NiIs...');
     * ```
     */
    withAccessTokenStrategy(accessToken: string): FraudPreventionService;
    /**
     * Sets the authorization strategy to use public key authentication.
     *
     * @param publicKey - The public key
     * @returns The FraudPreventionService instance for method chaining
     *
     * @example
     *
     * ```ts
     * fps.withPublicKeyStrategy('pk_example_...');
     * ```
     */
    withPublicKeyStrategy(publicKey: string): FraudPreventionService;
    /**
     * Initializes Forter integration with the provided configuration. This method injects
     * Forter's JavaScript snippet into the page and starts tracking user behavior.
     *
     * @param {Object} config - Configuration object for Forter integration
     * @param {string} [config.siteId] - Your Forter site ID or subsite merchant ID
     * @param {string} [config.providerId] - Your Paydock integrated Forter Service ID.
     * @param {boolean} [config.csp] - Set to true if your site uses Content-Security-Policies
     *
     * @throws If neither siteId nor providerId are provided in the configuration
     * @throws If providerId fails to resolve to a siteId through Paydock integration services
     *
     * @returns Promise with existing FraudPreventionService instance
     *
     * @example
     *
     * ```js
     * await fps.withForter({
     *   providerId: 'your-paydock-forter-service-id'
     * });
     * ```
     *
     * @example
     *
     * ```js
     * await fps.withForter({
     *   siteId: 'your-forter-site-id',
     * });
     * ```
     */
    withForter(config: {
        csp?: boolean;
    } & ({
        siteId: string;
        providerId?: never;
    } | {
        siteId?: never;
        providerId: string;
    })): Promise<this>;
    /**
     * Returns the initialized Forter device agent instance if available.
     *
     * Make sure to call withForter() before accessing this getter.
     *
     * @returns {ForterDeviceAgent | null} The Forter device agent instance or null if not initialized
     *
     * @example
     *
     * ```js
     * const fps = new FraudPreventionService();
     *
     * fps.withForter({
     *   siteId: 'your-site-id',
     *   mode: 'test'
     * });
     *
     * const token = fps.forter?.token;
     * ```
     */
    get forter(): ForterDeviceAgent | null;
    /**
     * Gets the credentials for a specific fraud prevention provider.
     *
     * Returns different credential types based on the selected provider.
     *
     * @param provider - The fraud prevention provider
     * @param providerId - The ID of the provider instance
     *
     * @returns a tuple with shape [providerSpecificCredentials, error]
     */
    getProviderCredentials<P extends FraudPreventionProvider>(provider: P, providerId: string): Promise<Result<P extends "forter" ? {
        provider: "forter";
        siteId: string;
        subsiteId: string;
    } : never, unknown>>;
    private validateEnvironmentId;
    private validateEnvironmentAlias;
    private validateMode;
}

/**
 * Operations that can fail during the wallet lifecycle.
 * Used in {@link OnErrorPayload.context.operation} to identify what failed.
 */
declare enum ERROR_OPERATION {
    /** General wallet lifecycle operation. */
    WALLET_OPERATION = "wallet_operation",
    /** Loading or validating the wallet service configuration. */
    CONFIGURATION = "configuration",
    /** A required event handler was not registered before calling load(). */
    HANDLER_REGISTRATION = "handler_registration",
    /** Processing a shipping address or shipping option update. */
    SHIPPING_UPDATE = "shipping_update"
}

/**
 * Events emitted during the OpenWallet payment lifecycle.
 */
declare enum EVENT$1 {
    /** Emitted when the wallet button is clicked by the user. */
    ON_CLICK = "onClick",
    /** Emitted when the OTT (One-Time Token) creation succeeds. */
    SUCCESS = "success",
    /** Emitted when the wallet is not available on the current device/browser. */
    UNAVAILABLE = "unavailable",
    /** Emitted when an error occurs during wallet operation. */
    ERROR = "error",
    /** Emitted when the wallet button has been loaded and rendered in the DOM. */
    LOADED = "loaded",
    /** Emitted when the wallet checkout is closed/cancelled by the user (internal). */
    CHECKOUT_CLOSE = "checkoutClose",
    /** Emitted when the customer selects or updates their shipping address. */
    ON_SHIPPING_ADDRESS_CHANGE = "onShippingAddressChange",
    /** Emitted when the customer selects a shipping option. */
    ON_SHIPPING_OPTIONS_CHANGE = "onShippingOptionsChange"
}
type OpenWalletEventType = EVENT$1;

/**
 * Base interface for all OpenWallet event data payloads.
 * Every event emitted during the OpenWallet lifecycle carries an `event` identifier
 * that corresponds to a value from the {@link EVENT} enum.
 *
 * All concrete event interfaces (e.g. {@link OnClickEventData}, {@link OnErrorEventData})
 * extend this base.
 */
interface OpenWalletBaseEvent {
    /** The event name identifier. */
    event: EVENT$1;
}
/**
 * Extended base interface for OpenWallet events that carry a typed data payload
 * in addition to the event identifier.
 *
 * Used by events whose payload is wrapped in a `data` field
 * (e.g. shipping change events, OTT error events).
 *
 * @template T - The type of the event-specific data payload.
 */
interface OpenWalletDataEvent<T> extends OpenWalletBaseEvent {
    /** The event-specific data payload. */
    data?: T | undefined;
}

/**
 * Data emitted when the wallet button is clicked.
 *
 * The merchant's `onClick` handler controls the payment flow via its return value:
 * - Return `void` / `undefined` to continue normally.
 * - Return `false` to abort the payment flow.
 * - Return a `Promise<void>` to defer the wallet sheet until the promise resolves.
 * - Return a `Promise<boolean>` — if it resolves to `false`, the flow is aborted.
 * - Throwing an error also aborts the flow.
 */
interface OnClickEventData$1 extends OpenWalletBaseEvent {
    event: EVENT$1.ON_CLICK;
}
/**
 * Payload for the onSuccess event data.
 */
interface OnCreateOTTSuccessPayload {
    /** The created OTT response containing the temporary token. */
    token: CreateOTTResponse;
    /** The payment amount. */
    amount: number;
    /** The shipping address and contact information, if provided. */
    shipping?: Shipping;
    /** The billing address, if provided. */
    billing?: Billing;
}
/**
 * Data emitted when the OTT (One-Time Token) creation is successful.
 */
interface OnCreateOTTSuccessfulEventData extends OpenWalletDataEvent<OnCreateOTTSuccessPayload> {
    event: EVENT$1.SUCCESS;
}
/**
 * Payload for the OTT error event data.
 */
interface OnCreateOTTErrorPayload {
    /** Error message from the API. */
    message?: string;
    /** Error code from the API. */
    code?: string;
}
/**
 * Data emitted when the OTT creation fails.
 */
interface OnCreateOTTErrorEventData extends OpenWalletDataEvent<OnCreateOTTErrorPayload> {
    event: EVENT$1.ERROR;
}
/**
 * Typed details for the unavailable event.
 */
interface OnUnavailableDetails {
    /** The service ID that was checked. */
    service_id: string;
}
/**
 * Payload for the onUnavailable event data.
 */
interface OnUnavailablePayload {
    /** A human-readable reason why the wallet is unavailable. */
    reason: string;
    /** Additional details about the unavailability. */
    details?: OnUnavailableDetails;
}
/**
 * Data emitted when the wallet is not available on the current device or browser.
 */
interface OnUnavailableEventData$1 extends OpenWalletDataEvent<OnUnavailablePayload> {
    event: EVENT$1.UNAVAILABLE;
}
/**
 * Payload for the onError event data.
 */
interface OnErrorPayload {
    /** The Error object describing what went wrong. */
    error: Error;
    /** Context about the error. */
    context?: {
        /** The operation that failed. */
        operation?: ERROR_OPERATION;
    };
}
/**
 * Data emitted when an error occurs during wallet operation.
 */
interface OnErrorEventData$1 extends OpenWalletDataEvent<OnErrorPayload> {
    event: EVENT$1.ERROR;
}
/**
 * Data emitted when the wallet button has been loaded and rendered in the DOM.
 * No payload — the specific wallet type is determined by the concrete button class.
 */
interface OnLoadedEventData extends OpenWalletBaseEvent {
    event: EVENT$1.LOADED;
}
/**
 * Data emitted when the wallet checkout is cancelled or closed by the user.
 * No payload — matches WalletButtonsExpress `OnCloseEventData` convention.
 */
interface OnCancelEventData extends OpenWalletBaseEvent {
    event: EVENT$1.CHECKOUT_CLOSE;
}

/**
 * Base metadata required to configure an OpenWallet button.
 */
interface OpenWalletMeta {
    /** The payment amount as a number (e.g. `19.99`). */
    amount: number;
    /** The ISO 4217 currency code (e.g. `'AUD'`, `'USD'`). */
    currency: string;
    /** The ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). */
    country: string;
    /** Optional styling configuration for the wallet button. */
    style?: OpenWalletMetaStyles;
}
/**
 * Styling options for the wallet button appearance.
 */
interface OpenWalletMetaStyles {
    /** The button type variant (wallet-specific values). */
    button_type?: string;
    /** The button color/style variant (wallet-specific values). */
    button_style?: string;
}

/**
 * Internal contract for wallet-specific service providers (Apple Pay, Google Pay, etc.).
 *
 * This interface defines the operations that the wallet-specific button classes
 * ({@link ApplePayOpenWalletButton}, {@link GooglePayOpenWalletButton}) delegate
 * to the resolved wallet service after fetching the service configuration.
 *
 * **Note:** This is NOT the merchant-facing API. Merchants interact with
 * {@link ApplePayOpenWalletButton} or {@link GooglePayOpenWalletButton} directly,
 * which orchestrate these providers internally.
 */
interface IOpenWalletProvider {
    /**
     * Loads the wallet SDK, checks availability, and renders the wallet button.
     * If the wallet is not available, emits the `unavailable` event instead.
     */
    load(): Promise<void>;
    /**
     * Removes the wallet button from the DOM and releases resources.
     */
    destroy(): void;
    /**
     * Updates the wallet metadata (e.g. when order amount or currency changes).
     *
     * @param meta - The updated metadata.
     */
    setMeta(meta: OpenWalletMeta): void;
}

/**
 * Event data emitted when the customer selects or updates their shipping address
 * in the wallet payment sheet.
 */
interface OnShippingAddressChangeEventData$1 extends OpenWalletDataEvent<AddressChangeEventData$1> {
    event: EVENT$1.ON_SHIPPING_ADDRESS_CHANGE;
}
/**
 * The shipping address data provided by the wallet.
 */
interface AddressChangeEventData$1 {
    /** Postal/zip code of the shipping address. */
    address_postcode?: string;
    /** City of the shipping address. */
    address_city?: string;
    /** State or administrative area of the shipping address. */
    address_state?: string;
    /** Country code of the shipping address. */
    address_country?: string;
    /** Street address line 1 (Apple Pay only). */
    address_line1?: string;
    /** Street address line 2 (Apple Pay only). */
    address_line2?: string;
    /** Contact information for the shipping recipient (Apple Pay only). */
    contact?: {
        phone?: string;
        email?: string;
        first_name?: string;
        last_name?: string;
    };
}

/**
 * Event data emitted when the customer selects a shipping option
 * in the wallet payment sheet.
 */
interface OnShippingOptionChangeEventData$1 extends OpenWalletDataEvent<ShippingOptionChangeEventData$1> {
    event: EVENT$1.ON_SHIPPING_OPTIONS_CHANGE;
}
/**
 * The selected shipping option data provided by the wallet.
 */
interface ShippingOptionChangeEventData$1 {
    /** The unique identifier of the selected shipping option. */
    shipping_option_id?: string;
    /** The amount associated with the selected shipping option. */
    amount?: string;
    /** The display label of the selected shipping option. */
    label?: string;
    /** Additional detail text for the selected shipping option. */
    detail?: string;
}

/**
 * Response object returned by the merchant's `onShippingAddressChange` handler.
 * Used to update the wallet payment sheet with new amounts, shipping options, or errors.
 */
interface OnShippingAddressChangeEventResponse$1 {
    /** The updated payment amount based on the new shipping address. */
    amount?: number;
    /**
     * Updated list of available shipping options for the new address.
     * The first item in the array is used as the default selected option.
     */
    shipping_options?: IShippingOption[];
    /** Optional error to display in the wallet payment sheet if the address is invalid. */
    error?: {
        /** The error code identifying the type of address validation error. */
        code: 'address_error' | 'country_error' | 'state_error' | 'zip_error' | 'shipping_contact_invalid' | 'billing_contact_invalid' | string;
        /** The specific field that caused the error (for Apple Pay error display). */
        field?: 'phone' | 'email' | 'name' | 'phonetic_name' | 'address_lines' | 'locality' | 'postal_code' | 'administrative_area' | 'country' | 'country_code';
        /** A human-readable error message to display to the customer. */
        message?: string;
    };
}

/**
 * Response object returned by the merchant's `onShippingOptionsChange` handler.
 * Used to update the wallet payment sheet with a new total amount.
 */
interface OnShippingOptionChangeEventResponse$1 {
    /** The updated total payment amount based on the selected shipping option. */
    amount?: number;
    /** Optional error to display in the wallet payment sheet if the option is invalid. */
    error?: {
        /** The error code identifying the type of shipping option error. */
        code: 'method_unavailable' | 'store_unavailable' | string;
        /** A human-readable error message. */
        message?: string;
    };
}

/**
 * Conditional type that maps a shipping event data type to its corresponding response type.
 *
 * - `OnShippingAddressChangeEventData` maps to `OnShippingAddressChangeEventResponse`
 * - `OnShippingOptionChangeEventData` maps to `OnShippingOptionChangeEventResponse`
 *
 * @template T - The shipping event data type.
 */
type ShippingEventToResponse$1<T> = T extends OnShippingAddressChangeEventData$1 ? OnShippingAddressChangeEventResponse$1 : T extends OnShippingOptionChangeEventData$1 ? OnShippingOptionChangeEventResponse$1 : never;

/**
 * Abstract base class for wallet-specific OpenWallet service implementations.
 *
 * Provides shared functionality for OTT creation, shipping event handling,
 * error/unavailable emission, and DOM cleanup. Concrete implementations
 * (e.g. Apple Pay, Google Pay) extend this class and implement {@link load} and {@link setMeta}.
 *
 * @implements {IOpenWalletProvider}
 */
declare abstract class OpenWalletService implements IOpenWalletProvider {
    protected api: ApiInternal;
    protected eventEmitter: EventEmitter;
    protected walletType: WalletType;
    protected serviceId: string;
    protected container: Container;
    protected serviceType: SERVICE_TYPES;
    /** The service group identifier used in OTT creation requests. */
    protected readonly serviceGroup = SERVICE_GROUP.WALLET;
    /**
     * @param api - API client for backend communication.
     * @param eventEmitter - Shared event emitter for wallet lifecycle events.
     * @param walletType - The wallet type identifier (e.g. `'apple'`, `'google'`).
     * @param serviceId - The service ID for the wallet configuration.
     * @param container - The DOM container that holds the wallet button.
     * @param serviceType - The service type from the API configuration.
     */
    constructor(api: ApiInternal, eventEmitter: EventEmitter, walletType: WalletType, serviceId: string, container: Container, serviceType: SERVICE_TYPES);
    /**
     * Loads and renders the wallet button. Must be implemented by each wallet service.
     */
    abstract load(): Promise<void>;
    /**
     * Updates the wallet metadata. Must be implemented by each wallet service.
     *
     * @param meta - The updated metadata.
     */
    abstract setMeta(meta: OpenWalletMeta): void;
    /**
     * Creates a One-Time Token (OTT) by sending the payment data to the API.
     * Emits {@link EVENT.SUCCESS} on success or {@link EVENT.ERROR} on failure.
     *
     * @param data - The payment data including amount, shipping, billing, card info, and ref token.
     * @returns A promise resolving to the OTT response.
     */
    protected createOTT(data: CreateOTTData): Promise<CreateOTTResponse>;
    /**
     * Delegates a shipping change event to the merchant's registered handler
     * and returns the merchant's response.
     *
     * @param eventData - The shipping address or option change event data.
     * @returns A promise resolving to the merchant's shipping update response.
     * @throws {Error} If no handler is registered or the handler returns no result.
     */
    protected handleMerchantOnShippingChangedEvent<T extends OnShippingAddressChangeEventData$1 | OnShippingOptionChangeEventData$1>(eventData: T): Promise<ShippingEventToResponse$1<T>>;
    /**
     * Emits the {@link EVENT.UNAVAILABLE} event when the wallet is not available.
     *
     * @param reason - A human-readable description of why the wallet is unavailable.
     */
    protected handleOnUnavailable(reason?: string): void;
    /**
     * Emits the {@link EVENT.ERROR} event and logs the error to the console.
     *
     * @param error - The error that occurred.
     * @param operation - The operation that failed. Defaults to {@link ERROR_OPERATION.WALLET_OPERATION}.
     */
    protected handleOnError(error: Error, operation?: ERROR_OPERATION): void;
    /**
     * Removes the wallet button element from the DOM.
     * Call this to clean up resources when the button is no longer needed.
     */
    destroy(): void;
}

/**
 * @classdesc Abstract base class for Open Wallet buttons. **Do not instantiate directly.**
 * Use {@link ApplePayOpenWalletButton} or {@link GooglePayOpenWalletButton} instead.
 *
 * Use one of the concrete implementations instead:
 * - {@link ApplePayOpenWalletButton} for Apple Pay integration
 * - {@link GooglePayOpenWalletButton} for Google Pay integration
 *
 * These subclasses inherit all event handlers and lifecycle methods documented below.
 *
 * @class OpenWalletButtons
 * @abstract
 * @hideconstructor
 */
declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWalletMeta> {
    protected container: Container;
    protected api: ApiInternal;
    protected env: string;
    protected serviceId: string;
    protected meta: TMeta;
    protected eventEmitter: EventEmitter;
    protected walletService: OpenWalletService | undefined;
    private onShippingOptionsChangeHandlerRegistered;
    /** @private */
    abstract readonly walletType: WalletType;
    /** @private */
    constructor(selector: string, publicKeyOrAccessToken: string, serviceId: string, meta: TMeta);
    /**
     * Creates the wallet-specific service instance for this button.
     * Each concrete subclass implements this to instantiate its specific wallet service.
     *
     * @param serviceConfig - The service configuration response from the API.
     * @returns The wallet service instance.
     */
    protected abstract createWalletService(serviceConfig: GetConfigResponse): OpenWalletService;
    /**
     * Validates that the service configuration type matches the expected wallet type.
     * Each concrete subclass implements this to ensure the service ID corresponds
     * to the correct wallet type.
     *
     * @param serviceConfig - The service configuration response from the API.
     * @throws {Error} If the service type does not match the expected wallet type.
     */
    protected abstract validateServiceType(serviceConfig: GetConfigResponse): void;
    /**
     * Validates wallet-specific metadata requirements.
     * Each concrete subclass implements this to enforce its own required fields
     * (e.g. Apple Pay requires `amount_label`).
     *
     * Called automatically during construction after base meta validation.
     *
     * @throws {Error} If any wallet-specific required field is missing or invalid.
     */
    protected abstract validateWalletMeta(): void;
    private getApiAuthType;
    /**
     * Validates the base metadata fields common to all wallet types:
     * `meta` must exist, `amount` must be a number, `currency` and `country` must be strings.
     *
     * @private
     * @throws {Error} If any base required field is missing or has an invalid type.
     */
    private validateBaseMeta;
    protected getOpenWalletServiceConfig(): Promise<GetConfigResponse>;
    protected handleOnError(error: Error, operation?: ERROR_OPERATION): void;
    /**
     * Loads and initializes the wallet button based on the service configuration.
     * This method fetches the wallet service configuration, validates that the service
     * type matches the expected wallet, and creates the appropriate wallet service instance.
     * Bear in mind that you must call this method after setting up all event handlers.
     *
     * @example
     * button.onClick((data) => { ... });
     * button.onSuccess((data) => { ... });
     * button.onError((error) => { ... });
     * button.load();
     */
    load(): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     * Bear in mind that you must set an environment before calling `button.load()`.
     *
     * @example
     * button.setEnv('production', 'paydock.com');
     *
     * @param {string} env - The target environment: `'sandbox'` or `'production'`.
     * @param {string} [alias] - Own domain alias.
     */
    setEnv(env: string, alias?: string): void;
    /**
     * Updates the wallet metadata after initialization.
     * Use this when order information changes (e.g. amount, currency) after the button has been rendered.
     * Bear in mind that this must be called before the next payment attempt takes effect.
     *
     * @example
     * button.setMeta({ ...meta, amount: 29.99 });
     *
     * @param {ApplePayOpenWalletMeta | GooglePayOpenWalletMeta} meta - The updated metadata object. The concrete type depends on the button class.
     */
    setMeta(meta: TMeta): void;
    /**
     * Removes the wallet button from the DOM and cleans up resources.
     * Call this method when the wallet button is no longer needed (e.g. navigating away from the payment page).
     *
     * @example
     * button.destroy();
     */
    destroy(): void;
    /**
     * Callback for onClick method.
     *
     * @callback OnClickCallback
     * @param {OnClickEventData} data - The click event data.
     * @returns {boolean | void | Promise<boolean | void>} Return `false` to abort, or a Promise to defer.
     */
    /**
     * Registers a callback function to be invoked when the wallet button gets clicked.
     * The handler controls the wallet payment flow via its return value:
     *
     * - Return `void` (or nothing) to continue the payment flow normally.
     * - Return `false` to abort the payment flow.
     * - Return a `Promise<void>` to defer the wallet sheet until the promise resolves.
     * - Return a `Promise<boolean>` — if it resolves to `false`, the flow is aborted.
     * - Throwing an error (sync or async) also aborts the flow.
     *
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * **Note:** this callback may be called multiple times as the customer closes the payment
     * checkout and re-clicks the button.
     *
     * @example
     * // Synchronous usage — continue normally
     * button.onClick((event) => {
     *   performValidationLogic();
     * });
     *
     * @example
     * // Synchronous abort — return false to cancel the payment
     * button.onClick((event) => {
     *   if (!isOrderValid()) return false;
     * });
     *
     * @example
     * // Asynchronous usage — defer wallet sheet until the promise resolves
     * button.onClick(async (event) => {
     *   await fetch('/validate-order').then(res => res.json());
     * });
     *
     * @param {OnClickCallback} handler - Function to be called when the wallet button is clicked.
     */
    onClick(handler: (data: OnClickEventData$1) => boolean | undefined | Promise<boolean | undefined>): void;
    /**
     * Callback for onSuccess method.
     *
     * @callback OnSuccessCallback
     * @param {OnCreateOTTSuccessfulEventData} data - The OTT creation result including the token, amount, and address data.
     */
    /**
     * Registers a callback function to be invoked when the OTT (One-Time Token) creation was successful.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * **Important:** A handler is required. Do not perform thread blocking operations in callback such as `window.alert()` calls.
     *
     * **Error handling:** If the handler throws (sync or async), the error is logged and swallowed
     * so that internal processing continues uninterrupted.
     *
     * @example
     * button.onSuccess((event) => {
     *   console.log('OTT created:', event.data.token.temp_token);
     *   console.log('Amount:', event.data.amount);
     * });
     *
     * @example
     * // Async handler
     * button.onSuccess(async (event) => {
     *   await submitTokenToServer(event.data.token.temp_token);
     * });
     *
     * @param {OnSuccessCallback} handler - Function to be called when the OTT creation was successful.
     */
    onSuccess(handler: (data: OnCreateOTTSuccessfulEventData) => void | Promise<void>): void;
    /**
     * Callback for onUnavailable method.
     *
     * @callback OnUnavailableCallback
     * @param {OnUnavailableEventData} data - Data describing why the wallet is unavailable.
     */
    /**
     * Registers a callback function to be invoked when the wallet is not available in the current context.
     * This can happen when the wallet service is not supported on the current device or browser.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * **Error handling:** If the handler throws (sync or async), the error is logged and swallowed
     * so that internal processing continues uninterrupted.
     *
     * @example
     * button.onUnavailable((event) => {
     *   console.log('Wallet not available:', event.data.reason);
     * });
     *
     * @param {OnUnavailableCallback} handler - Function to be called when the wallet is not available in the current context.
     */
    onUnavailable(handler: (data: OnUnavailableEventData$1) => void | Promise<void>): void;
    /**
     * Callback for onError method.
     *
     * @callback OnErrorCallback
     * @param {OnErrorEventData} data - The error event data including the Error object and context.
     */
    /**
     * Registers a callback function to be invoked when an error occurs during wallet operation.
     * This includes configuration issues, validation errors, and OTT creation failures.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * **Error handling:** If the handler throws (sync or async), the error is logged and swallowed
     * so that internal processing continues uninterrupted.
     *
     * @example
     * button.onError((event) => {
     *   console.error('Wallet error:', event.data.error.message);
     *   console.log('Context:', event.data.context);
     * });
     *
     * @param {OnErrorCallback} handler - Function to be called when the wallet has an error.
     */
    onError(handler: (data: OnErrorEventData$1) => void | Promise<void>): void;
    /**
     * Callback for onCancel method.
     *
     * @callback OnCancelCallback
     * @param {OnCancelEventData} data - Data associated with the cancellation event.
     */
    /**
     * Registers a callback function to be invoked when the wallet checkout is cancelled or closed by the user.
     * This event is triggered when the user dismisses the wallet payment interface without completing the transaction.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * **Error handling:** If the handler throws (sync or async), the error is logged and swallowed
     * so that internal processing continues uninterrupted.
     *
     * @example
     * button.onCancel((event) => {
     *   console.log('Wallet checkout cancelled', event);
     * });
     *
     * @param {OnCancelCallback} handler - Function to be called when the wallet checkout is cancelled.
     */
    onCancel(handler: (data: OnCancelEventData) => void | Promise<void>): void;
    /**
     * Registers a callback function to be invoked when the wallet button has been loaded and rendered in the DOM.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * **Error handling:** If the handler throws (sync or async), the error is logged and swallowed
     * so that internal processing continues uninterrupted.
     *
     * @example
     * button.onLoaded((event) => {
     *   console.log('Wallet button loaded');
     * });
     *
     * @param {Function} handler - Function to be called when the wallet button is loaded.
     */
    onLoaded(handler: (data: OnLoadedEventData) => void | Promise<void>): void;
    /**
     * Callback for onShippingAddressChange method.
     *
     * @callback OnShippingAddressChangeCallback
     * @param {OnShippingAddressChangeEventData} data - The shipping address data from the wallet.
     * @returns {OnShippingAddressChangeEventResponse | Promise<OnShippingAddressChangeEventResponse>} Address update result containing updated amount, shipping options, and optional error.
     */
    /**
     * Registers a callback for when the customer selects or updates their shipping address.
     * Use this method to listen for shipping address selection or input from customer when shipping is enabled.
     * The event handler should return updated payment information including the new amount and
     * available shipping options based on the selected address.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * In case of an address validation error, include the `error` field in the response
     * to display an appropriate error in the wallet payment sheet.
     *
     * @example
     * // Async handler
     * button.onShippingAddressChange(async (data) => {
     *   const response = await fetch('https://your-server.com/update-shipping-address', {
     *     method: 'POST',
     *     body: JSON.stringify(data),
     *   });
     *   const result = await response.json();
     *   return {
     *     amount: result.newAmount,
     *     shipping_options: result.availableShippingOptions,
     *   };
     * });
     *
     * @example
     * // Sync handler
     * button.onShippingAddressChange((data) => {
     *   return {
     *     amount: calculateShipping(data.data.address_country),
     *     shipping_options: getOptionsForCountry(data.data.address_country),
     *   };
     * });
     *
     * @param {OnShippingAddressChangeCallback} handler - Function to be called when the shipping address data is updated.
     */
    onShippingAddressChange(handler: (data: OnShippingAddressChangeEventData$1) => OnShippingAddressChangeEventResponse$1 | Promise<OnShippingAddressChangeEventResponse$1>): () => void;
    /**
     * Callback for onShippingOptionsChange method.
     *
     * @callback OnShippingOptionsChangeCallback
     * @param {OnShippingOptionChangeEventData} data - The selected shipping option data.
     * @returns {OnShippingOptionChangeEventResponse | Promise<OnShippingOptionChangeEventResponse>} Shipping options update result containing the updated amount.
     */
    /**
     * Registers a callback for when the customer selects a shipping option.
     * Use this method to listen for shipping option selection from customer when shipping is enabled.
     * The event handler should return the updated payment amount based on the selected shipping option.
     * Both synchronous and asynchronous (async) handlers are supported.
     *
     * @example
     * // Async handler
     * button.onShippingOptionsChange(async (data) => {
     *   const response = await fetch('https://your-server.com/update-shipping-option', {
     *     method: 'POST',
     *     body: JSON.stringify({ shipping_option_id: data.data.shipping_option_id }),
     *   });
     *   const result = await response.json();
     *   return {
     *     amount: result.newTotalAmount,
     *   };
     * });
     *
     * @example
     * // Sync handler
     * button.onShippingOptionsChange((data) => {
     *   return {
     *     amount: lookupShippingCost(data.data.shipping_option_id),
     *   };
     * });
     *
     * @param {OnShippingOptionsChangeCallback} handler - Function to be called when the shipping options data is updated.
     */
    onShippingOptionsChange(handler: (data: OnShippingOptionChangeEventData$1) => OnShippingOptionChangeEventResponse$1 | Promise<OnShippingOptionChangeEventResponse$1>): () => void;
    /**
     * Whether a shipping options change handler has been registered.
     * Used internally by wallet services to validate shipping configuration.
     *
     * @private
     * @returns {boolean} `true` if an `onShippingOptionsChange` handler has been registered.
     */
    get isShippingOptionsChangeHandlerRegistered(): boolean;
}

type ApplePayMerchantCapability = 
/**
 * Required. This value must be supplied.
 */
'supports3DS'
/**
 * Include this value only if you support China Union Pay transactions.
 */
 | 'supportsEMV'
/**
 * Optional. If present, only transactions that are categorized as credit cards are allowed.
 */
 | 'supportsCredit'
/**
 * Optional. If present, only transactions that are categorized as debit cards are allowed.
 */
 | 'supportsDebit';
type ApplePayContactField = 'email' | 'name' | 'phone' | 'postalAddress';
interface ApplePayPaymentContact {
    /**
     * An email address for the contact.
     */
    email_address?: string | undefined;
    /**
     * The contact's family name.
     */
    family_name?: string | undefined;
    /**
     * The contact's given name.
     */
    given_name?: string | undefined;
    /**
     * A phone number for the contact.
     */
    phone_number?: string | undefined;
    /**
     * The phonetic spelling of the contact's family name.
     */
    phonetic_family_name?: string | undefined;
    /**
     * The phonetic spelling of the contact's given name.
     */
    phonetic_given_name?: string | undefined;
    /**
     * The street portion of the address for the contact.
     */
    address_lines?: string[] | undefined;
    /**
     * The city for the contact.
     */
    locality?: string | undefined;
    /**
     * Additional information associated with the location, typically defined at the city or town level (such as district or neighborhood), in a postal address.
     */
    sub_locality?: string | undefined;
    /**
     * The state for the contact.
     */
    administrative_area?: string | undefined;
    /**
     * The subadministrative area (such as a county or other region) in a postal address.
     */
    sub_administrative_area?: string | undefined;
    /**
     * The zip code or postal code, where applicable, for the contact.
     */
    postal_code?: string | undefined;
    /**
     * The name of the country for the contact.
     */
    country?: string | undefined;
    /**
     * The contact's two-letter ISO 3166 country code.
     */
    country_code?: string | undefined;
}
type ApplePayShippingContactEditingMode = 
/**
 * The user can edit the shipping contact on the payment sheet.
 */
'available'
/**
 * The user can’t edit the shipping contact on the payment sheet.
 */
 | 'storePickup'
/**
 * The user can edit the shipping contact on the payment sheet.
 * @deprecated Use ApplePayShippingContactEditingMode.available instead.
 */
 | 'enabled';
type ApplePayLineItemType = 
/**
 * A line item representing the known, final cost.
 */
'final'
/**
 * A line item representing an estimated or unknown cost.
 */
 | 'pending';
/**
 * A type that indicates the time a payment occurs in a transaction.
 */
type ApplePayPaymentTiming = 
/**
 * A value that specifies that the payment occurs when the transaction is complete.
 */
'immediate'
/**
 * A value that specifies that the payment occurs in the future.
 */
 | 'deferred'
/**
 * A value that specifies that the payment occurs on a regular basis.
 */
 | 'recurring'
/**
 * A value that specifies that the payment occurs automatically when the account falls below the automaticReloadPaymentThresholdAmount amount.
 */
 | 'automaticReload';
/**
 * A type that indicates calendrical units, such as year, month, day, and hour.
 */
type ApplePayRecurringPaymentDateUnit = 
/**
 * A value that specifies the year unit.
 */
'year'
/**
 * A value that specifies the month unit.
 */
 | 'month'
/**
 * A value that specifies the day unit.
 */
 | 'day'
/**
 * A value that specifies the hour unit.
 */
 | 'hour'
/**
 * A value that specifies the minute unit.
 */
 | 'minute';
/**
 * Defines a line item in a payment request - for example, total, tax, discount, or grand total.
 */
interface ApplePayLineItem {
    /**
     * A short, localized description of the line item.
     */
    label: string;
    /**
     * The line item's amount.
     */
    amount: string;
    /**
     * A value that indicates if the line item is final or pending.
     */
    type?: ApplePayLineItemType | undefined;
    /**
     * The time that the payment occurs as part of a successful transaction.
     */
    payment_timing?: ApplePayPaymentTiming;
    /**
     * The date of the first payment.
     */
    recurring_payment_start_date?: Date;
    /**
     * The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval.
     */
    recurring_payment_interval_unit?: ApplePayRecurringPaymentDateUnit;
    /**
     * The number of interval units that make up the total payment interval.
     */
    recurring_payment_interval_count?: number;
    /**
     * The date of the final payment.
     */
    recurring_payment_end_date?: Date;
    /**
     * The date, in the future, of the payment.
     */
    deferred_payment_date?: Date;
    /**
     * The balance an account reaches before the merchant applies the automatic reload amount.
     */
    automatic_reload_payment_threshold_amount?: string;
}
/**
 * A type that indicates how purchased items are to be shipped.
 */
type ApplePayShippingType = 'shipping' | 'delivery' | 'storePickup' | 'servicePickup';
/**
 * When specifying a range using date components, provide all elements of the ApplePayDateComponents down to the level of granularity that you want to expose.
 * For example, if you specify a range of days, be sure to include values for both months and years in addition to days in the ApplePayDateComponents.
 *
 * Apple Pay on the Web uses the Gregorian calendar when processing dates.
 */
interface ApplePayDateComponents {
    /**
     * A number that represents a day.
     */
    days: number;
    /**
     * A number between 1 and 12 that represents a month.
     */
    months: number;
    /**
     * A number that represents a year.
     */
    years: number;
    /**
     * A number that represents an hour.
     */
    hours: number;
}
/**
 * A dictionary that specifies the start and end dates for a range of time.
 */
interface ApplePayDateComponentsRange {
    /**
     * The start date and time of the range.
     */
    start_date_components: ApplePayDateComponents;
    /**
     * The end date and time of the range.
     */
    end_date_components: ApplePayDateComponents;
}
/**
 * Defines a shipping method for delivering physical goods.
 */
interface ApplePayShippingMethod {
    /**
     * A short description of the shipping method.
     */
    label: string;
    /**
     * A further description of the shipping method.
     */
    detail: string;
    /**
     * The amount associated with this shipping method.
     */
    amount: string;
    /**
     * A client-defined identifier.
     */
    identifier: string;
    /**
     * A dictionary that specifies the start and end dates for a range of time.
     */
    date_components_range?: ApplePayDateComponentsRange;
}
/**
 * Use ApplePayPaymentTokenContext to authorize a payment amount for each payment token in a multimerchant payment request.
 * To enable multiple merchants for a transaction, use one ApplePayPaymentTokenContext object for each merchant.
 *
 * You can optionally associate each payment token with the merchant’s top-level domain.
 */
interface ApplePayPaymentTokenContext {
    /**
     * The Apply Pay merchant identifier.
     */
    merchant_identifier: string;
    /**
     * An external identifier for the merchant.
     */
    external_identifier: string;
    /**
     * The merchant's display name that the Apple Pay server associates with the payment token.
     */
    merchant_name: string;
    /**
     * The merchant's top-level domain that the Apple Pay server associates with the payment token.
     */
    merchant_domain?: string;
    /**
     * The amount to authorize for the payment token context.
     */
    amount: string;
}
/**
 * Use an ApplePayAutomaticReloadPaymentRequest object to provide the user with payment details and a way to manage payment methods for an automatic reload payment.
 * You can optionally display a billing agreement and set up merchant token life-cycle notifications for the request.
 * For more information about the merchant token life-cycle notifications, see Apple Pay Merchant Token Management API.
 *
 * Apple Pay issues an Apple Pay Merchant Token if the user’s payment network supports merchant-specific payment tokens.
 * Otherwise, Apple Pay issues a device token for the payment request.
 */
interface ApplePayAutomaticReloadPaymentRequest {
    /**
     * A description of the automatic reload payment that Apple Pay displays in the payment sheet.
     */
    payment_description: string;
    /**
     * A line item that contains the reload amount and balance threshold for the automatic reload payment.
     */
    automatic_reload_billing: ApplePayLineItem;
    /**
     * A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment.
     */
    billing_agreement?: string;
    /**
     * A URL to a web page where the user can update or delete the payment method for the automatic reload payment.
     */
    management_url: string;
    /**
     * A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
     */
    token_notification_url?: string;
}
/**
 * A dictionary that represents a request to set up a recurring payment, typically a subscription.
 *
 * Important
 * You must include the recurringPaymentRequest property in the ApplePayPaymentRequest object to specify a request for a recurring payment.
 * Use an ApplePayRecurringPaymentRequest object to provide the user with payment details and a way to manage payment methods for a recurring payment.
 * You can optionally display a billing agreement and set up merchant token life-cycle notifications for the request.
 */
interface ApplePayRecurringPaymentRequest {
    /**
     * A description of the recurring payment that Apple Pay displays to the user in the payment sheet.
     */
    payment_description: string;
    /**
     * A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment.
     */
    billing_agreement?: string;
    /**
     * The regular billing cycle for the recurring payment, including start and end dates, an interval, and an interval count.
     */
    regular_billing: ApplePayLineItem;
    /**
     * The trial billing cycle for the recurring payment.
     */
    trial_billing?: ApplePayLineItem;
    /**
     * A URL to a web page where the user can update or delete the payment method for the recurring payment.
     */
    management_url: string;
    /**
     * A URL you provide for receiving life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
     */
    token_notification_url?: string;
}
/**
 * A dictionary that represents a request to set up a deferred payment, such as a hotel booking or a pre-order.
 */
interface ApplePayDeferredPaymentRequest {
    /**
     * The localized billing agreement the framework displays to the user prior to payment authorization.
     */
    billing_agreement?: string | undefined;
    /**
     * A dictionary that contains details about the deferred payment.
     */
    deferred_billing: ApplePayLineItem;
    /**
     * The date and time at the destination location of the payment.
     */
    free_cancellation_date?: Date | undefined;
    /**
     * The time zone at the destination location of the payment.
     */
    free_cancellation_date_time_zone?: string | undefined;
    /**
     * A URL that links to a page on your web site where the user can manage the payment method for the deferred payment, including deleting it.
     */
    management_url: string;
    /**
     * A description of the deferred payment.
     */
    payment_description: string;
    /**
     * A URL to receive life-cycle notifications for the merchant-specific payment token the system issues for the request, if applicable.
     */
    token_notification_url?: string | undefined;
}
/**
 * Values you use to enable or disable Apple Pay Later for a specific transaction.
 */
type ApplePayLaterAvailability = 
/**
 * Apple Pay Later is available.
 * This is the default.
 */
'available'
/**
 * Apple Pay Later is unavailable because one or more ineligible or prohibited items are in the shopping cart, such as gift cards
 */
 | 'unavailableItemIneligible'
/**
 * Apple Pay Later is unavailable because there’s a recurring payment or subscription in the shopping cart.
 */
 | 'unavailableRecurringTransaction';
interface ApplePayPaymentRequest {
    /**
     * An array of the payment capabilities that the merchant supports, such as credit or debit.
     * The value must at least contain ApplePayMerchantCapability.supports3DS.
     */
    merchant_capabilities: ApplePayMerchantCapability[];
    /**
     * The payment networks supported by the merchant.
     */
    supported_networks: string[];
    /**
     * The merchant's two-letter ISO 3166 country code.
     */
    country_code: string;
    /**
     * The billing information that you require from the user in order to process the transaction.
     */
    required_billing_contact_fields?: ApplePayContactField[] | undefined;
    /**
     * Billing contact information for the user.
     */
    billing_contact?: ApplePayPaymentContact | undefined;
    /**
     * The shipping information that you require from the user in order to fulfill the order.
     */
    required_shipping_contact_fields?: ApplePayContactField[] | undefined;
    /**
     * Shipping contact information for the user.
     */
    shipping_contact?: ApplePayPaymentContact | undefined;
    /**
     * Optional user-defined data.
     */
    application_data?: string | undefined;
    /**
     * A list of ISO 3166 country codes for limiting payments to cards from specific countries.
     */
    supported_countries?: string[] | undefined;
    /**
     * A Boolean value that determines whether the payment sheet displays the coupon code field.
     */
    supports_coupon_code?: boolean | undefined;
    /**
     * The initial coupon code for the payment request.
     */
    coupon_code?: string | undefined;
    /**
     * A value that indicates whether the shipping mode prevents the user from editing the shipping address.
     */
    shipping_contact_editing_mode?: ApplePayShippingContactEditingMode;
    /**
     * A line item representing the total for the payment.
     */
    total: ApplePayLineItem;
    /**
     * A set of line items that explain recurring payments and/or additional charges.
     */
    line_items?: ApplePayLineItem[] | undefined;
    /**
     * The three-letter ISO 4217 currency code for the payment.
     */
    currency_code: string;
    /**
     * How the items are to be shipped.
     */
    shipping_type?: ApplePayShippingType | undefined;
    /**
     * A set of shipping method objects that describe the available shipping methods.
     */
    shipping_methods?: ApplePayShippingMethod[] | undefined;
    /**
     * An array of payment token contexts that requests multiple payment tokens to support a multimerchant payment.
     */
    multi_token_contexts?: ApplePayPaymentTokenContext[];
    /**
     * A property that requests an automatic reload payment, such as a store card top-up.
     */
    automatic_reload_payment_request?: ApplePayAutomaticReloadPaymentRequest;
    /**
     * This property is optional. Use it to indicate that the payment request is for a recurring payment.
     * Apple Pay issues an Apple Pay Merchant Token if the user's payment network supports merchant-specific payment tokens.
     * Otherwise, Apple Pay issues a device token for the payment request.
     *
     * Important
     * You can't use this property with multi_token_contexts or automatic_reload_payment_request properties.
     * Simultaneous use of these properties results in an error and cancels the payment request.
     */
    recurring_payment_request?: ApplePayRecurringPaymentRequest;
    /**
     * A property that requests a deferred payment, such as a hotel booking or a pre-order.
     */
    deferred_payment_request?: ApplePayDeferredPaymentRequest;
    /**
     * A value that indicates whether Apple Pay Later is available for a transaction.
     */
    apple_pay_later_availability?: ApplePayLaterAvailability;
}

type ApplePayButtonStyle$1 = 'black' | 'white' | 'white-outline';

type ApplePayButtonType$1 = 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';

declare global {
    interface Window {
        ApplePaySession: ApplePaySession;
    }
}
interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
    button_type?: ApplePayButtonType$1;
    button_style?: ApplePayButtonStyle$1;
}
interface ApplePayOpenWalletMeta extends OpenWalletMeta, ApplePayPaymentRequest {
    amount_label: string;
    store_name: string;
    /** Whether shipping address collection is required. */
    request_shipping?: boolean;
    /**
     * Available shipping options to display in the payment sheet.
     * The first item in the array is used as the default selected option.
     * Requires `request_shipping` to be `true`.
     */
    shipping_options?: IApplePayShippingOption$1[];
    show_billing_address?: boolean;
    style?: ApplePayOpenWalletMetaStyles;
    apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
}

/**
 * @classdesc Apple Pay wallet button that creates One-Time Tokens (OTT) via Apple Pay.
 *
 * Provides a fully typed Apple Pay integration with Apple Pay-specific metadata
 * and validates that the service configuration corresponds to an Apple Pay service.
 * On `load()`, the button fetches the service configuration and raises an error via `onError`
 * if the service type does not match Apple Pay.
 *
 * @class ApplePayOpenWalletButton
 * @extends OpenWalletButtons
 *
 * @param {string} selector - CSS selector of the HTML element that will contain the Apple Pay button.
 * @param {string} publicKeyOrAccessToken - Public key or access token for API authentication.
 * @param {string} serviceId - The Apple Pay service ID configured in PayDock dashboard.
 * @param {ApplePayOpenWalletMeta} meta - Apple Pay-specific metadata (amount, currency, country, amount_label, store_name, style, apple_pay_capabilities, etc.).
 *
 * @example
 * const button = new ApplePayOpenWalletButton(
 *   '#wallet-container',
 *   publicKeyOrAccessToken,
 *   serviceId,
 *   {
 *     amount: 100,
 *     currency: 'AUD',
 *     country: 'AU',
 *     amount_label: 'TOTAL',
 *     store_name: 'My Store',
 *     apple_pay_capabilities: ['credentials_available'],
 *   },
 * );
 * button.setEnv('sandbox');
 * button.onSuccess((data) => console.log('OTT:', data.token));
 * button.onError((error) => console.error('Error:', error));
 * button.load();
 */
declare class ApplePayOpenWalletButton extends OpenWalletButtons<ApplePayOpenWalletMeta> {
    /** @private */
    readonly walletType: WalletType;
    /**
     * Validates Apple Pay-specific required metadata fields.
     * Apple Pay requires `amount_label` and `store_name` to be present and strings.
     *
     * @private
     * @throws {Error} If `amount_label` is missing or not a string.
     * @throws {Error} If `store_name` is missing or not a string.
     */
    protected validateWalletMeta(): void;
    /**
     * Validates that the service configuration type is Apple Pay.
     *
     * @private
     * @param serviceConfig - The service configuration response from the API.
     * @throws {Error} If the service type is not Apple Pay.
     */
    protected validateServiceType(serviceConfig: GetConfigResponse): void;
    /**
     * Creates an Apple Pay wallet service instance.
     *
     * @private
     * @param serviceConfig - The service configuration response from the API.
     * @returns The Apple Pay wallet service instance.
     */
    protected createWalletService(serviceConfig: GetConfigResponse): OpenWalletService;
}

type GooglePayButtonColor = 'default' | 'black' | 'white';

type GooglePayButtonSizeMode = 'static' | 'fill';

type GooglePayButtonType = 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'pay' | 'plain' | 'subscribe';

type GooglePayAuthMethod = 'PAN_ONLY' | 'CRYPTOGRAM_3DS';
type GooglePayCardNetwork = 'AMEX' | 'DISCOVER' | 'ELECTRON' | 'ELO' | 'ELO_DEBIT' | 'INTERAC' | 'JCB' | 'MAESTRO' | 'MASTERCARD' | 'VISA';
type BillingAddressFormat = 'MIN' | 'FULL';
interface GooglePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
    button_type?: GooglePayButtonType;
    button_size_mode?: GooglePayButtonSizeMode;
    button_color?: GooglePayButtonColor;
}
interface GooglePayOpenWalletMeta extends OpenWalletMeta {
    merchant_name?: string;
    /** Whether shipping address collection is required. */
    request_shipping?: boolean;
    show_billing_address?: boolean;
    /**
     * Available shipping options to display in the payment sheet.
     * The first item in the array is used as the default selected option.
     * Requires `request_shipping` to be `true`.
     */
    shipping_options?: IGooglePayShippingOption[];
    amount_label?: string;
    style?: GooglePayOpenWalletMetaStyles;
    card_config?: GooglePayCardConfig;
}
interface GooglePayCardConfig {
    type: 'CARD' | 'PAYPAL';
    parameters: {
        allowed_auth_methods: GooglePayAuthMethod[];
        allowed_card_networks: GooglePayCardNetwork[];
        allow_prepaid_cards?: boolean;
        allow_credit_cards?: boolean;
        assurance_details_required?: boolean;
        billing_address_required?: boolean;
        billing_address_parameters?: {
            format: BillingAddressFormat;
            phone_number_required?: boolean;
        };
        card_network_parameters?: {
            card_network: GooglePayCardNetwork;
            acquirer_bin?: string;
            acquirer_merchant_id?: string;
        }[];
    };
    tokenization_specification?: {
        type: 'PAYMENT_GATEWAY';
        parameters: {
            [key: string]: string;
        };
    } | {
        type: 'DIRECT';
        parameters: {
            protocol_version: string;
            public_key: string;
        };
    };
}

/**
 * @classdesc Google Pay wallet button that creates One-Time Tokens (OTT) via Google Pay.
 *
 * Provides a fully typed Google Pay integration with Google Pay-specific metadata
 * and validates that the service configuration corresponds to a Google Pay service.
 * On `load()`, the button fetches the service configuration and raises an error via `onError`
 * if the service type does not match Google Pay.
 *
 * @class GooglePayOpenWalletButton
 * @extends OpenWalletButtons
 *
 * @param {string} selector - CSS selector of the HTML element that will contain the Google Pay button.
 * @param {string} publicKeyOrAccessToken - Public key or access token for API authentication.
 * @param {string} serviceId - The Google Pay service ID configured in PayDock dashboard.
 * @param {GooglePayOpenWalletMeta} meta - Google Pay-specific metadata (amount, currency, country, card_config, merchant_name, style, etc.).
 *
 * @example
 * const button = new GooglePayOpenWalletButton(
 *   '#wallet-container',
 *   publicKeyOrAccessToken,
 *   serviceId,
 *   {
 *     amount: 100,
 *     currency: 'AUD',
 *     country: 'AU',
 *     merchant_name: 'Your Store',
 *   },
 * );
 * button.setEnv('sandbox');
 * button.onSuccess((data) => console.log('OTT:', data.token));
 * button.onError((error) => console.error('Error:', error));
 * button.load();
 */
declare class GooglePayOpenWalletButton extends OpenWalletButtons<GooglePayOpenWalletMeta> {
    /** @private */
    readonly walletType: WalletType;
    /**
     * Validates Google Pay-specific required metadata fields.
     * Google Pay has no additional required fields beyond the base (amount, currency, country).
     * @private
     */
    protected validateWalletMeta(): void;
    /**
     * Validates that the service configuration type is Google Pay.
     *
     * @private
     * @param serviceConfig - The service configuration response from the API.
     * @throws {Error} If the service type is not Google Pay.
     */
    protected validateServiceType(serviceConfig: GetConfigResponse): void;
    /**
     * Creates a Google Pay wallet service instance.
     *
     * @private
     * @param serviceConfig - The service configuration response from the API.
     * @returns The Google Pay wallet service instance.
     */
    protected createWalletService(serviceConfig: GetConfigResponse): OpenWalletService;
}

declare const TYPE: {
    EXTERNAL_CHECKOUT_TOKEN: string;
    CHECKOUT_TOKEN: string;
    BANK_ACCOUNT: string;
    CARD: string;
};
interface IBody {
    gateway_id: string;
    type: string;
    checkout_token?: string;
}
declare class Builder extends HttpCore {
    private body;
    constructor(gatewayID: string, checkoutToken: string, type: string);
    constructor(gatewayID: string, externalCheckoutToken: string, type: string);
    constructor(gatewayID: string, card: any, type: string);
    constructor(gatewayID: string, bankAccount: any, type: string);
    protected getLink(): string;
    send(accessToken: string, cb: (token: string) => void, errorCb?: (error: any) => void): void;
    getConfigs(): IBody;
}

/**
 *
 * Class PaymentSourceWidget include method for for creating iframe url
 * @constructor
 *
 * @param {string} publicKey - PayDock users public key
 * @param {string} customer - PayDock's customer_id or customer_reference (In order to use the customer_reference, you must explicitly specify useReference as true)
 * @param {boolean} [useReference=false]
 *
 * @example
 * var widget = new PaymentSourceWidget('publicKey','customerId');
 * // or
 * var widget = new PaymentSourceWidget('publicKey', customerReference, true);
 */
declare class PaymentSourceWidget {
    protected link: Link;
    protected configs: Configuration[];
    protected configTokens: string[];
    protected publicKey: string;
    /** @constructs */ constructor(accessToken: string, queryToken: string);
    /**
     * Object contain styles for widget
     *
     * @example
     * widget.setStyles({
     *       background_color: 'rgb(0, 0, 0)',
     *       border_color: 'yellow',
     *       text_color: '#FFFFAA',
     *       icon_size: 'small',
     *       font_size: '20px'
     *   });
     * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
     */
    setStyles(styles: IStyles$1): void;
    setStyle(param: string, value: string): void;
    /**
     * Current method can set custom ID to identify the data in the future
     *
     * @example
     * widget.setRefId('id');
     *
     * @param {string} refId - custom id
     */
    setRefId(refId: string): void;
    /**
     * Current method can set limit for payment sources count. In case when limit sets less then general count will be shown pagination buttons prev and next.
     *
     * @param {string} count - payment source count
     */
    setLimit(count: number): void;
    /**
     * Current method can change environment. By default environment = sandbox
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * widget.setEnv('production');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    getEnv(): void;
    /**
     * Method for getting iframe's url
     */
    getIFrameUrl(): string;
    /**
     * Show payment source inside widget only with requested gateway ids
     *
     *
     * @param {string[]} ids - List of gateway_id
     */
    filterByGatewayIds(ids: string[]): void;
    /**
     *
     * Show payment source inside widget only with requested payment source types
     *
     * @param types - List of payment source types. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
     */
    filterByTypes(types: string[]): void;
    /**
     * Method for setting a custom language code
     *
     * @example
     * config.setLanguage('en');
     * @param {string} code - ISO 639-1
     */
    setLanguage(code: any): void;
}

interface IEventSelectData extends IEventData$1 {
    customer_id: string;
    payment_source_id: string;
    gateway_id: string;
    primary: boolean;
    card_number_last4?: string;
    card_scheme?: string;
    checkout_email?: string;
    gateway_type?: string;
    payment_source_type: string;
    account_name?: string;
    account_number?: string;
}
interface IEventPaginationData extends IEventData$1 {
    total_item: number;
    skip: number;
    limit: number;
}
interface IEventAfterLoadData extends IEventData$1 {
    total_item: number;
    skip: number;
    limit: number;
}
interface IEventSizeData extends IEventData$1 {
    height: number;
    width: number;
}
/**
 * Interface of data from event.
 *
 * @interface IEventSelectData
 *
 * @param {string} event
 * @param {string} purpose
 * @param {string} message_source
 * @param {string} [ref_id]
 * @param {string} customer_id
 * @param {string} payment_source_id
 * @param {string} gateway_id
 * @param {boolean} primary
 * @param {string} [widget_id]
 * @param {string} [card_number_last4]
 * @param {string} [card_scheme]
 * @param {string} gateway_type
 * @param {string} [checkout_email]
 * @param {string} payment_source_type
 * @param {string} [account_name]
 * @param {string} [account_number]
 * */
/**
 * Interface of data from event.
 *
 * @interface IEventPaginationData
 *
 * @param {string} event
 * @param {string} purpose
 * @param {string} message_source
 * @param {string} [ref_id]
 * @param {number} total_item
 * @param {number} skip
 * @param {number} limit
 * */
/**
 * Interface of data from event.
 *
 * @interface IEventAfterLoadData
 *
 * @param {string} event The name of the event.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 * @param {number} total_item Pagination param. Total item count
 * @param {number} skip Pagination param. Skip items from first item
 * @param {number} limit Pagination param. Query limit
 * */
/**
 * Interface of data from event.
 * @interface IEventFinishData
 *
 * @param {string} event The name of the event.
 * @param {string} purpose A system variable that states the purpose of the event.
 * @param {string} message_source A system variable that identifies the event source.
 * @param {string} [ref_id] Custom unique value that identifies result of processed operation.
 * */
/**
* Interface of data from event.
* @interface IEventSizeData
*
* @param {number} event The name of the event.
* @param {number} purpose A system variable that states the purpose of the event.
* @param {string} message_source A system variable that identifies the event source.
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
* @param {number} height Height of iFrame
* @param {number} width Width of iFrame
* */
/**
 * List of available event's name
 *
 * @const EVENT
 *
 * @type {object}
 * @param {string} AFTER_LOAD=afterLoad
 * @param {string} SYSTEM_ERROR=systemError
 * @param {string} SELECT=select
 * @param {string} UNSELECT=unselect
 * @param {string} NEXT=next
 * @param {string} PREV=prev
 * @param {string} META_CHANGE=metaChange
 * @param {string} RESIZE=resize
 */
/**
 * Class HtmlPaymentSourceWidget include method for working on html
 * @constructor
 * @extends PaymentSourceWidget
 *
 * @param {string} selector - Selector of html element. Container for widget
 * @param {string} publicKey - PayDock users public key
 * @param {string} queryToken - PayDock's query token that represents params to search customer by id or reference
 * @example
 *  * var widget = new HtmlPaymentSourceWidget('#widget', 'publicKey','queryToken');

 */
declare class HtmlPaymentSourceWidget extends PaymentSourceWidget {
    protected container: Container;
    protected iFrame: IFrame;
    protected event: IFrameEvent;
    /** @constructs */ constructor(selector: string, publicKey: string, queryToken: string);
    /**
     * The final method to beginning, the load process of widget to html
     *
     */
    load(): void;
    /**
     * This callback will be called for each event in payment source widget
     *
     * @callback listener--PaymentSourceWidget
     * @param {IEventData | IEventSelectData | IEventPaginationData | IEventAfterLoadData} response
     */
    /**
     * Listen to events of widget
     *
     * @example
     *
     * widget.on('select', function (data) {
     *      console.log(data);
     * });
     * @param {string} eventName - Available event names [EVENT]{@link EVENT}
     * @param {listener--PaymentSourceWidget} cb
     */
    on(eventName: string, cb: (data: IEventData$1 | IEventSelectData | IEventPaginationData | IEventAfterLoadData | IEventSizeData) => void): void;
    /**
     * Using this method you can hide widget after load
     * @param {boolean} [saveSize=false] - using this param you can save iframe's size
     */
    hide(saveSize: boolean): void;
    /**
     * Using this method you can show widget after using hide method
     *
     */
    show(): void;
    /**
     * Using this method you can reload widget
     *
     */
    reload(): void;
    /**
     * After select event of widget, data (dataType) will be insert to input (selector)
     *
     * @param {string} selector - css selector . [] #
     * @param {string} dataType - data type of [IEventSelectData]{@link IEventSelectData}.
     */
    onSelectInsert(selector: string, dataType: string): void;
}

declare enum ErrorCodes$1 {
    PROMISE_NOT_ENABLED = "promise_not_enabled",
    SCRIPT_ERROR = "script_error"
}
interface PayPalDataCollectorConfig {
    mouse_movement?: boolean;
}
interface IPayPalDataCollector {
    collectDeviceData(): Promise<CollectedDeviceData>;
    setEnv(env: string): void;
}
interface CollectedDeviceData {
    correlation_id: string;
}
interface IOnErrorEventData$1 {
    error_code: ErrorCodes$1;
}

/**
 * PayPal Data Collector Widget constructor
 *
 * @param {string} [flowId] - This string identifies the source website of the FraudNet request.
 * @param {PayPalDataCollectorConfig} [config] - Extra configuration for the widget.
 *
 * @example
 * var payPalDataCollector = new PayPalDataCollector('FLOW_ID', {});
 */
declare class PayPalDataCollector {
    protected service: IPayPalDataCollector;
    protected eventEmitter: EventEmitter;
    /** @constructs */ constructor(flowId?: string, config?: PayPalDataCollectorConfig);
    /**
     * After configuring the PayPalDataCollector Widget, starts the process and returns
     * the correlation id used among the requests asynchronously.
     *
     * @returns {Promise<CollectedDeviceData>} Promise when resolved, returns an object
     * that contains the `correlation_id` key. The promise may be rejected if script loading fails.
     *
     * @example
     * const collectedDeviceData = await payPalDataCollectorWidget.collectDeviceData();
     * console.log(collectedDeviceData.correlation_id)
     *
     * @example
     * payPalDataCollectorWidget.collectDeviceData()
     *   .then((collectedDeviceData) => {
     *     console.log(collectedDeviceData.correlation_id);
     *   })
     *   .catch((error) => {
     *     console.error('Failed to collect device data', error);
     *   });
     */
    collectDeviceData(): Promise<CollectedDeviceData>;
    /**
     * Callback for onError method.
     *
     * @callback OnErrorCallback
     * @param {IOnErrorEventData|null} data
     */
    /**
     * If the process fails, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * PayPalDataCollector.onError((eventData) => console.log('Some error occur'));
     *
     * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
     */
    onError(callback?: (data?: IOnErrorEventData$1) => void): () => void;
    /**
     * Current method can change environment. By default environment = test.
     * This method does not affect Paydock's API calls or environments, is only for PayPal Data Collector
     * script, in order to know if the script is injected on a live server or is a testing
     * environment. The available values are `test` and `live`. This should match with the used
     * `gateway.mode` in Paydock to process the transaction.
     *
     * @example
     * PayPalDataCollector.setEnv('live');
     * @param {string} env - test, live
     */
    setEnv(env: string): void;
}

interface PayPalStyleConfig {
    layout?: 'vertical' | 'horizontal';
    color?: 'blue' | 'gold' | 'silver' | 'black' | 'white';
    shape?: 'rect' | 'sharp' | 'pill';
    label?: 'paypal' | 'checkout' | 'buynow' | 'pay';
    disableMaxWidth?: boolean;
    disableMaxHeight?: boolean;
    height?: number;
    borderRadius?: number;
    tagline?: boolean;
}
interface PayPalMessageConfig {
    amount?: number;
    align?: 'center' | 'left' | 'right';
    color?: 'black' | 'white';
    position?: 'top' | 'bottom';
}
interface PayPalSavePaymentSourceWidgetConfig {
    style?: PayPalStyleConfig;
    message?: PayPalMessageConfig;
}
interface IPayPalSavePaymentSourceWidget {
    load(container: Container): void;
    setEnv(env: string, alias?: string): void;
}
declare enum ErrorCodes {
    UNAVAILABLE = "unavailable",
    ON_PAYPAL_VAULT_SETUP_TOKEN_ERROR = "onPaypalVaultSetupTokenError",
    ON_GET_ID_TOKEN_ERROR = "onGetIdTokenError",
    ON_GET_WALLET_CONFIG_ERROR = "onGetWalletConfigError",
    ON_GET_SETUP_TOKEN_ERROR = "onGetSetupTokenError",
    ON_ONE_TIME_TOKEN_ERROR = "onOneTimeTokenError"
}
declare enum EVENTS {
    ON_SUCCESS = "ON_SUCCESS",
    ON_ERROR = "ON_ERROR",
    ON_CANCEL = "ON_CANCEL"
}
interface IOnSuccessEventData {
    event: EVENTS.ON_SUCCESS;
    data: {
        token: string;
        email: string;
    };
}
interface IOnErrorEventData {
    event: EVENTS.ON_ERROR;
    data: {
        error_code: ErrorCodes;
        details?: string;
        message?: string;
    };
}
interface IOnCancelEventData {
    event: EVENTS.ON_CANCEL;
}

/**
 * PayPal Save Payment Source Widget constructor
 *
 * @param {string} selector - Selector of html element. Container for PayPal Save Payment Source Widget.
 * @param {string} publicKey - PayDock users public key.
 * @param {string} gatewayId - PayDock's PayPal gatewayId.
 * @param {PayPalSavePaymentSourceWidgetConfig} config - Extra configuration for the widget, like styles.
 *
 * @example
 * var payPalSavePaymentSourceWidget = new PayPalSavePaymentSourceWidget('#paypalButton', 'public_key', 'gateway_id');
 */
declare class PayPalSavePaymentSourceWidget {
    protected container: Container;
    protected service: IPayPalSavePaymentSourceWidget;
    protected eventEmitter: EventEmitter;
    /** @constructs */ constructor(selector: string, publicKey: string, gatewayId: string, config?: PayPalSavePaymentSourceWidgetConfig);
    /**
     * The final method after configuring the PayPalSavePaymentSource Widget to
     * start the load process.
     */
    load(): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * payPalSavePaymentSourceWidget.setEnv('production');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    /**
     * Callback for onSuccess method.
     *
     * @callback OnSuccessCallback
     * @param {IOnSuccessEventData} data
     */
    /**
     * If the setup token was successfully approved and a OTT was generated, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * payPalSavePaymentSourceWidget.onSuccess((eventData) => console.log('One time token and email obtained successfully'));
     *
     * @param {OnSuccessCallback} [callback] - Function to be called when the result is successful.
     */
    onSuccess(callback?: (data: IOnSuccessEventData) => void): () => void;
    /**
     * Callback for onError method.
     *
     * @callback OnErrorCallback
     * @param {IOnErrorEventData} data
     */
    /**
     * If in the process for obtaining the setup token fails, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * payPalSavePaymentSourceWidget.onError((eventData) => console.log('Some error occurred'));
     *
     * @param {OnErrorCallback} [callback] - Function to be called when there is an error in the flow.
     */
    onError(callback?: (data: IOnErrorEventData) => void): () => void;
    /**
     * Callback for onCancel method.
     *
     * @callback OnCancelCallback
     * @param {IOnCancelEventData} data
     */
    /**
     * If in the process for obtaining the setup token was cancelled, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * payPalSavePaymentSourceWidget.onCancel(() => console.log('Operation cancelled'));
     *
     * @param {OnCancelCallback} [callback] - Function to be called when the operation is cancelled.
     */
    onCancel(callback?: (data?: IOnCancelEventData) => void): () => void;
}

interface IBaseSRCMeta {
    customizations?: IStyles;
    dpa_data?: {
        dpa_presentation_name?: string;
        dpa_uri?: string;
    };
    dpa_transaction_options?: {
        dpa_locale?: string;
        dpa_accepted_billing_countries?: string[];
        consumer_name_requested?: boolean;
        consumer_email_address_requested?: boolean;
        consumer_phone_number_requested?: boolean;
        transaction_amount?: {
            transaction_amount?: number;
            transaction_currency_code?: string;
        };
        merchant_order_id?: string;
        merchant_category_code?: string;
        merchant_country_code?: string;
    };
}
interface PhoneNumber {
    country_code: string;
    phone_number: string;
}
interface Customer {
    email?: string;
    phone?: {
        country_code?: string;
        phone?: string;
    };
    first_name?: string;
    last_name?: string;
}
interface DpaConfig {
    dpa_id: string;
    dpa_name: string;
    dpa_supported_card_schemes: ('MASTERCARD' | 'VISA' | 'AMEX' | 'DISCOVER')[];
    mode: 'sandbox' | 'live';
}
interface IClickToPayMeta extends IBaseSRCMeta {
    dpa_data?: IBaseSRCMeta['dpa_data'] & {
        dpa_address?: string;
        dpa_email_address?: string;
        dpa_phone_number?: PhoneNumber;
        dpa_logo_uri?: string;
        dpa_supported_email_address?: string;
        dpa_supported_phone_number?: PhoneNumber;
        dpa_uri?: string;
        dpa_support_uri?: string;
        application_type?: 'WEB_BROWSER' | 'MOBILE_APP';
    };
    disable_summary_screen?: boolean;
    co_brand_names?: string[];
    checkout_experience?: 'WITHIN_CHECKOUT' | 'PAYMENT_SETTINGS';
    services?: 'INLINE_CHECKOUT' | 'INLINE_INSTALLMENTS';
    dpa_transaction_options?: IBaseSRCMeta['dpa_transaction_options'] & {
        dpa_billing_preference?: MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE;
        payment_options?: Array<{
            dynamic_data_type?: string;
        }>;
        order_type?: MASTERCARD_ORDER_TYPE;
        three_ds_preference?: string;
        confirm_payment?: boolean;
    };
    customer?: Customer;
    unaccepted_card_type?: 'CREDIT' | 'DEBIT';
    recognition_token?: string;
    dpa_config?: DpaConfig;
    hold_for_customer_data?: boolean;
}
type MASTERCARD_DPA_SHIPPING_BILLING_PREFERENCE = 'FULL' | 'POSTAL_COUNTRY' | 'NONE';
type MASTERCARD_ORDER_TYPE = 'SPLIT_SHIPMENT' | 'PREFERRED_CARD';
interface IStyles {
    primary_button_color?: string;
    secondary_button_color?: string;
    primary_button_text_color?: string;
    secondary_button_text_color?: string;
    font_family?: string;
    enable_src_popup?: boolean;
}

type CustomerData = Customer;

interface SRCProvider {
    load(): void;
    getEnv(): string;
    hideButton?(saveSize: boolean): void;
    showButton?(): void;
    hideCheckout?(saveSize: boolean): void;
    showCheckout?(): void;
    reload(): void;
    useAutoResize?(): void;
    injectCustomerData(customerData: CustomerData): void;
}

declare abstract class SRC {
    protected iframe_selector: string;
    protected service_id: string;
    protected public_key_or_access_token: string;
    protected meta: IClickToPayMeta;
    protected eventEmitter: EventEmitter;
    protected env: string;
    protected alias?: string;
    protected api: ApiInternal;
    protected provider: SRCProvider;
    protected autoResize: boolean;
    protected style: IStyles;
    constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
    /**
     * Object contain styles for widget - call before `.load()`.
     *
     * @example
     * widget.setStyles({
     *     enable_src_popup: true
     *     primary_button_color: 'red',
     *     secondary_button_color: 'blue',
     *     primary_button_text_color: 'white',
     *     secondary_button_text_color: 'white',
     *     font_family: 'Arial',
     * });
     * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
     */
    setStyles(styles: IStyles): void;
    private setStyle;
    load(): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * SRC.setEnv('production');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    /**
     * Method to read the current environment
     *
     * @example
     * SRC.getEnv();
     */
    getEnv(): string;
    on(eventName: string): Promise<any>;
    on(eventName: string, cb: (data: any) => void): any;
    /**
     * Using this method you can hide checkout after load and button click
     * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
     *
     * @example
     * SRC.hideCheckout();
     */
    hideCheckout(saveSize: boolean): void;
    /**
     * Using this method you can show checkout after using hideCheckout method
     *
     * @example
     * SRC.showCheckout()
     */
    showCheckout(): void;
    /**
     * Using this method you can reload the whole checkout
     *
     * @example
     * SRC.reload()
     */
    reload(): void;
    /**
     * Use this method for resize checkout iFrame according to content height, if applicable
     *
     * @example
     * SRC.useAutoResize();
     *
     */
    useAutoResize(): void;
}

/**
 * Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option
 *
 * @extends SRC
 *
 * @constructor
 *
 * @param {string} iframe_selector - Selector of html element. Container for Click To Pay checkout iFrame.
 * @param {string} service_id - Card Scheme Service ID
 * @param {string} public_key_or_access_token - Paydock public key or Access Token
 * @param {IClickToPayMeta} meta - Data that configures the Click To Pay checkout
 * @example
 * var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {});
 *
 */
declare class ClickToPay extends SRC {
    protected iframe_selector: string;
    protected service_id: string;
    protected public_key_or_access_token: string;
    protected meta: IClickToPayMeta;
    protected holdingForCustomerData: boolean;
    private pendingCustomerData;
    /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
    /**
     * The final method after configuring the SRC to start the load process of Click To Pay checkout
     */
    load(): void;
    /**
     * Inject customer data after widget initialization via postMessage
     *
     * @param {Customer} customerData - Customer data to inject
     * @throws {Error} When customer data is invalid or widget is not ready
     * @example
     * widget.injectCustomerData({
     *     email: 'user@example.com',
     *     first_name: 'John',
     *     last_name: 'Doe'
     * });
     */
    injectCustomerData(customerData: Customer): void;
    /**
     * Validate customer data format
     *
     * @private
     * @param {Customer} customerData - Customer data to validate
     * @returns {boolean} True if valid
     */
    private validateCustomerData;
}

declare class VaultDisplayIframeEvent extends IFrameEvent {
    on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
}

/**
 * Class VaultDisplayWidget include method for working on html
 * @constructor
 *
 * @example
 * var widget = new VaultDisplayWidget('#widget', 'token');
 *
 * @param {string} selector - Selector of html element. Container for widget
 * @param {string} token - One time token
 */
declare class VaultDisplayWidget {
    protected container: Container;
    protected iFrame: IFrame;
    protected triggerElement: Trigger;
    protected event: VaultDisplayIframeEvent;
    protected validationData: IFormValidation;
    protected vaultDisplayToken: string;
    protected link: Link;
    protected configs: any[];
    /** @constructs */ constructor(selector: string, token: string);
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     *
     * @example
     * widget.setEnv('production', 'paydock.com');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    /**
     * This callback will be called for each event in widget
     *
     * @callback listener
     * @param {IEventData} response
     */
    on(eventName: string): Promise<IEventData$1>;
    on(eventName: string, cb: (data: IEventData$1) => void): any;
    /**
     * Object contain styles for widget
     *
     * @example
     * widget.setStyles({
     *       background_color: '#fff',
     *       border_color: 'yellow',
     *       text_color: '#FFFFAA',
     *       button_color: 'rgba(255, 255, 255, 0.9)',
     *       font_size: '20px',
     *       fort_family: 'fantasy'
     *   });
     * @param {VaultDisplayStyle} fields - name of styles which can be shown in widget [VAULT_DISPLAY_STYLE]{@link VAULT_DISPLAY_STYLE}
     */
    setStyles(styles: IStyles$1): void;
    setStyle(param: string, value: string): void;
    /**
     * The final method to beginning, the load process of widget to html
     *
     */
    load(): void;
}

declare enum EventEnum {
    UNAVAILABLE = "unavailable",
    UPDATE = "update",
    PAYMENT_SUCCESSFUL = "paymentSuccessful",
    PAYMENT_ERROR = "paymentError",
    PAYMENT_IN_REVIEW = "paymentInReview",
    AUTH_TOKENS_CHANGED = "authTokensChanged",
    ON_CLICK = "onClick",
    ON_CHECKOUT_OPEN = "onCheckoutOpen",
    ON_CHECKOUT_CLOSE = "onCheckoutClose",
    ON_WALLET_LOADED = "onWalletLoaded"
}

interface IWalletPaymentSuccessful {
    id: string;
    amount: number;
    currency: string;
    status: string;
    payer_name?: string;
    payer_email?: string;
    payer_phone?: string;
}
interface IWalletUnavailable {
    wallet?: WALLET_TYPE;
}
interface IWalletOnClick {
    attachResult: (result: Promise<void> | boolean) => void;
}
interface IWalletUpdate {
    wallet_response_code?: string;
    wallet_order_id?: string;
    wallet_session_id?: string;
    payment_source?: {
        wallet_payment_method_id?: string;
        card_number_last4?: string;
        card_scheme?: string;
    };
    wallet_loyalty_account?: {
        id?: string;
        barcode?: string;
    };
    shipping?: {
        address_line1?: string;
        address_line2?: string;
        address_postcode?: string;
        address_city?: string;
        address_state?: string;
        address_country?: string;
        address_company?: string;
        post_office_box_number?: string;
        wallet_address_id?: string;
        wallet_address_name?: string;
        wallet_address_created_timestamp?: string;
        wallet_address_updated_timestamp?: string;
    };
    selected_shipping_option?: IShippingOption;
}

interface IWalletServiceUpdateData {
    amount: number;
    shipping_options?: IShippingOption[];
}
interface IWalletServiceUpdate {
    success: boolean;
    body?: IWalletServiceUpdateData;
}
interface IPaymentMethod {
    payment_method_id?: string;
    device?: string;
    customer: {
        payer_name: string;
        payer_email: string;
        payer_phone: string;
        payment_source: {
            wallet_type: WALLET_TYPE;
            card_name: string;
            type: string;
            card_scheme: string;
            card_number_last4: string;
            expire_month: number;
            expire_year: number;
            address_line1: string;
            address_line2: string;
            address_city: string;
            address_postcode: string;
            address_state: string;
            address_country: string;
            ref_token?: string;
        };
    };
    shipping?: {
        method?: string;
        options?: IShippingOption[];
        address_line1?: string;
        address_line2?: string;
        address_city?: string;
        address_postcode?: string;
        address_state?: string;
        address_country?: string;
        address_company?: string;
        address_origin_postcode?: string;
        contact?: {
            first_name?: string;
            last_name?: string;
            email?: string;
            phone?: string;
            phone2?: string;
        };
    };
}
type IUnavailableWalletEventBody = Record<string, never>;
interface IPaymentMethodSelectedWalletEventBody {
    data: IPaymentMethod;
    onSuccess: () => void;
    onError: (message?: string) => void;
}
interface IWalletService {
    load(container: Container): Promise<void>;
    close?(): void;
    update(data: IWalletServiceUpdate): void;
    enable(): void;
    disable(): void;
    setEnv(env: string): any;
    on(eventName: string, cb?: (data: IUnavailableWalletEventBody | IPaymentMethodSelectedWalletEventBody | unknown) => void): any;
}

interface IEventData<T = any> {
    event: string;
    data: T;
}
interface IWalletPaymentSuccessfulEvent extends IEventData<IWalletPaymentSuccessful> {
    event: EventEnum.PAYMENT_SUCCESSFUL;
}
interface IWalletUpdateEvent extends IEventData<IWalletUpdate> {
    event: EventEnum.UPDATE;
}
interface IWalletUnavailableEvent extends IEventData<IWalletUnavailable> {
    event: EventEnum.UNAVAILABLE;
}
interface IWalletOnClickEvent extends IEventData<IWalletOnClick> {
    event: EventEnum.ON_CLICK;
}
interface IWalletUpdateData {
    success: boolean;
}
/**
 * Class WalletButtons to work with different E-Wallets within html (currently supports Apple Pay, Google Pay, Google Pay™ and Apple Pay via Stripe, Flypay V2, Paypal, Afterpay)
 * @constructor
 *
 * @example
 * var button = new WalletButtons('#wallet-buttons', 'charge-token', { amount_label: 'Total', country: 'us' });
 *
 * @param {string} selector - Selector of html element. Container for the WalletButtons.
 * @param {string} chargeToken - token for the wallet transaction, created with a secure call to `POST charges/wallet`.
 * @param {IWalletMeta} meta - data that configures the E-Wallet, which can be shown on checkout page and configures required customer information.
 */
declare class WalletButtons {
    protected container: Container;
    protected api: ApiInternal;
    protected service: IWalletService;
    protected eventEmitter: EventEmitter;
    protected hasUpdateHandler: boolean;
    /** @constructs */ constructor(selector: string, chargeToken: string, meta: IWalletMeta);
    /**
     * Initializes the availability checks and inserts the button if possible.
     * Otherwise function onUnavailable(handler: VoidFunction) will be called.
     *
     * @example
     * var button = new WalletButtons(
     *      '#buttons',
     *      token,
     *      {
     *          amount_label: 'Total',
     *          country: 'DE',
     *      }
     *  );
     *  button.load();
     */
    load(): void;
    /**
     * Triggers the update process of the wallet, if available.
     * Currently supported by Paypal and ApplePay/GooglePay via MPGS Wallets.
     *
     * @example
     * var button = new WalletButtons(
     *      '#buttons',
     *      token,
     *      {
     *          amount_label: 'Total',
     *          country: 'DE',
     *      }
     *  );
     *  button.on('update', (data) => {
     *      updateChargeAmountInBackend(data);
     *      button.update({ success: true });
     *  });
     *
     * @example
     * // ApplePay via MPGS example:
     * var button = new WalletButtons(
     *      '#buttons',
     *      token,
     *      {
     *          amount_label: 'Total',
     *          country: 'AU',
     *          ...
     *      }
     *  );
     *  button.on('update', (data) => {
     *      updateChargeAmountInBackend(data);
     *      button.update({
     *         success: true,
     *         body: {
     *              amount: 15,
     *              shipping_options: [
     *                   {
     *                      id: "NEW-FreeShip",
     *                       label: "NEW - Free Shipping",
     *                       detail: "Arrives in 3 to 5 days",
     *                       amount: "0.00"
     *                   },
     *                   {
     *                       id: "NEW - FastShip",
     *                       label: "NEW - Fast Shipping",
     *                       detail: "Arrives in less than 1 day",
     *                       amount: "10.00"
     *                   }
     *               ]
     *          }
     *       });
     *  });
     */
    update(data: IWalletUpdateData): void;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     * Bear in mind that you must set an environment before calling `button.load()`.
     *
     * @example
     * button.setEnv('production', 'paydock.com');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    /**
     * Current method can enable the payment button. This method is only supported for Flypay V2.
     *
     * @example
     * button.enable();
     */
    enable(): void;
    /**
     * Current method can disable the payment button. This method is only supported for Flypay V2.
     *
     * @example
     * button.disable('production', 'paydock.com');
     */
    disable(): void;
    /**
     * Closes the checkout forcibly. Currently supported in Flypay wallet.
     *
     * @example
     * button.close();
     */
    close(): void;
    on(eventName: string): Promise<IEventData>;
    on(eventName: string, cb: (data: IEventData) => void): any;
    /**
     * User to subscribe to the no button available event. This method is used after loading when the button is not available.
     * For MPGS, since can have more than one wallet button configured (ApplePay/GooglePay) you will receive a body (({ wallet: WALLET_TYPE.GOOGLE }) or ({ wallet: WALLET_TYPE.APPLE })) indicating which button is unavailable
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onUnavailable(() => {
     *      console.log('No wallet buttons available');
     * });
     *
     * @example
     * button.onUnavailable().then(() => console.log('No wallet buttons available'));
     *
     * @example
     * button.onUnavailable(function (data) {console.log('data.wallet :: ', data.wallet)});
     *
     * @param {listener} [handler] - Function to be called when no button is available.
     */
    onUnavailable(handler?: (data: IWalletUnavailableEvent) => void): Promise<void> | (() => void);
    /**
     * If the wallet performs some update in the checkout process, the function passed as parameter will be called.
     *
     * NOTE: make sure to call the `button.update(result)` method on handler completion.
     *
     * @example
     * button.onUpdate((data) => {
     *      button.update({ success: true });
     * });
     *
     * @example
     * button.onUpdate().then((data) => throw new Error());
     *
     * @param {listener} [handler] - Function to be called when the payment was successful.
     */
    onUpdate(handler?: (data: IWalletUpdateEvent) => void): Promise<unknown> | (() => void);
    /**
     * If the payment was successful, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onPaymentSuccessful((data) => {
     *      console.log('Payment successful!');
     * });
     *
     * @example
     * button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
     *
     * @param {listener} [handler] - Function to be called when the payment was successful.
     */
    onPaymentSuccessful(handler?: (data: IWalletPaymentSuccessfulEvent) => void): Promise<unknown> | (() => void);
    /**
     * If the payment was left in fraud review, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onPaymentInReview((data) => {
     *      console.log('Payment in fraud review');
     * });
     *
     * @example
     * button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
     *
     * @param {listener} [handler] - Function to be called when the payment was left in fraud review status.
     */
    onPaymentInReview(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
    /**
     * If the payment was not successful, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onPaymentError((err) => {
     *      console.log('Payment not successful');
     * });
     *
     * @example
     * button.onPaymentError().then((err) => console.log('Payment not successful'));
     *
     * @param {listener} [handler] - Function to be called when the payment was not successful.
     */
    onPaymentError(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
    /**
     * Registers a callback function to be invoked when authentication tokens are changed.
     * This function allows you to respond to changes in authentication tokens, such as when a user logs in.
     *
     * @example
     * button.onAuthTokensChanged((eventData) => {
     *     console.log('Authentication tokens changed:', eventData);
     * });
     *
     * @example
     * button.onAuthTokensChanged().then((eventData) => {
     *     console.log('Authentication tokens changed:', eventData);
     * });
     *
     * @param {listener} [handler] - Function to be called when authentication tokens are changed.
     */
    onAuthTokensChanged(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
    /**
     * Registers a callback function to be invoked when the wallet button gets clicked.
     * There are two operational modes supported, Synchronous and Asynchronous.
     * When asynchronous operations need to occur on the callback handler, attaching the Promise via `attachResult` is required to have the wallet wait for a result.
     * When synchronous operations occur on the callback handler, attaching a boolean result via `attachResult` is optional to control the execution flow.
     * Note this is supported for Paypal, GooglePay, ApplePay, Afterpay and FlypayV2 wallet buttons at the moment.
     *
     * @example
     * button.onClick((data) => {
     *      performValidationLogic();
     * });
     *
     * @param {listener} handler - Function to be called when the wallet button is clicked.
     */
    onClick(handler: (data: IWalletOnClickEvent) => void): () => void;
    /**
     * Registers a callback function to be invoked when the wallet checkout opens.
     * Note this is supported for FlypayV2 wallet button at the moment.
     *
     * @example
     * button.onCheckoutOpen((data) => {
     *      console.log('Checkout opens');
     * });
     *
     * @param {listener} handler - Function to be called when the wallet checkout opens.
     */
    onCheckoutOpen(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
    /**
     * Registers a callback function to be invoked when the wallet checkout closes.
     * Note this is supported for FlypayV2 wallet button at the moment.
     *
     * @example
     * button.onCheckoutClose(() => {
     *      console.log('Wallet checkout closes');
     * });
     *
     * @param {listener} handler - Function to be called when the wallet checkout closes.
     */
    onCheckoutClose(handler?: (err: IEventData) => void): Promise<unknown> | (() => void);
    private setupServiceCallbacks;
    private setupOnWalletLoadedCallback;
    private setupUnavailableCallback;
    private setupUpdateCallback;
    private setupOnClickCallback;
    private setupOnCheckoutOpenCallback;
    private setupOnCheckoutCloseCallback;
    private setupWalletCallback;
    private setupPaymentCallback;
    private setupPaymentSuccessCallback;
    private setupPaymentInReviewCallback;
    private setupPaymentErrorCallback;
    private setupAuthTokensChangedCallback;
}

interface BaseGatewayConfig<T> {
    type: string;
    mode: string;
    credentials?: T;
}

interface BaseWalletMeta {
    amount: number;
    currency: string;
}

interface ChargeWalletTokenMeta {
    charge: {
        id: string;
        amount: number;
        currency: string;
        capture?: boolean;
        reference?: string;
        shipping?: {
            amount?: number;
            currency?: string;
            address_line1?: string;
            address_line2?: string;
            address_line3?: string;
            address_city?: string;
            address_postcode?: string;
            address_state?: string;
            address_country?: string;
            address_country_code?: string;
            address_company?: string;
            address_origin_postcode?: string;
            method?: string;
            type?: string;
            options?: Array<{
                id?: string;
                label?: string;
                detail?: string;
                amount?: string;
                currency?: string;
                type?: string;
            }>;
            contact?: {
                first_name?: string;
                last_name?: string;
                email?: string;
                phone?: string;
                phone2?: string;
            };
        };
    };
    gateway: {
        mode: string;
        type: string;
    };
}

declare enum EVENT {
    UNAVAILABLE = "unavailable",
    ERROR = "error",
    PAYMENT_SUCCESSFUL = "paymentSuccessful",
    PAYMENT_ERROR = "paymentError",
    PAYMENT_IN_REVIEW = "paymentInReview",
    ON_CLICK = "onClick",
    ON_CHECKOUT_CLOSE = "onCheckoutClose",
    ON_SHIPPING_ADDRESS_CHANGE = "onShippingAddressChange",
    ON_SHIPPING_OPTIONS_CHANGE = "onShippingOptionsChange"
}

interface BaseEventData<T> {
    event: string;
    chargeId?: string;
    data?: T | undefined;
}

interface OnClickEventData extends BaseEventData<undefined> {
    event: EVENT.ON_CLICK;
}

interface OnCloseEventData extends BaseEventData<undefined> {
    event: EVENT.ON_CHECKOUT_CLOSE;
}

interface OnErrorEventData extends BaseEventData<Error> {
    event: EVENT.ERROR;
}

interface OnPaymentErrorEventData extends BaseEventData<{
    message?: string;
    code?: string;
}> {
    event: EVENT.PAYMENT_ERROR;
}

interface OnPaymentSuccessfulEventData extends BaseEventData<{
    id: string;
    amount: number;
    currency: string;
    status: string;
}> {
    event: EVENT.PAYMENT_SUCCESSFUL;
}

interface OnPaymentInReviewEventData extends Omit<OnPaymentSuccessfulEventData, 'event'> {
    event: EVENT.PAYMENT_IN_REVIEW;
}

interface OnShippingAddressChangeEventData extends BaseEventData<AddressChangeEventData> {
    event: EVENT.ON_SHIPPING_ADDRESS_CHANGE;
}
interface AddressChangeEventData {
    address_postcode?: string;
    address_city?: string;
    address_state?: string;
    address_country?: string;
    address_line1?: string;
    address_line2?: string;
    contact?: {
        phone?: string;
        email?: string;
        first_name?: string;
        last_name?: string;
    };
}

interface OnShippingAddressChangeEventResponse {
    token?: string;
    error?: {
        code: 'address_error' | 'country_error' | 'state_error' | 'zip_error' | 'shipping_contact_invalid' | 'billing_contact_invalid' | string;
        field?: 'phone' | 'email' | 'name' | 'phonetic_name' | 'address_lines' | 'locality' | 'postal_code' | 'administrative_area' | 'country' | 'country_code';
        message?: string;
    };
}

interface OnShippingOptionChangeEventData extends BaseEventData<ShippingOptionChangeEventData> {
    event: EVENT.ON_SHIPPING_OPTIONS_CHANGE;
}
interface ShippingOptionChangeEventData {
    shipping_option_id?: string;
    amount?: string;
    label?: string;
    detail?: string;
}

interface OnShippingOptionChangeEventResponse {
    token?: string;
    label?: string;
    amount?: string;
    error?: {
        code: 'method_unavailable' | 'store_unavailable' | string;
    };
}

interface OnUnavailableEventData extends BaseEventData<undefined> {
    event: EVENT.UNAVAILABLE;
}

interface Contact {
    first_name?: string;
    last_name?: string;
    email?: string;
    phone?: string;
    phone2?: string;
}
interface WalletCaptureRequest {
    payment_method_id?: string;
    customer: {
        email?: string;
        phone?: string;
        first_name?: string;
        last_name?: string;
        payment_source?: {
            wallet_type?: string;
            address_line1?: string;
            address_line2?: string;
            address_country?: string;
            address_city?: string;
            address_postcode?: string;
            address_state?: string;
            ref_token?: string;
            external_payer_id?: string;
            wallet_express?: boolean;
        };
    };
    shipping?: {
        address_line1?: string;
        address_line2?: string;
        address_line3?: string;
        address_country?: string;
        address_city?: string;
        address_postcode?: string;
        address_state?: string;
        options?: IShippingOption[];
        method?: string;
        contact?: Contact;
    };
}

type ShippingEventToResponse<T> = T extends OnShippingAddressChangeEventData ? OnShippingAddressChangeEventResponse : T extends OnShippingOptionChangeEventData ? OnShippingOptionChangeEventResponse : never;

declare abstract class BaseWalletButton<T extends BaseWalletMeta> {
    protected container: Container;
    protected api: ApiInternal;
    protected env: string;
    protected gatewayId: string;
    protected meta: T;
    protected eventEmitter: EventEmitter;
    protected chargeWalletTokenMeta?: ChargeWalletTokenMeta;
    private onShippingOptionsChangeHandlerRegistered;
    constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: T, requiredMetaFields: string[]);
    private getApiAuthType;
    /**
     * Current method can change environment. By default environment = sandbox.
     * Also we can change domain alias for this environment. By default domain_alias = paydock.com
     * Bear in mind that you must set an environment before calling `button.load()`.
     *
     * @example
     * button.setEnv('production', 'paydock.com');
     * @param {string} env - sandbox, production
     * @param {string} [alias] - Own domain alias
     */
    setEnv(env: string, alias?: string): void;
    /**
     * Callback for onClick method.
     *
     * @callback OnClickCallback
     * @param {OnClickEventData} data
     * @return {Promise<string>} walletToken string result
     */
    /**
     * Registers a callback function to be invoked when the wallet button gets clicked.
     * **Note:** is mandatory to handle this event to perform the wallet initialization (and optionally any validation logic).
     * The event handler needs to return the wallet token string in order for the Wallet charge processing to proceed, or throw an error in case of failure or validation errors.
     * **Note:** this callback may be called multiple times as the customer closes the payment checkout and re-clicks the button.
     * It's the merchant's responsibility to handle this situation and evaluate in each case if generating a new WalletCharge Token is required or the previous one can be used in each case, depending on order data and updates.
     * In case a new one needs to be generated, remember it will need to be preceded by a `setMeta` call.
     *
     * @example
     * button.onClick(async (data) => {
     *      const responseData = await fetch('https://your-server.com/init-wallet-charge');
     *      return responseData.walletToken;
     * });
     *
     * @param {OnClickCallback} handler - Function to be called when the wallet button is clicked.
     */
    onClick(handler: (data: OnClickEventData) => Promise<string>): () => void;
    /**
     * Callback for onPaymentSuccessful method.
     *
     * @callback OnPaymentSuccessfulCallback
     * @param {OnPaymentSuccessfulEventData} data
     */
    /**
     * If the payment was successful, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onPaymentSuccessful((data) => {
     *      console.log('Payment successful!');
     * });
     *
     * @example
     * button.onPaymentSuccessful().then((data) => console.log('Payment successful!'));
     *
     * @param {OnPaymentSuccessfulCallback} [handler] - Function to be called when the payment was successful.
     */
    onPaymentSuccessful(handler?: (data: OnPaymentSuccessfulEventData) => void): Promise<unknown> | (() => void);
    /**
     * Callback for onPaymentInReview method.
     *
     * @callback OnPaymentInReviewCallback
     * @param {OnPaymentInReviewEventData} data
     */
    /**
     * If the payment was left in fraud review, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onPaymentInReview((data) => {
     *      console.log('Payment in fraud review');
     * });
     *
     * @example
     * button.onPaymentInReview().then((data) => console.log('Payment in fraud review'));
     *
     * @param {OnPaymentInReviewCallback} [handler] - Function to be called when the payment was left in fraud review status.
     */
    onPaymentInReview(handler?: (err: OnPaymentInReviewEventData) => void): Promise<unknown> | (() => void);
    /**
     * Callback for onPaymentError method.
     *
     * @callback OnPaymentErrorCallback
     * @param {OnPaymentErrorEventData} data
     */
    /**
     * If the payment was not successful, the function passed as parameter will be called.
     * Important: Do not perform thread blocking operations in callback such as window.alert() calls.
     *
     * @example
     * button.onPaymentError((err) => {
     *      console.log('Payment not successful');
     * });
     *
     * @example
     * button.onPaymentError().then((err) => console.log('Payment not successful'));
     *
     * @param {OnPaymentErrorCallback} [handler] - Function to be called when the payment was not successful.
     */
    onPaymentError(handler?: (err: OnPaymentErrorEventData) => void): Promise<unknown> | (() => void);
    /**
     * Callback for onCheckoutClose method.
     *
     * @callback OnCheckoutCloseCallback
     * @param {OnCloseEventData} data
     */
    /**
     * Registers a callback function to be invoked when the wallet checkout closes.
     *
     * @example
     * button.onCheckoutClose(() => {
     *      console.log('Wallet checkout closes');
     * });
     *
     * @param {OnCheckoutCloseCallback} handler - Function to be called when the wallet checkout closes.
     */
    onCheckoutClose(handler?: (err: OnCloseEventData) => void): Promise<unknown> | (() => void);
    /**
     * Callback for onShippingAddressChange method.
     *
     * @callback OnShippingAddressChangeCallback
     * @param {OnShippingAddressChangeEventData} data
     * @return {Promise<OnShippingAddressChangeEventResponse>} Address update result
     */
    /**
     * If shipping address data is updated, the function passed as parameter will be called.
     * Use this method to listen for shipping address selection or input from customer when shipping is enabled.
     * The event handler needs to return a new token in case a backend to backend wallet update call was executed.
     * In addition, if any error occured, an error string must be supplied.
     * By default, the event handler will be processed successfuly if neither token nor error is returned.
     *
     * @example
     * button.onShippingAddressChange((data) => {
     *     const responseData = await fetch('https://your-server.com/update-shipping-info');
     *     return { error: null, token: responseData.walletToken };
     * });
     *
     * @param {OnShippingAddressChangeCallback} [handler] - Function to be called when the shipping address data is updated.
     */
    onShippingAddressChange(handler?: (data: OnShippingAddressChangeEventData) => Promise<OnShippingAddressChangeEventResponse>): () => void;
    /**
     * Callback for onShippingOptionsChange method.
     *
     * @callback OnShippingOptionsChangeCallback
     * @param {OnShippingOptionChangeEventData} data
     * @return {Promise<OnShippingOptionChangeEventResponse>} Address update result
     */
    /**
     * If shipping options data is updated, the function passed as parameter will be called.
     * Use this method to listen for shipping option selection from customer when shipping is enabled.
     * The event handler needs to return a new token in case a backend to backend wallet update call was executed.
     * In addition, if any error occured, an error string must be supplied.
     * By default, the event handler will be processed successfuly if neither token nor error is returned.
     *
     * @example
     * button.onShippingOptionsChange((data) => {
     *     const responseData = await fetch('https://your-server.com/update-shipping-info');
     *     return { error: null, token: responseData.walletToken };
     * });
     *
     * @param {OnShippingOptionsChangeCallback} [handler] - Function to be called when the shipping options data is updated.
     */
    onShippingOptionsChange(handler?: (data: OnShippingOptionChangeEventData) => Promise<OnShippingOptionChangeEventResponse>): () => void;
    /**
     * Callback for onUnavailable method.
     *
     * @callback OnUnavailableCallback
     * @param {OnUnavailableEventData} data
     */
    /**
     * Registers a callback function to be invoked when the wallet is not available in the current context.
     *
     * @example
     * button.onUnavailable(() => {
     *      console.log('Wallet not available');
     * });
     *
     * @param {OnUnavailableCallback} handler - Function to be called when the wallet is not available in the current context.
     */
    onUnavailable(handler?: (err: OnUnavailableEventData) => void): Promise<unknown> | (() => void);
    /**
     * Callback for onError method.
     *
     * @callback OnErrorCallback
     * @param {OnErrorEventData} data
     */
    /**
     * Registers a callback function to be invoked when an error that is not related to payment execution occurs.
     * For example, if the amount of the wallet token injected via the `onClick` event handler does not match the amount provided via the initial `meta` or `setMeta` method.
     *
     * @example
     * button.onError((error) => {
     *      console.log('WalletButtonExpress error', error);
     * });
     *
     * @param {OnErrorCallback} handler - Function to be called when the WalletButton has an error.
     */
    onError(handler?: (err: OnErrorEventData) => void): Promise<unknown> | (() => void);
    /**
     * Add docs on each child class
     */
    abstract load(): void;
    /**
     * Add docs on each child class
     */
    abstract setMeta(meta: object): void;
    protected getGatewayWalletConfig<T>(): Promise<BaseGatewayConfig<T>>;
    protected executeWalletCallback<T, U extends {
        request_type: string;
    }>(data: U): Promise<T>;
    protected executeWalletCapture<T>(data: WalletCaptureRequest): Promise<T>;
    protected handleMerchantOnExpressButtonClickEvent(): Promise<void>;
    protected handleMerchantOnShippingChangedEvent<T extends OnShippingAddressChangeEventData | OnShippingOptionChangeEventData>(eventData: T): Promise<ShippingEventToResponse<T>>;
    protected setWalletToken(token: string, opts?: {
        skipApiAuth: boolean;
    }): void;
    protected handleCheckoutClose(): void;
    protected handleOnUnavailable(): void;
    protected handleOnError(error?: Error): void;
    protected eventDataFromApiError(err: any): OnPaymentErrorEventData['data'];
    protected validateRequiredMetaFields(requiredMetaFields: string[]): void;
}

type ApplePayButtonStyle = 'black' | 'white' | 'white-outline';

type ApplePayButtonType = 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'plain' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';

declare enum ContactShippingEditingMode {
    AVAILABLE = "available",
    STORE_PICKUP = "store_pickup"
}

interface AppleShippingType {
    contact: {
        email: string;
        phone: string;
        first_name: string;
        last_name: string;
    };
    address_line1: string;
    address_line2: string;
    address_line3?: string;
    address_city: string;
    address_postcode: string;
    address_state: string;
    address_country: string;
    address_country_code?: string;
    options?: IApplePayShippingOption[];
}
interface IApplePayShippingOption {
    id?: string;
    label?: string;
    detail?: string;
    amount?: string;
}

interface ApplePayWalletMeta extends BaseWalletMeta {
    amount_label: string;
    country: string;
    merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
    supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
    required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
    required_shipping_contact_fields?: Array<'email' | 'phone' | 'postalAddress'>;
    apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
    supported_countries?: string[];
    style?: {
        button_type?: ApplePayButtonType;
        button_style?: ApplePayButtonStyle;
    };
    shipping?: AppleShippingType;
    shipping_editing_mode?: ContactShippingEditingMode;
}

/**
 * Class ApplePayWalletButtonExpress to work with Apple Pay Wallet.
 *
 * @extends BaseWalletButton
 *
 * @constructor
 *
 * @example
 * var button = new ApplePayWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
 *
 * @param {string} selector - Selector of html element. Container for the ApplePayWalletButtonExpress.
 * @param {string} publicKeyOrAccessToken - Public key or Access token for the ApplePayWalletButtonExpress.
 * @param {string} gatewayId - Gateway ID for the ApplePayWalletButtonExpress.
 * @param {ApplePayWalletMeta} meta - data that configures the Apple Pay Wallet.
 */
declare class ApplePayWalletButtonExpress extends BaseWalletButton<ApplePayWalletMeta> {
    private paymentSession;
    /** @constructs */ constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: ApplePayWalletMeta);
    /**
     * Initializes the availability checks and inserts the button if possible.
     * Otherwise function onUnavailable(handler: VoidFunction) will be called.
     * **Important**: Is required to invoke this method to render the wallet button.
     *
     * @example
     *  button.load();
     */
    load(): void;
    private onScriptLoaded;
    /**
     * Call this method if updating the originally-provided meta object after order information changed.
     * For example, if the order amount has changed from the time where the button was originally rendered.
     *
     * @example
     * button.setMeta(meta);
     *
     * @param {ApplePayWalletMeta} meta - // data that configures the Apple Pay Wallet.
     */
    setMeta(meta: ApplePayWalletMeta): void;
    private checkAvailability;
    private mount;
    private onApplePayButtonClicked;
    private createRequest;
    private onValidateMerchant;
    private getMerchantSession;
    private onPaymentAuthorized;
    private formatCapabilities;
    private onCancelPayment;
    private parseShippingContact;
    private parseShippingMethod;
    private onApplePayShippingContactUpdate;
    private onApplePayShippingMethodUpdate;
    private parseShippingMethodUpdateEvent;
    private parseShippingContactUpdateEvent;
    private formatErrorFields;
    private isUnsuportedBrowser;
}

interface PaypalWalletMeta extends BaseWalletMeta {
    pay_later?: boolean;
    hide_message?: boolean;
    standalone?: boolean;
    capture?: boolean;
    style?: {
        layout?: 'vertical' | 'horizontal';
        color?: 'gold' | 'blue' | 'silver' | 'black' | 'white';
        shape?: 'rect' | 'pill' | 'sharp';
        borderRadius?: number;
        height?: number;
        disableMaxWidth?: boolean;
        label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment';
        tagline?: boolean;
        messages?: {
            layout?: 'text' | 'flex';
            logo?: {
                type?: 'primary' | 'alternative' | 'inline' | 'none';
                position?: 'left' | 'right' | 'top';
            };
            text?: {
                color?: 'black' | 'white' | 'monochrome' | 'grayscale';
                size?: 10 | 11 | 12 | 13 | 14 | 15 | 16;
                align?: 'left' | 'center' | 'right';
            };
            color?: 'blue' | 'black' | 'white' | 'white-no-border' | 'gray' | 'monochrome' | 'grayscale';
            ratio?: '1x1' | '1x4' | '8x1' | '20x1';
        };
    };
}

interface PayPalSDK {
    Buttons?: (options?: PayPalButtonsComponentOptions) => PayPalButtonsComponent;
    Messages?: (options?: PayPalMessagesComponentOptions) => PayPalMessagesComponent;
    FUNDING?: Record<string, FUNDING_SOURCE>;
}
interface PayPalButtonsComponentOptions {
    /**
     * Called on button click to set up a one-time payment. [createOrder docs](https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-reference/#createorder).
     */
    createOrder?: PayPalButtonCreateOrder;
    /**
     * Used for defining a standalone button.
     * Learn more about [configuring the funding source for standalone buttons](https://developer.paypal.com/docs/business/checkout/configure-payments/standalone-buttons/#4-funding-sources).
     */
    fundingSource?: PayPalButtonFundingSource;
    /**
     * Called when finalizing the transaction. Often used to inform the buyer that the transaction is complete. [onApprove docs](https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-reference/#onapprove).
     */
    onApprove?: PayPalButtonOnApprove;
    /**
     * Called when the buyer cancels the transaction.
     * Often used to show the buyer a [cancellation page](https://developer.paypal.com/docs/business/checkout/add-capabilities/buyer-experience/#3-show-cancellation-page).
     */
    onCancel?: PayPalButtonOnCancel;
    /**
     * Called when the button is clicked. Often used for [validation](https://developer.paypal.com/docs/checkout/integration-features/validation/).
     */
    onClick?: PayPalButtonOnClick;
    /**
     * Catch all for errors preventing buyer checkout.
     * Often used to show the buyer an [error page](https://developer.paypal.com/docs/checkout/integration-features/handle-errors/).
     */
    onError?: PayPalButtonOnError;
    /**
     * Called when the buyer selects a new shipping option on PayPal.
     */
    onShippingOptionsChange?: PayPalButtonOnShippingOptionsChange;
    /**
     * Called when the buyer updates their shipping address on PayPal.
     */
    onShippingAddressChange?: PayPalButtonOnShippingAddressChange;
    /**
     * [Styling options](https://developer.paypal.com/docs/business/checkout/reference/style-guide/#customize-the-payment-buttons) for customizing the button appearance.
     */
    style?: PayPalButtonStyle;
}
interface PayPalButtonsComponent {
    close: () => Promise<void>;
    isEligible: () => boolean;
    render: (container: HTMLElement | string) => Promise<void>;
    updateProps: (props: PayPalButtonsComponentOptions) => Promise<void>;
}
type PayPalButtonCreateOrder = (data: CreateOrderData) => Promise<string>;
interface CreateOrderData {
    paymentSource: FUNDING_SOURCE;
}
type PayPalButtonFundingSource = FUNDING_SOURCE;
type FUNDING_SOURCE = 'paypal' | 'venmo' | 'applepay' | 'itau' | 'credit' | 'paylater' | 'card' | 'ideal' | 'sepa' | 'bancontact' | 'giropay' | 'sofort' | 'eps' | 'mybank' | 'p24' | 'verkkopankki' | 'payu' | 'blik' | 'trustly' | 'zimpler' | 'maxima' | 'oxxo' | 'boletobancario' | 'wechatpay' | 'mercadopago' | 'multibanco';
type PayPalButtonOnApprove = (data: OnApproveData) => Promise<void>;
interface OnApproveData {
    billingToken?: string | null;
    facilitatorAccessToken?: string;
    orderID: string;
    payerID?: string | null;
    paymentID?: string | null;
    subscriptionID?: string | null;
    authCode?: string | null;
}
type PayPalButtonOnCancel = (data: Record<string, unknown>) => void;
type PayPalButtonOnClick = (data: Record<string, unknown>, actions: OnClickActions) => Promise<void> | void;
interface OnClickActions {
    reject: () => Promise<void>;
    resolve: () => Promise<void>;
}
type PayPalButtonOnError = (err: Record<string, unknown>) => void;
type PayPalButtonOnShippingOptionsChange = (data: OnShippingOptionsChangeData, actions: OnShippingOptionsChangeActions) => Promise<void>;
interface OnShippingOptionsChangeData {
    orderID?: string;
    paymentID?: string;
    paymentToken?: string;
    errors: {
        METHOD_UNAVAILABLE: string;
        STORE_UNAVAILABLE: string;
    };
    selectedShippingOption?: CheckoutShippingOption;
}
interface CheckoutShippingOption {
    amount: CurrencyCodeAndValue;
    id?: string;
    label: string;
    selected: boolean;
    type: 'SHIPPING' | 'PICKUP';
}
interface CurrencyCodeAndValue {
    currencyCode: string;
    value: string;
}
interface OnShippingOptionsChangeActions {
    reject: (reason?: string) => Promise<void>;
}
type PayPalButtonOnShippingAddressChange = (data: OnShippingAddressChangeData, actions: OnShippingAddressChangeActions) => Promise<void>;
interface OnShippingAddressChangeData {
    amount: CurrencyCodeAndValue;
    orderID?: string;
    paymentID?: string;
    paymentToken?: string;
    errors: {
        ADDRESS_ERROR: string;
        COUNTRY_ERROR: string;
        STATE_ERROR: string;
        ZIP_ERROR: string;
    };
    shippingAddress: {
        city: string;
        state: string;
        /** The [two-character ISO 3166-1 code](/docs/integration/direct/rest/country-codes/) that identifies the country or region. */
        countryCode: string;
        /**
         * The postal code, which is the zip code or equivalent.
         * Typically required for countries with a postal code or an equivalent.
         */
        postalCode: string;
    };
}
interface OnShippingAddressChangeActions {
    reject: (reason?: string) => Promise<void>;
}
interface PayPalButtonStyle {
    borderRadius?: number;
    color?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
    disableMaxWidth?: boolean;
    height?: number;
    label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment' | 'subscribe' | 'donate';
    layout?: 'vertical' | 'horizontal';
    shape?: 'rect' | 'pill' | 'sharp';
    tagline?: boolean;
}
interface PayPalMessagesComponentOptions {
    amount?: number | string;
    currency?: 'USD' | 'GBP' | 'EUR';
    style?: {
        layout?: 'text' | 'flex' | 'custom';
        color?: string;
        logo?: {
            type?: 'primary' | 'alternative' | 'inline' | 'none';
            position?: 'left' | 'right' | 'top';
        };
        text?: {
            color?: 'black' | 'white' | 'monochrome' | 'grayscale';
            size?: 10 | 11 | 12 | 13 | 14 | 15 | 16;
            align?: 'left' | 'center' | 'right';
        };
        ratio?: '1x1' | '1x4' | '8x1' | '20x1';
    };
    placement?: 'home' | 'category' | 'product' | 'cart' | 'payment';
    onApply?: (data: Record<string, unknown>) => void;
    onClick?: (data: Record<string, unknown>) => void;
    onRender?: (data: Record<string, unknown>) => void;
}
interface PayPalMessagesComponent {
    render: (container: HTMLElement | string) => Promise<void>;
}

/**
 * Class PaypalWalletButtonExpress to work with Paypal Wallet.
 *
 * @extends BaseWalletButton
 *
 * @constructor
 *
 * @example
 * var button = new PaypalWalletButtonExpress('#wallet-buttons', 'publicKeyOrAccessToken', 'gatewayId', meta);
 *
 * @param {string} selector - Selector of html element. Container for the PaypalWalletButtonExpress.
 * @param {string} publicKeyOrAccessToken - Public key or Access token for the PaypalWalletButtonExpress.
 * @param {string} gatewayId - Gateway ID for the PaypalWalletButtonExpress.
 * @param {PaypalWalletMeta} meta - data that configures the Paypal Wallet.
 */
declare class PaypalWalletButtonExpress extends BaseWalletButton<PaypalWalletMeta> {
    private config;
    protected paypal: PayPalSDK;
    protected pendingApprovalPromise?: Promise<{
        status: string;
    }>;
    private shippingRequested;
    /** @constructs */ constructor(selector: string, publicKeyOrAccessToken: string, gatewayId: string, meta: PaypalWalletMeta);
    /**
     * Initializes the availability checks and inserts the button if possible.
     * Otherwise function onUnavailable(handler: VoidFunction) will be called.
     * **Important**: Is required to invoke this method to render the wallet button.
     *
     * @example
     *  button.load();
     */
    load(): void;
    /**
     * Call this method if updating the originally-provided meta object after order information changed.
     * For example, if the order amount has changed from the time where the button was originally rendered.
     *
     * @example
     * button.setMeta(meta);
     * @param {PaypalWalletMeta} meta - // data that configures the Paypal Wallet.
     */
    setMeta(meta: PaypalWalletMeta): void;
    private renderPaypalButton;
    private renderPaypalCommonComponent;
    private renderPaypalStandaloneComponent;
    private paypalSharedProps;
    private handleShippingAddressUpdate;
    private handleShippingOptionsUpdate;
}

declare global {
    interface Window {
        paydock: {
            WalletButtons: typeof WalletButtons;
            PaypalCheckoutButton: typeof PaypalCheckoutButton;
            AfterpayCheckoutButton: typeof AfterpayCheckoutButton;
            ZipmoneyCheckoutButton: typeof ZipmoneyCheckoutButton;
            PaymentSourceWidget: typeof PaymentSourceWidget;
            VaultDisplayWidget: typeof VaultDisplayWidget;
            ClickToPay: typeof ClickToPay;
            ExternalCheckoutBuilder: typeof Builder$1;
            ExternalCheckoutChecker: typeof Checker;
            PaymentSourceBuilder: typeof Builder;
            Canvas3DS: typeof Canvas3ds;
            MultiWidget: typeof MultiWidget;
            HtmlMultiWidget: typeof HtmlMultiWidget;
            HtmlWidget: typeof HtmlWidget;
            PayPalDataCollector: typeof PayPalDataCollector;
            PayPalSavePaymentSource: typeof PayPalSavePaymentSourceWidget;
            AfterpayOnSiteMessaging: typeof AfterpayOnSiteMessaging;
        };
    }
}

export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, CheckoutActionCode, ClickToPay, Configuration, ELEMENT, ERROR_OPERATION, EVENT$2 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, OpenWalletButtons, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
export type { Billing, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventCheckoutFinishData, IEventData, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, Shipping, VaultDisplayStyle, WalletType };
