* Get the thing's actions as an array. * * @param {String?} actionName Optional action name to get descriptions for * * @returns {Object} Action descriptions.
(
actionName?: string|null
)
| 263 | * @returns {Object} Action descriptions. |
| 264 | */ |
| 265 | getActionDescriptions( |
| 266 | actionName?: string|null |
| 267 | ): Action.ActionDescription[] { |
| 268 | const descriptions: Action.ActionDescription[] = []; |
| 269 | |
| 270 | if (!actionName) { |
| 271 | for (const name in this.actions) { |
| 272 | for (const action of this.actions[name]) { |
| 273 | descriptions.push(action.asActionDescription()); |
| 274 | } |
| 275 | } |
| 276 | } else if (this.actions.hasOwnProperty(actionName)) { |
| 277 | for (const action of this.actions[actionName]) { |
| 278 | descriptions.push(action.asActionDescription()); |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | return descriptions; |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * Get the thing's events as an array. |
no test coverage detected