mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 06:17:04 +00:00
Merge pull request #29081 from mokkan/tabbable
Add typings for tabbable
This commit is contained in:
Vendored
+18
@@ -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;
|
||||
@@ -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);
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user