UNPKG

bambu-js

Version:

Tools to interact with Bambu Lab printers

60 lines (59 loc) 1.87 kB
import { type SupportedModel } from "./models/index.js"; import { CameraProtocol, type CameraFrame, type CameraControllerOptions, type ModelCameraConfig } from "./types/camera-schema.js"; /** * Controller for capturing frames from Bambu Lab printer cameras. */ export declare class CameraController { private host; private accessCode; private model; private config; private options; private captureImpl; private constructor(); /** * Creates a new camera controller. * @param config - Configuration object containing printer information. * @returns A new CameraController instance * @throws {CameraValidationError} When configuration is invalid */ static create(config: { model: SupportedModel; host: string; accessCode: string; options?: CameraControllerOptions; }): CameraController; /** * Creates the appropriate capture implementation based on the model's protocol. * @throws {CameraError} When protocol is not supported */ private createCaptureImplementation; /** * Gets the camera configuration for the current model. */ getCameraConfig(): ModelCameraConfig; /** * Gets the protocol being used for this camera. */ getProtocol(): CameraProtocol; /** * Gets the printer model. */ getModel(): SupportedModel; /** * Gets the printer host. */ getHost(): string; /** * Gets the printer access code. */ getAccessCode(): string; /** * Captures a single frame from the camera. * Creates a new connection, authenticates, captures one frame, and disconnects. * * @returns Promise that resolves to a CameraFrame containing the image data * @throws {CameraError} When frame capture fails */ captureFrame(): Promise<CameraFrame>; }