mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
Add typings for focus-within (#24935)
* add typings for focus-within * fix test filenames * fix typings and tests according to review comments
This commit is contained in:
committed by
Mohamed Hegazy
parent
8cf4294b84
commit
81cb59546f
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for focus-within 1.0
|
||||
// Project: https://github.com/jonathantneal/focus-within#readme
|
||||
// Definitions by: Damien Erambert <https://github.com/eramdam>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace focusWithin {
|
||||
interface FocusWithinOpts {
|
||||
attr?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function focusWithin(document: HTMLDocument, opts?: focusWithin.FocusWithinOpts): void;
|
||||
|
||||
export as namespace focusWithin;
|
||||
export = focusWithin;
|
||||
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* This file tests the typings of the global export of `focus-within`
|
||||
*/
|
||||
|
||||
focusWithin(document);
|
||||
|
||||
focusWithin(document, {
|
||||
attr: false,
|
||||
className: 'foo'
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* This file tests the typings of the default export of `focus-within`
|
||||
*/
|
||||
import focusWithin = require("focus-within");
|
||||
|
||||
focusWithin(document);
|
||||
|
||||
focusWithin(document, {
|
||||
attr: false,
|
||||
className: 'foo'
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"test/focus-within-global-tests.ts",
|
||||
"test/focus-within-import-default-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user