import assert from "node:assert" ; import { ReadonlyDeep , } from "type-fest" ; import { ControlName , ControlValue , } from "uvc-control" ; import CameraHelper from "../camera-helper.js" ; import { Command , CommandHandlerArgumentCameraHelper , CommandHandlerArgumentNames , } from "../types/command.js" ; export default class SetCommand implements Command { constructor ( ) { assert . strictEqual ( arguments . length , 0 ) ; } async getArguments ( ) { return [ CommandHandlerArgumentCameraHelper , "control" , "values" , ] ; } async execute ( ... args ) { assert ( args . length >= 2 ) ; const cameraHelper = args [ 0 ] as ReadonlyDeep < CameraHelper > ; const controlName = args [ 1 ] as ControlName ; const values = args [ 2 ] as readonly ControlValue [ ] ; return cameraHelper . setValues ( controlName , values ) ; } }