| 35 | * messages. |
| 36 | */ |
| 37 | export class RTMClient extends EventEmitter { |
| 38 | /** |
| 39 | * Whether or not the client is currently connected to the RTM API |
| 40 | */ |
| 41 | public connected: boolean = false; |
| 42 | |
| 43 | /** |
| 44 | * Whether or not the client has authenticated to the RTM API. This occurs when the connect method |
| 45 | * completes, and a WebSocket URL is available for the client's connection. |
| 46 | */ |
| 47 | public authenticated: boolean = false; |
| 48 | |
| 49 | /** |
| 50 | * The user ID for the connected client. |
| 51 | */ |
| 52 | public activeUserId?: string; |
| 53 | |
| 54 | /** |
| 55 | * The team ID for the workspace the client is connected to. |
| 56 | */ |
| 57 | public activeTeamId?: string; |
| 58 | |
| 59 | /** |
| 60 | * Internal use web client |
| 61 | */ |
| 62 | private webClient: WebClient; |
| 63 | |
| 64 | /** |
| 65 | * An agent used to manage TCP connections for requests. Most commonly used to implement proxy support. See |
| 66 | * npm packages `tunnel` and `https-proxy-agent` for information on how to construct a proxy agent. |
| 67 | */ |
| 68 | private agentConfig?: Agent; |
| 69 | |
| 70 | /** |
| 71 | * Whether this client will automatically reconnect when (not manually) disconnected |
| 72 | */ |
| 73 | private autoReconnect: boolean; |
| 74 | |
| 75 | /** |
| 76 | * Use the `rtm.connect` method to connect when true, or the `rtm.start` method when false |
| 77 | */ |
| 78 | private useRtmConnect: boolean; |
| 79 | |
| 80 | /** |
| 81 | * The number of milliseconds to wait upon connection for reply messages from the previous connection. The default |
| 82 | * value is 2 seconds. |
| 83 | */ |
| 84 | private replyAckOnReconnectTimeout: number; |
| 85 | |
| 86 | /** |
| 87 | * State machine that backs the transition and action behavior |
| 88 | */ |
| 89 | private stateMachine: StateMachine<string, string>; |
| 90 | |
| 91 | /** |
| 92 | * Configuration for the state machine |
| 93 | */ |
| 94 | private stateMachineConfig = Finity |
nothing calls this directly
no test coverage detected