netflux
Version:
Peer to peer isomorphic transport API based on WebRTC and WebSocket. Allows to create/join full mesh network
20 lines (19 loc) • 921 B
TypeScript
import { Observable } from 'rxjs';
export declare const MIN_ID = 2147483648;
export declare const isBrowser: boolean;
export declare function isOnline(): boolean;
export declare function isVisible(): boolean;
export declare function validateWebSocketURL(url: string): void;
export declare function generateKey(): string;
export declare function generateId(exclude?: number[]): number;
export declare function validateKey(key: string): boolean;
export declare function extractHostnameAndPort(url: string): string;
export declare function equal(array1: number[], array2: number[]): boolean;
export declare function isWebSocketSupported(): boolean;
export declare function isWebRTCSupported(): boolean;
export * from './util.log';
export interface IStream<OutMsg, InMsg> {
readonly STREAM_ID: number;
messageFromStream: Observable<InMsg>;
sendOverStream: (msg: OutMsg, id?: number) => void;
}