* Returns promise for the result. * @param {string} method method name * @param {EXPECTED_OBJECT=} params params * @returns {Promise<EXPECTED_ANY | void>} Promise for the result
(method, params)
| 110 | * @returns {Promise<EXPECTED_ANY | void>} Promise for the result |
| 111 | */ |
| 112 | sendCommand(method, params) { |
| 113 | if (this.hasSession()) { |
| 114 | return new Promise((res, rej) => { |
| 115 | /** @type {Session} */ |
| 116 | (this.session).post(method, params, (err, params) => { |
| 117 | if (err !== null) { |
| 118 | rej(err); |
| 119 | } else { |
| 120 | res(params); |
| 121 | } |
| 122 | }); |
| 123 | }); |
| 124 | } |
| 125 | return Promise.resolve(); |
| 126 | } |
| 127 | |
| 128 | destroy() { |
| 129 | if (this.hasSession()) { |
no test coverage detected