Add typing for scrollparentjs 2.0

This commit is contained in:
Sebastian Markgraf 2019-02-25 13:40:08 +01:00
parent b1285dace3
commit 918506e97b
No known key found for this signature in database
GPG Key ID: 9156E9FA7663E84C
4 changed files with 39 additions and 0 deletions

8
types/scrollparent/index.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
// Type definitions for scrollparent 2.0
// Project: https://github.com/olahol/scrollparent.js#readme
// Definitions by: Sintifo <https://github.com/Sintifo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function scrollparent(node: HTMLElement | SVGElement): HTMLElement | null;
export = scrollparent;

View File

@ -0,0 +1,6 @@
import scrollparent = require("scrollparent");
const elem = document.getElementById("content");
if (elem) {
scrollparent(elem);
}

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"scrollparent-tests.tsx"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }