| 5 | const Discover = require('node-discover'); |
| 6 | |
| 7 | export interface AdapterInterface { |
| 8 | /** |
| 9 | * The app connections storage class to manage connections. |
| 10 | */ |
| 11 | namespaces?: Map<string, Namespace>; |
| 12 | |
| 13 | /** |
| 14 | * The list of nodes in the current private network. |
| 15 | */ |
| 16 | driver?: AdapterInterface; |
| 17 | |
| 18 | /** |
| 19 | * Initialize the adapter. |
| 20 | */ |
| 21 | init(): Promise<AdapterInterface>; |
| 22 | |
| 23 | /** |
| 24 | * Get the app namespace. |
| 25 | */ |
| 26 | getNamespace(appId: string): Namespace; |
| 27 | |
| 28 | /** |
| 29 | * Get all namespaces. |
| 30 | */ |
| 31 | getNamespaces(): Map<string, Namespace>; |
| 32 | |
| 33 | /** |
| 34 | * Add a new socket to the namespace. |
| 35 | */ |
| 36 | addSocket(appId: string, ws: WebSocket): Promise<boolean>; |
| 37 | |
| 38 | /** |
| 39 | * Remove a socket from the namespace. |
| 40 | */ |
| 41 | removeSocket(appId: string, wsId: string): Promise<boolean>; |
| 42 | |
| 43 | /** |
| 44 | * Add a socket ID to the channel identifier. |
| 45 | * Return the total number of connections after the connection. |
| 46 | */ |
| 47 | addToChannel(appId: string, channel: string, ws: WebSocket): Promise<number>; |
| 48 | |
| 49 | /** |
| 50 | * Remove a socket ID from the channel identifier. |
| 51 | * Return the total number of connections remaining to the channel. |
| 52 | */ |
| 53 | removeFromChannel(appId: string, channel: string|string[], wsId: string): Promise<number|void>; |
| 54 | |
| 55 | /** |
| 56 | * Send a message to a namespace and channel. |
| 57 | */ |
| 58 | send(appId: string, channel: string, data: string, exceptingId?: string|null): any; |
| 59 | |
| 60 | /** |
| 61 | * Terminate an User ID's connections. |
| 62 | */ |
| 63 | terminateUserConnections(appId: string, userId: number|string): void; |
| 64 |
no outgoing calls
no test coverage detected