@slide-computer/signer-web
Version:
JavaScript and TypeScript library to communicate with web signers on the Internet Computer
34 lines (33 loc) • 1.07 kB
TypeScript
export interface HeartbeatServerOptions {
/**
* Callback when first heartbeat has been received
*/
onEstablish: (origin: string, source: MessageEventSource) => void;
/**
* Reasonable time in milliseconds in which the communication channel needs to be established
* @default 2000
*/
establishTimeout?: number;
/**
* Callback when no heartbeats have been received for {@link establishTimeout} milliseconds
*/
onEstablishTimeout: () => void;
/**
* Time in milliseconds of not receiving heartbeat requests after which the communication channel is disconnected
* @default 2000
*/
disconnectTimeout?: number;
/**
* Callback when no heartbeats have been received for {@link disconnectTimeout} milliseconds
*/
onDisconnect: () => void;
/**
* Signer window, used to listen for incoming message events
* @default globalThis.window
*/
window?: Window;
}
export declare class HeartbeatServer {
#private;
constructor(options: HeartbeatServerOptions);
}