16.1.4 • Published 6 months ago

@types/smooth-scroll v16.1.4

Weekly downloads
2,820
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/smooth-scroll

Summary

This package contains type definitions for smooth-scroll (https://github.com/cferdinandi/smooth-scroll).

Details

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

index.d.ts

// Type definitions for smooth-scroll 16.1
// Project: https://github.com/cferdinandi/smooth-scroll
// Definitions by: Andrei Horodinca <https://github.com/andreiho>
//                 grgr-dkrk <https://github.com/grgr-dkrk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1

export as namespace SmoothScroll;

export = SmoothScroll;

declare namespace SmoothScroll {
    type Easing =
        | "Linear"
        | "easeInQuad"
        | "easeInCubic"
        | "easeInQuart"
        | "easeInQuint"
        | "easeInOutQuad"
        | "easeInOutCubic"
        | "easeInOutQuart"
        | "easeInOutQuint"
        | "easeOutQuad"
        | "easeOutCubic"
        | "easeOutQuart"
        | "easeOutQuint";

    interface Options {
        // Selectors
        ignore?: string | undefined;
        header?: string | undefined;
        topOnEmptyHash?: boolean | undefined;

        // Speed & Easing
        speed?: number | undefined;
        speedAsDuration?: boolean | undefined;
        durationMax?: number | null | undefined;
        durationMin?: number | null | undefined;
        clip?: boolean | undefined;
        offset?:
            | number
            | ((
                  anchor?: Element | number | null,
                  toggle?: Element | null
              ) => number) | undefined;
        easing?: Easing | undefined;
        customEasing?: ((time: number) => number) | undefined;

        // History
        updateURL?: boolean | undefined;
        popstate?: boolean | undefined;

        // Custom Events
        emitEvents?: boolean | undefined;
    }
}

declare class SmoothScroll {
    constructor(selector?: string, options?: SmoothScroll.Options);

    init(options?: SmoothScroll.Options): void;

    destroy(): void;

    animateScroll(
        anchor: Element | number | null,
        toggle?: Element | null,
        options?: SmoothScroll.Options
    ): void;

    cancelScroll(noEvent?: boolean): void;
}

Additional Details

  • Last updated: Tue, 06 Jul 2021 16:35:00 GMT
  • Dependencies: none
  • Global values: SmoothScroll

Credits

These definitions were written by Andrei Horodinca, and grgr-dkrk.

16.1.4

6 months ago

16.1.3

7 months ago

16.1.2

8 months ago

16.1.1

3 years ago

16.1.0

5 years ago

14.2.0

6 years ago