3.0.3 • Published 7 months ago

@types/scroll v3.0.3

Weekly downloads
2,287
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/scroll

Summary

This package contains type definitions for scroll (https://github.com/michaelrhodes/scroll).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scroll.

index.d.ts

// Type definitions for scroll 3.0
// Project: https://github.com/michaelrhodes/scroll
// Definitions by: Roman Charugin <https://github.com/romic>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

type ScrollError = Error | null;

interface ScrollOptions {
    /**
     * Ease function
     * @default easeInOut
     */
    ease?: ((time: number) => number) | undefined;
    /**
     * Animation duration
     * @default 350
     */
    duration?: number | undefined;
}

interface ScrollCallback {
    (error: ScrollError, value: number): void;
}

interface Cancel {
    (): void;
}

interface Scroll {
    /**
     * @param el Element to scroll
     * @param to Scroll to value
     * @param opts Additional options
     * @param cb Callback function to call after
     * @return Function to stop scrolling
     */
    (el: HTMLElement, to: number, opts?: ScrollOptions | ScrollCallback, cb?: ScrollCallback): Cancel;
}

declare const scroll: {
    left: Scroll;
    top: Scroll;
};

export = scroll;

Additional Details

  • Last updated: Tue, 06 Jul 2021 16:34:22 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Roman Charugin.