@klippa/nativescript-http
Version:
The best way to do HTTP requests in NativeScript, a drop-in replacement for the core HTTP with important improvements and additions like proper connection pooling, form data support and certificate pinning
16 lines (15 loc) • 508 B
TypeScript
export interface WebsocketCallbacks {
onClosed: (code: number, reason: string) => void;
onFailure: (error: string) => void;
onOpen: () => void;
onClosing: (code: number, reason: string) => void;
onMessage: (text: string) => void;
onBinaryMessage: (data: ArrayBuffer) => void;
}
export interface IWebsocketConnection {
queueSize(): number;
send(text: string): void;
sendBinary(bytes: ArrayBuffer): void;
close(code: number, reason: string): void;
cancel(): void;
}