leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.67k stars 660 forks source link

Add getPositions to API Types #1270

Closed jwerre closed 4 months ago

jwerre commented 4 months ago

I'm getting the following type error when I try to use getPositions.

Property 'getPositions' does not exist on type 'API'.

To fix this we need to add getPositions to the API interface like so:


export interface API {
   getPositions: () => number[]; // <----- ADD THIS LINE;
    destroy: () => void;
    steps: () => NextStepsForHandle[];
    on: (eventName: string, callback: EventCallback) => void;
    off: (eventName: string) => void;
    get: (unencoded?: boolean) => GetResult;
    set: (input: number | string | (number | string)[], fireSetEvent?: boolean, exactInput?: boolean) => void;
    setHandle: (handleNumber: number, value: number | string, fireSetEvent?: boolean, exactInput?: boolean) => void;
    reset: (fireSetEvent?: boolean) => void;
    disable: (handleNumber?: number) => void;
    enable: (handleNumber?: number) => void;
    options: Options;
    updateOptions: (optionsToUpdate: UpdatableOptions, fireSetEvent: boolean) => void;
    target: HTMLElement;
    removePips: () => void;
    removeTooltips: () => void;
    getTooltips: () => { [handleNumber: number]: HTMLElement | false };
    getOrigins: () => { [handleNumber: number]: HTMLElement };
    pips: (grid: Pips) => HTMLElement;
}
leongersen commented 4 months ago

Thanks, you are quite right. I've update the types in noUiSlider 15.7.2.

github-actions[bot] commented 3 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.