UNPKG

ibembed

Version:
32 lines (31 loc) 1.2 kB
import { EmbedOption, EmbedParams, EventCallbacks, EventType, EventDataMap } from "./types/common"; export default class InstabookEmbed extends EventTarget { iframe: HTMLIFrameElement | undefined; iframeContainer: HTMLElement | null; loaderElement?: HTMLElement | null; iframeId: string; options: EmbedOption; private isReady; eventCallbacks: EventCallbacks; customStyles: HTMLStyleElement | null; constructor(options: EmbedOption); init(): void; on<T extends EventType>(eventType: T, callback: (eventData?: EventDataMap[T]) => void): void; removeEventListener<T extends EventType>(eventType: T, callback: (data: EventDataMap[T]) => void): void; addEventListener<T extends EventType>(eventType: T, callback: (data: EventDataMap[T]) => void): void; private triggerEvent; reload(): void; getSomething(): number; sendMessage(message: string, data: any): void; private handleMessage; buildQueryString({ params, origin }: { params?: EmbedParams; origin: string; }): string; private onResize; private onReady; private onLoad; private onError; private createIframe; reset(): void; }