Skip to content

Latest commit

 

History

History
143 lines (80 loc) · 3.7 KB

File metadata and controls

143 lines (80 loc) · 3.7 KB

WebSocketAPI - v1.1.5-1Globals"ws/wsClient"wsClient

Class: wsClient

Hierarchy

  • wsClient

Index

Constructors

Properties

Methods

Constructors

constructor

+ new wsClient(ws: WebSocket, request: ExpressRequest, client?: any): wsClient

Defined in lib/ws/wsClient.ts:25

Parameters:

Name Type
ws WebSocket
request ExpressRequest
client? any

Returns: wsClient

Properties

WebSocket

WebSocket: WebSocket

Defined in lib/ws/wsClient.ts:21


_index

_index: number

Defined in lib/ws/wsClient.ts:24


client

client: any

Defined in lib/ws/wsClient.ts:23


events

events: FetchEvent[]

Defined in lib/ws/wsClient.ts:25


request

request: ExpressRequest

Defined in lib/ws/wsClient.ts:22

Methods

api

api(api: string): object

Defined in lib/ws/wsClient.ts:62

Send a api request to the client

Parameters:

Name Type Description
api string The event name to send to client

Returns: object


fetch

fetch(api: string, body?: any, options?: requestOptions): Promise‹unknown›

Defined in lib/ws/wsClient.ts:102

Send a reverse fetch to the client.

This allows you to make a request to the connected client from the server or send updated data to the client when it comes available

Parameters:

Name Type Description
api string The api event name to send
body? any the payload to send with the request
options? requestOptions the options for the request

Returns: Promise‹unknown›


newIndex

newIndex(): number

Defined in lib/ws/wsClient.ts:155

Returns: number