UNPKG

@slide-computer/signer-web

Version:

JavaScript and TypeScript library to communicate with web signers on the Internet Computer

30 lines (29 loc) 1.03 kB
import { type Channel, type JsonRequest, type JsonResponse } from "@slide-computer/signer"; export interface PostMessageChannelOptions { /** * Signer window with which a communication channel has been established */ signerWindow: Window; /** * Signer origin obtained when communication channel was established */ signerOrigin: string; /** * Relying party window, used to listen for incoming message events * @default globalThis.window */ window?: Window; /** * Manage focus between relying party and signer window * @default true */ manageFocus?: boolean; } export declare class PostMessageChannel implements Channel { #private; constructor(options: PostMessageChannelOptions); get closed(): boolean; addEventListener(...[event, listener]: [event: "close", listener: () => void] | [event: "response", listener: (response: JsonResponse) => void]): () => void; send(request: JsonRequest): Promise<void>; close(): Promise<void>; }