import { Checkout } from '../../sdk'; import { WrappedBrowserProvider } from '../../types'; import { CheckoutWidgetsConfig, WidgetParameters, IWidgetsFactory, Widget, WidgetProperties, WidgetType, WidgetEventData, IWidgetsFactoryCreate } from './types'; /** * Declares global interfaces and namespaces for the application. * @global * @namespace ImmutableCheckoutWidgets * */ declare global { namespace ImmutableCheckoutWidgets { class WidgetsFactory implements IWidgetsFactory { constructor(sdk: Checkout, config: CheckoutWidgetsConfig); create: IWidgetsFactoryCreate; updateProvider(provider: WrappedBrowserProvider): void; } class Connect implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } class Bridge implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } class Wallet implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } class Swap implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } class OnRamp implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } class Sale implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } class Commerce implements Widget { constructor(sdk: Checkout, props: WidgetProperties); mount(id: string, params?: WidgetParameters[T]): void; unmount(): void; update(props: WidgetProperties): void; addListener(type: KEventName, callback: (data: WidgetEventData[T][KEventName]) => void): void; removeListener(type: KEventName): void; } } }