[@wordpress/token-list] add new definitions (#36689)

This commit is contained in:
Derek Sifford 2019-07-10 19:06:58 -04:00 committed by Armando Aguirre
parent d2bf4fe0fa
commit 1ebc560f81
4 changed files with 38 additions and 0 deletions

11
types/wordpress__token-list/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// Type definitions for @wordpress/token-list 1.4
// Project: https://github.com/WordPress/gutenberg/tree/master/packages/token-list/README.md
// Definitions by: Derek Sifford <https://github.com/dsifford>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5
declare const TokenList: {
new (initialValue?: string): DOMTokenList;
};
export default TokenList;

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["dom", "es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@wordpress/token-list": ["wordpress__token-list"]
}
},
"files": ["index.d.ts", "wordpress__token-list-tests.ts"]
}

View File

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

View File

@ -0,0 +1,7 @@
import TokenList from '@wordpress/token-list';
// $ExpectType DOMTokenList
new TokenList();
// $ExpectType DOMTokenList
const list = new TokenList('foo bar');