1.16.4 • Published 6 months ago

@types/scroll-into-view v1.16.4

Weekly downloads
15,190
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/scroll-into-view

Summary

This package contains type definitions for scroll-into-view (https://github.com/KoryNunn/scroll-into-view).

Details

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

index.d.ts

// Type definitions for scroll-into-view 1.16.0
// Project: https://github.com/KoryNunn/scroll-into-view
// Definitions by: zivni <https://github.com/zivni>
//                 Thibaut <https://github.com/Thibaut-Fatus>
//                 goodCycle <https://github.com/goodCycle>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module __ScrollIntoView {

    interface Settings {
        time?: number | undefined
        ease?: ((value: number) => number) | undefined
        validTarget?: ((target: HTMLElement, parentsScrolled: number) => boolean) | undefined
        align?: Alignment | undefined,
        isScrollable?: ((target: HTMLElement, defaultIsScrollable: (target: HTMLElement) => boolean) => boolean) | undefined,
        isWindow?: ((target: HTMLElement) => boolean) | undefined,
        cancellable?: boolean | undefined,
        maxSynchronousAlignments?: number | undefined,
        debug?: boolean | undefined
    }

    interface Alignment {
        /** 0 to 1, default 0.5 (center) */
        top?: number | undefined
        /** 0 to 1, default 0.5 (center) */
        left?: number | undefined
        /** pixels to offset top alignment */
        topOffset?: number | undefined
        /** pixels to offset left alignment */
        leftOffset?: number | undefined
        /** boolean to prevent X scrolling */
        lockX?: boolean | undefined
        /** boolean to prevent Y scrolling */
        lockY?: boolean | undefined
    }

    /** type will be 'complete' if the scroll completed or 'canceled' if the current scroll was canceled by a new scroll */
    type callbackParameterType = "complete" | "canceled"
    type Callback = (type: callbackParameterType) => void

    interface ScrollIntoView {
        (target: HTMLElement, callback?: __ScrollIntoView.Callback): void
        (target: HTMLElement, settings: __ScrollIntoView.Settings, callback?: __ScrollIntoView.Callback): void
    }

}

declare module "scroll-into-view" {
    var scrollIntoView: __ScrollIntoView.ScrollIntoView
    export = scrollIntoView;
}

Additional Details

  • Last updated: Thu, 23 Sep 2021 07:31:20 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by zivni, Thibaut, and goodCycle.

1.16.3

7 months ago

1.16.2

8 months ago

1.16.1

9 months ago

1.16.4

6 months ago

1.16.0

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.6.7

5 years ago

1.6.6

6 years ago

1.6.5

8 years ago

1.6.4

8 years ago

1.6.3

8 years ago

1.6.2

8 years ago

1.6.1

8 years ago