import assert from "node:assert" ; import { ReadonlyDeep , } from "type-fest" ; import Camera from "uvc-control" ; import CameraControlHelperFactory from "./camera-control-helper-factory.js" ; import CameraHelperClass from "./camera-helper.js" ; import Output from "./output.js" ; export default class CameraHelperFactory { constructor ( private readonly output , private readonly cameraControlHelperFactory , private readonly CameraHelper ) { assert . strictEqual ( arguments . length , 3 ) ; assert ( typeof this . output === "object" ) ; assert ( typeof this . cameraControlHelperFactory === "object" ) ; assert ( typeof this . CameraHelper === "function" ) ; } async get ( camera ) { assert . strictEqual ( arguments . length , 1 ) ; assert ( typeof camera === "object" ) ; const cameraControlHelper = await this . cameraControlHelperFactory . get ( camera ) ; const cameraHelper = new this . CameraHelper ( this . output , cameraControlHelper , camera ) ; return cameraHelper ; } }