Merge pull request #29081 from mokkan/tabbable

Add typings for tabbable
This commit is contained in:
Nathan Shively-Sanders
2018-09-21 11:06:15 -07:00
committed by GitHub
4 changed files with 56 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for tabbable 3.1
// Project: https://github.com/davidtheclark/tabbable
// Definitions by: Michael Swiger <https://github.com/mokkan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function T(el: Element | Document, options?: T.Options): HTMLElement[];
declare namespace T {
interface Options {
includeContainer?: boolean;
}
function isTabbable(el: HTMLElement): boolean;
function isFocusable(el: HTMLElement): boolean;
}
export = T;
+11
View File
@@ -0,0 +1,11 @@
import tabbable = require('tabbable');
const el = document.createElement('div');
tabbable(el);
tabbable(el, { includeContainer: true });
tabbable(document);
tabbable(document, { includeContainer: true });
tabbable.isTabbable(el);
tabbable.isFocusable(el);
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"tabbable-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}