Calls related specifically to the web socket connection.
- Source:
Members
(static) getNetworkInfo
- Deprecated:
- Since 2.1.0. Please use qz.networking.device() instead
- Source:
Methods
(static) connect(optionsopt) → {Promise.<(null|Error)>}
Call to setup connection with QZ Tray on user's system.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Configuration options for the web socket connection.
Properties
|
- Source:
Returns:
- Type
- Promise.<(null|Error)>
(static) disconnect() → {Promise.<(null|Error)>}
Stop any active connection with QZ Tray.
- Source:
Returns:
- Type
- Promise.<(null|Error)>
(static) getConnectionInfo() → {Object.<{socket: String, host: String, port: Number}>}
- Source:
Returns:
Details of active websocket connection
- Type
- Object.<{socket: String, host: String, port: Number}>
(static) isActive() → {boolean}
Check connection status. Active connection is necessary for other calls to run.
- Source:
- See:
-
- connect
Returns:
If there is an active connection with QZ Tray.
- Type
- boolean
(static) setClosedCallbacks(calls)
List of functions called for any connection closing event outside of an API call.
Also called when websocket#disconnect is called.
Parameters:
Name | Type | Description |
---|---|---|
calls |
function | Array.<function()> | Single or array of Function({Event} event) calls. |
- Source:
(static) setErrorCallbacks(calls)
List of functions called for any connections errors outside of an API call.
Also called if websocket#connect fails to connect.
Parameters:
Name | Type | Description |
---|---|---|
calls |
function | Array.<function()> | Single or array of Function({Event} event) calls. |
- Source: