UNPKG

connection-state

Version:
12 lines (11 loc) 502 B
export type ConnectionState = 'online' | 'offline'; export type ConnectionOptions = { endpoints?: string[]; initialState?: ConnectionState; retryInterval?: number; }; export declare const connectionState: (options?: ConnectionOptions) => { addListener: (callback: (data: ConnectionState) => void, options?: import("custom-listenable").ListenerOptions | undefined) => void; removeListener: (callback: (data: ConnectionState) => void) => void; getState: () => ConnectionState; };