UNPKG

homebridge-blaq

Version:

Control and view your garage door(s) remotely with real-time updates using Konnected's BlaQ hardware

45 lines (44 loc) 1.44 kB
import { Logger } from 'homebridge'; export type LogMessageEvent = MessageEvent<string>; type OnLogCallback = (logEvent: LogMessageEvent) => void; export type StateUpdateRecord = Record<string, unknown> & { id: string; }; export type StateUpdateMessageEvent = MessageEvent<string>; type OnStateUpdateCallback = (stateEvent: StateUpdateMessageEvent) => void; export type PingMessageEvent = MessageEvent<string>; type OnPingCallback = (pingEvent: PingMessageEvent) => void; type AutoReconnectingEventSourceParams = { protocol?: 'http' | 'https'; host: string; port?: number; user?: string; pass?: string; path?: string; logger: Logger; onLog?: OnLogCallback; onStateUpdate?: OnStateUpdateCallback; onPing?: OnPingCallback; maxIdleBeforeReconnect?: number; }; export declare class AutoReconnectingEventSource { private protocol; private host; private port; private user?; private pass?; private path; private logger; private onLog; private onStateUpdate; private onPing; private eventSource?; private lastEventSourceEventDate?; private maxIdleBeforeReconnect; private idleCheckInterval?; constructor({ protocol, host, port, user, pass, path, maxIdleBeforeReconnect, logger, onLog, onStateUpdate, onPing, }: AutoReconnectingEventSourceParams); private connectEventSource; private checkIdleTooLong; close(): void; } export {};