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
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, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by Andrei Horodinca, and grgr-dkrk.