Skip to content
Tauri

@tauri-apps/plugin-websocket

Classes

default

Constructors

new default()
new default(id, listeners): default
Parameters
ParameterType
idnumber
listeners(arg) => void[]
Returns

default

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L37

Properties

PropertyModifierType
idpublicnumber
listenersprivate(arg) => void[]

Methods

addListener()
addListener(cb): void
Parameters
ParameterType
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
ParameterType
messagestring | 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
ParameterType
urlstring
config?ConnectionConfig
Returns

Promise<default>

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L42

Interfaces

CloseFrame

Properties

PropertyType
codenumber
reasonstring

ConnectionConfig

Properties

PropertyType
acceptUnmaskedFrames?boolean
headers?HeadersInit
maxFrameSize?number
maxMessageSize?number
maxWriteBufferSize?number
writeBufferSize?number

MessageKind<T, D>

Type parameters

Type parameter
T
D

Properties

PropertyType
dataD
typeT

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