import type { DinteroCheckoutInstance } from "./index.js"; import type { AddressCallbackResult, CheckoutEvents, InternalCheckoutEvents, SessionEvent, SessionValidationCallback } from "./checkout.js"; /** * Unsubscribe handler from event(s). */ export type SubscriptionHandler = (sessionEvent: SessionEvent, checkout: DinteroCheckoutInstance) => void; interface SubscriptionOptions { sid: string; endpoint: string; handler: SubscriptionHandler; eventTypes: (CheckoutEvents | InternalCheckoutEvents)[]; checkout: DinteroCheckoutInstance; source: Window | null; } export type Subscription = { /** * Unsubscribe handler from event(s). */ unsubscribe: () => void; }; /** * Post a SessionLock-event to the checkout iframe. */ export declare const postSessionLock: (iframe: HTMLIFrameElement, sid: string) => void; /** * Post the validation result to the checkout iframe */ export declare const postValidationResult: (iframe: HTMLIFrameElement, sid: string, result: SessionValidationCallback) => void; /** * Post the address call back result to the checkout iframe */ export declare const postAddressCallbackResult: (iframe: HTMLIFrameElement, sid: string, result: AddressCallbackResult) => void; /** * Post RefreshSession-event to the checkout iframe. */ export declare const postSessionRefresh: (iframe: HTMLIFrameElement, sid: string) => void; /** * Post SetActivePaymentProductType-event to the checkout iframe. */ export declare const postActivePaymentProductType: (iframe: HTMLIFrameElement, sid: string, paymentProductType?: string) => void; /** * Post ClosePopOut-event to the checkout iframe. */ export declare const postValidatePopOutEvent: (iframe: HTMLIFrameElement, sid: string) => void; /** * Post OpenPopOutFailed-event to the checkout iframe. */ export declare const postOpenPopOutFailedEvent: (iframe: HTMLIFrameElement, sid: string) => void; /** * Post OpenedPopOut-event to the checkout iframe. */ export declare const postOpenPopOutEvent: (iframe: HTMLIFrameElement, sid: string) => void; /** * Post ClosePopOut-event to the checkout iframe. */ export declare const postClosePopOutEvent: (iframe: HTMLIFrameElement, sid: string) => void; /** * Post SetLanguage-event to the checkout iframe. */ export declare const postSetLanguage: (iframe: HTMLIFrameElement, sid: string, language: string) => void; /** * Subscribe to events from an iframe given a handler and a set * of event types. */ export declare const subscribe: (options: SubscriptionOptions) => Subscription; export {};