import { Command } from "./command" ; export class MultiCommand { constructor ( readonly id , readonly label , readonly description , readonly interval , readonly sequence ) { } public async execute ( ) { for ( let command of this . sequence ) { await command . execute ( ) ; await delay ( this . interval || 0 ) ; } } } function delay ( ms ) { if ( ms > 0 ) { return new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ; } }