mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Add dom lib
This commit is contained in:
Vendored
+8
-3
@@ -32,7 +32,12 @@ declare namespace SmoothScroll {
|
||||
// Speed & Easing
|
||||
speed?: number;
|
||||
clip?: boolean;
|
||||
offset?: number | ((anchor?: Node | number, toggle?: Node) => number);
|
||||
offset?:
|
||||
| number
|
||||
| ((
|
||||
anchor?: Element | number | null,
|
||||
toggle?: Element | null
|
||||
) => number);
|
||||
easing?: Easing;
|
||||
customEasing?: (time: number) => number;
|
||||
|
||||
@@ -53,8 +58,8 @@ declare class SmoothScroll {
|
||||
destroy(): void;
|
||||
|
||||
animateScroll(
|
||||
anchor: Node | number,
|
||||
toggle?: Node,
|
||||
anchor: Element | number | null,
|
||||
toggle?: Element | null,
|
||||
options?: SmoothScroll.Options
|
||||
): void;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ example1.destroy();
|
||||
// Scrolling to an anchor
|
||||
const example2 = () => {
|
||||
const scroll = new SmoothScroll();
|
||||
const anchor: Node = document.querySelector("#bazinga");
|
||||
const anchor = document.querySelector("#bazinga");
|
||||
scroll.animateScroll(anchor, null, { speed: 1000 });
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ example1.destroy();
|
||||
// Scrolling to an anchor
|
||||
const example2 = () => {
|
||||
const scroll = new SmoothScroll();
|
||||
const anchor: Node = document.querySelector("#bazinga");
|
||||
const anchor = document.querySelector("#bazinga");
|
||||
scroll.animateScroll(anchor, null, { speed: 1000 });
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
|
||||
Reference in New Issue
Block a user