[element-ready] add typings (#18778)

This commit is contained in:
Dimitri Benin
2017-08-09 10:31:49 -07:00
committed by Mohamed Hegazy
parent 371bffbf56
commit 08863b85fc
4 changed files with 43 additions and 0 deletions
@@ -0,0 +1,9 @@
import elementReady = require('element-ready');
const p = elementReady('#unicorn');
p.then(element => {
const el: HTMLElement = element;
});
p.cancel();
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for element-ready 2.1
// Project: https://github.com/sindresorhus/element-ready#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import pCancelable = require('p-cancelable');
export = elementReady;
declare function elementReady(selector: string): pCancelable.PCancelable<HTMLElement>;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"element-ready-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }