Add dom lib

This commit is contained in:
Andrei Horodinca
2018-11-05 16:46:21 +01:00
parent 514d334a54
commit 7c2ccbf62f
4 changed files with 11 additions and 6 deletions
+8 -3
View File
@@ -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 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,