@arcana/auth
Version:
Arcana Auth
35 lines (34 loc) • 1.36 kB
TypeScript
import type { BearerAuthentication, ChildMethods, FirebaseBearer, IframeWrapperParams, ParentMethods } from './typings';
import { AppMode } from './typings';
import { Connection } from 'penpal';
export default class IframeWrapper {
params: IframeWrapperParams;
widgetIframe: HTMLIFrameElement;
appMode: AppMode;
private state;
private iframeCommunication;
constructor(params: IframeWrapperParams);
setConnectionMethods(methods: Omit<ParentMethods, 'uiEvent'>): Promise<{
iframe: HTMLIFrameElement;
communication: Connection<ChildMethods>;
}>;
triggerBearerAuthentication(type: BearerAuthentication, data: FirebaseBearer): Promise<boolean>;
getSessionID: () => {
id: string;
expiry: number;
} | null;
setSessionID: (id: string, expiry: number) => void;
clearSessionID: () => void;
setWalletType(appMode: AppMode | undefined): void;
getState(): "open" | "closed";
handleDisconnect(): void;
onReceivingPendingRequestCount(count: number): void;
setIframeStyle: (styles: CSSStyleDeclaration) => void;
getWalletPlace: () => import("./typings").Position;
getAppConfig: () => import("./typings").AppConfig;
private getIframeUrl;
private createWidgetIframe;
private checkDuplicateIframe;
private initWalletUI;
private checkSecureOrigin;
}