(commandId: CommandId, type: CommandType = 'command')
| 72 | const pollingManage = new PollingManage(); |
| 73 | |
| 74 | function command(commandId: CommandId, type: CommandType = 'command'): Function { |
| 75 | return (_target: any, key: string, descriptor: any) => { |
| 76 | if (!(typeof descriptor.value === 'function')) { |
| 77 | throw new Error('not supported'); |
| 78 | } |
| 79 | Commands.push({ commandId, key, type, method: descriptor.value }); |
| 80 | }; |
| 81 | } |
| 82 | |
| 83 | export class CommandCenter { |
| 84 | private manager: Manager; |