@tauri-apps/plugin-websocket
Classes
default
Constructors
new default()
new default(id, listeners): defaultParameters
| Parameter | Type |
|---|---|
id | number |
listeners | (arg) => void[] |
Returns
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L37
Properties
| Property | Modifier | Type |
|---|---|---|
id | public | number |
listeners | private | (arg) => void[] |
Methods
addListener()
addListener(cb): voidParameters
| Parameter | Type |
|---|---|
cb | (arg) => void |
Returns
void
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L66
disconnect()
disconnect(): Promise<void>Returns
Promise<void>
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L89
send()
send(message): Promise<void>Parameters
| Parameter | Type |
|---|---|
message | string | number[] | Message |
Returns
Promise<void>
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L70
connect()
static connect(url, config?): Promise<default>Parameters
| Parameter | Type |
|---|---|
url | string |
config? | ConnectionConfig |
Returns
Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L42
Interfaces
CloseFrame
Properties
| Property | Type |
|---|---|
code | number |
reason | string |
ConnectionConfig
Properties
| Property | Type |
|---|---|
acceptUnmaskedFrames? | boolean |
headers? | HeadersInit |
maxFrameSize? | number |
maxMessageSize? | number |
maxWriteBufferSize? | number |
writeBufferSize? | number |
MessageKind<T, D>
Type parameters
| Type parameter |
|---|
T |
D |
Properties
| Property | Type |
|---|---|
data | D |
type | T |
Type Aliases
Message
type Message: | MessageKind<"Text", string> | MessageKind<"Binary", number[]> | MessageKind<"Ping", number[]> | MessageKind<"Pong", number[]>| MessageKind<"Close", CloseFrame | null>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L26
© 2024 Tauri Contributors. CC-BY / MIT