parent
4c44d5ec76
commit
533000b490
4
docs/index.d.ts
vendored
4
docs/index.d.ts
vendored
@ -11,13 +11,13 @@ type RecognizedString = string | ArrayBuffer | Uint8Array | Int8Array | Uint16Ar
|
||||
/** A WebSocket connection that is valid from open to close event */
|
||||
interface WebSocket {
|
||||
/** Sends a message. Make sure to check getBufferedAmount() before sending. Returns true for success, false for built up backpressure that will drain when time is given. */
|
||||
send(message: RecognizedString, isBinary: boolean, compress: boolean) : boolean;
|
||||
send(message: RecognizedString, isBinary?: boolean, compress?: boolean) : boolean;
|
||||
|
||||
/** Returns the bytes buffered in backpressure. */
|
||||
getBufferedAmount() : number;
|
||||
|
||||
/** Gradefully closes this WebSocket. Immediately calls close handler. */
|
||||
end(code: number, shortMessage: RecognizedString) : WebSocket;
|
||||
end(code?: number, shortMessage?: RecognizedString) : WebSocket;
|
||||
|
||||
/** Forefully closes this WebSocket. Immediately calls close handler. */
|
||||
close() : WebSocket;
|
||||
|
Loading…
Reference in New Issue
Block a user