declare module "configurator" { /** * Provides the configurator state and interaction. */ export interface Controls { /** * The current model being displayed. */ name?: string /** * The modifiable parameters of the current model. */ parameters: Parameter[] /** * @returns the calculated price of the current model. */ price: () => number /** * Flip the model horizontally. Provided if the model is not symmetric. */ flip?(): void } /** * Configuration, state and interaction for a parameter. */ export interface Parameter { /** * Parameter abbreviation: * H: Height * W: Width * D: Depth * T: Shelf height * I: Shelf depth */ name: string /** * @returns the current value of the parameter in millimeters. */ value: () => number /** * Minimum value of the parameter in millimeters. */ min: number /** * Maximum value of the parameter in millimeters. */ max: number /** * Try to update the parameter value. Actual value set may differ according to constraints. * @param value - The new value to set for the parameter. */ update: (value: number) => void /** * Finish the update of the parameter value. * This rounds the actual value to the nearest valid value. */ commit: () => void } /** * The Configurator class for managing 3D scenes and models. */ export class Configurator { /** * Creates a new Configurator instance. * @param canvas - The HTML canvas element where the 3D scene will be rendered. * @param updateControls - A callback function to update the UI controls. * Called when a new model is loaded or the current model structure changes */ constructor( canvas: HTMLCanvasElement, updateControls: (controls: Controls) => void ); /** * Loads a 3D model into the scene. * This initializes the rendering and calls updateControls when ready. * @param name - The name of the model to load. */ load(name: string): void /** * Export a representation of the current model. * This can be used for saving or sharing the model configuration. */ export(): any } }