/** * Handler type for slider value changes. * For plane sliders: (index: number, value: string) => void * For other sliders: (value: number, notify?: boolean) => void * * Note: Using a permissive second parameter type to accommodate both use cases * while satisfying strictFunctionTypes. The Slider class handles the actual * argument passing based on slider type. */ type SliderHandler = (indexOrValue: number, value?: any) => void; /** * Options for configuring a Slider instance. */ interface SliderOptions { handler: SliderHandler; percentage?: boolean; notifyCallback?: ((change: Record, notify: boolean) => void) | null; isReadyCheck?: (() => boolean) | null; onSetSlider?: ((index: number, value: string) => void) | null; } /** * Slider component for controlling numeric values with linked input field. */ declare class Slider { index: number | undefined; type: string; handler: SliderHandler; percentage: boolean; notifyCallback: ((change: Record, notify: boolean) => void) | null; isReadyCheck: (() => boolean) | null; onSetSlider: ((index: number, value: string) => void) | null; slider: HTMLInputElement; input: HTMLInputElement; /** * Create a Slider instance * @param index - Slider identifier (e.g., "plane1", "ambientlight") * @param min - Minimum value * @param max - Maximum value * @param container - DOM container to search for slider elements * @param options - Configuration options */ constructor(index: string, min: number, max: number, container: HTMLElement, options: SliderOptions); /** * Send change notification via callback (for plane-type sliders only) * @param value - The current slider value * @param notify - Whether to trigger the notification */ private _notify; /** * Invoke the value change handler with appropriate value transformation * @param type - Slider type ("plane" or other identifier) * @param index - Plane index (for plane-type sliders) * @param value - The input value as string */ private _handle; /** * Handle slider drag/input events */ sliderChange: (e: Event) => void; /** * Handle text input change events */ inputChange: (e: Event) => void; /** * Configure slider range for symmetric limits around zero (used for clipping planes). * Only sets min/max/step - does NOT change the current value. * Values should be set via state subscriptions. * @param limit - The absolute limit value for both min (-limit) and max (+limit) */ setLimits(limit: number): void; /** * Get the current slider value * @returns The current value as a float */ getValue(): number; /** * Set the slider value programmatically * @param value - The value to set (will be clamped to min/max range) * @param notify - Whether to trigger change notifications */ setValue(value: number, notify?: boolean): void; /** * Update slider visual without triggering handler (for state subscription updates). * Use this when the state has already been updated and you just need to sync the UI. * @param value - The value to set (will be clamped to min/max range) */ setValueFromState(value: number): void; /** * Clean up event listeners. */ dispose(): void; } export { Slider };