UNPKG

@nekobird/controls

Version:

A collection of opinionated user-interface controls.

38 lines (37 loc) 1.3 kB
export interface MonoKnobSliderConfig { trackElement?: HTMLElement; knobElement?: HTMLElement; highlightElement?: HTMLElement; valueElement?: HTMLElement; listenToKnobOnly: boolean; range: [number, number]; interval: number; useInterval: boolean; onInit: (slider: MonoKnobSlider) => void; onActivate: (slider: MonoKnobSlider) => void; onDeactivate: (slider: MonoKnobSlider) => void; onUpdate: (slider: MonoKnobSlider) => void; moveKnob: (knob: HTMLElement, left: number) => void; updateHighlight: (highlight: HTMLElement, width: number, slider: MonoKnobSlider) => void; } export declare const MONO_KNOB_SLIDER_DEFAULT_CONFIG: MonoKnobSliderConfig; export declare class MonoKnobSlider { config: MonoKnobSliderConfig; isActive: boolean; isDisabled: boolean; private knobLeftOffset; private currentValue; private pointerDragEventManager?; constructor(config: Partial<MonoKnobSliderConfig>); setConfig(config: Partial<MonoKnobSliderConfig>): void; value: number; readonly normalizedValue: number; private getSliderRect; update(): this; private onUpdate; private offsetInterval; private eventHandlerStart; private eventHandlerDrag; private eventHandlerEnd; listen(): void; }