import { BaseStarXpandCommandBuilder } from './BaseStarXpandCommandBuilder'; import { StarXpandCommand } from '../../index'; import { StarXpandCommandParameterConverter } from './StarXpandCommandParameterConverter'; export class DrawerBuilder extends BaseStarXpandCommandBuilder { public _parameters: Map; constructor() { super(); this._parameters = new Map([ ["category", "Drawer"], ["contents", new Array>()] ]); } actionOpen(parameter: StarXpandCommand.Drawer.OpenParameter): DrawerBuilder { this._addAction(async() => { let contents = this._parameters.get("contents") as Array>; contents.push( new Map([ ["method", "Action.Open"], ["parameter", new Map([ ["channel", StarXpandCommandParameterConverter.convertDrawerChannel(parameter.channel)], ["on_time", Math.floor(parameter.onTime)] ])] ]) ); }); return this; } }