Properties
binaryType
binaryType: string
Methods
addEventListener
- addEventListener(method: "open", cb: () => void): void
- addEventListener(method: "message", cb: (event: { data: string | ArrayBuffer | Buffer | Buffer[] }) => void): void
- addEventListener(method: "close", cb: () => void): void
- addEventListener(method: "error", cb: (event: { error: any }) => void): void
Parameters
method: "open"
cb: () => void
Returns void
Parameters
method: "message"
cb: (event: { data: string | ArrayBuffer | Buffer | Buffer[] }) => void
- (event: { data: string | ArrayBuffer | Buffer | Buffer[] }): void
Parameters
event: { data: string | ArrayBuffer | Buffer | Buffer[] }
data: string | ArrayBuffer | Buffer | Buffer[]
Returns void
Returns void
Parameters
method: "close"
cb: () => void
Returns void
Parameters
method: "error"
cb: (event: { error: any }) => void
- (event: { error: any }): void
Returns void
close
- close(code?: number, reason?: string): void
Parameters
Optional code: number
Optional reason: string
Returns void
send
- send(data: ArrayBuffer): void