@swishapp/browser
Version:
JS library to integrate Swish into a browser environment.
15 lines (14 loc) • 637 B
TypeScript
import type { EventName } from "./types";
export declare class EventBus {
private readonly eventBus;
private isInitialized;
subscribe(type: EventName | EventName[], callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): () => void;
unsubscribe(type: EventName, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void;
publish(type: EventName, detail: any): void;
private patchFetch;
private handleCartEvent;
private isPostRequest;
private isCartRequest;
private getEventName;
private getRequestUrl;
}