UNPKG

@paydock/client-sdk

Version:

Paydock client sdk

72 lines 2.71 kB
import type { PURPOSE } from "../widget"; import type { IEventError } from "../helper/event-error"; /** * 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. */ export interface IEventData { event: string; message_source: string; purpose: PURPOSE; widget_id: string; data?: any; ref_id?: string; error?: IEventError; } export declare const EVENT: { 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"; }; export type EventTypes = typeof EVENT[keyof typeof EVENT]; export interface Listener { event: string; listener: (event: any) => void; widget_id: string; } export declare type Listeners = Listener[]; export declare class IFrameEvent { protected listeners: Listeners; constructor(subject: Window | null); emit(data: IEventData): void; on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void; clear(): void; private subscribe; } //# sourceMappingURL=iframe-event.d.ts.map