Skip to content

Latest commit

 

History

History
106 lines (60 loc) · 2.58 KB

_index_.md

File metadata and controls

106 lines (60 loc) · 2.58 KB

WebSocketAPI - v1.1.5-1Globals"index"

Module: "index"

Index

Interfaces

Functions

Object literals

Functions

on

on(name: string, callback?: undefined | function): eventObject

Defined in lib/index.ts:95

Register a event listener for the name.

Events are called when a event gets dispatched with that same name

example on("test", () => {/Always run /}).get(() => {/ Get request /}).post(() => {/* post request */})

Parameters:

Name Type Description
name string the event name
callback? undefined | function the callback to run

Returns: eventObject


register

register(app: Application, wss: Server, route: string, options: Partial‹SettingsInterface›): void

Defined in lib/index.ts:66

Register the default route with express

Parameters:

Name Type Description
app Application Express app
wss Server the web-wss connection
route string the default route
options Partial‹SettingsInterface -

Returns: void


triggerSnapshot

triggerSnapshot(api: string, extra: any): void

Defined in lib/index.ts:149

Trigger a update event for any registered listeners

Parameters:

Name Type Description
api string the api name to update for
extra any the data to add

Returns: void

Object literals

Const Settings

Settings: object

Defined in lib/index.ts:50

the default settings object

maxLength

maxLength: number = 100000

Defined in lib/index.ts:51

on: object

Defined in lib/index.ts:52

  • eventCompleted(): void

  • eventReceived(): void