跳转到内容
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

PropertyTypeDefined in
idnumberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L34

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

PropertyTypeDefined in
codenumberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L22
reasonstringSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L23

ConnectionConfig

Properties

PropertyTypeDefined in
acceptUnmaskedFrames?booleanSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L12
headers?HeadersInitSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L13
maxFrameSize?numberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L11
maxMessageSize?numberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L10
maxWriteBufferSize?numberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L9
writeBufferSize?numberSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L8

MessageKind<T, D>

Type Parameters

Type Parameter
T
D

Properties

PropertyTypeDefined in
dataDSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L18
typeTSource: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/websocket/guest-js/index.ts#L17

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