diff --git a/types/wordpress__token-list/index.d.ts b/types/wordpress__token-list/index.d.ts new file mode 100644 index 0000000000..29731c5ebe --- /dev/null +++ b/types/wordpress__token-list/index.d.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.5 + +declare const TokenList: { + new (initialValue?: string): DOMTokenList; +}; + +export default TokenList; diff --git a/types/wordpress__token-list/tsconfig.json b/types/wordpress__token-list/tsconfig.json new file mode 100644 index 0000000000..fe9ddfc60a --- /dev/null +++ b/types/wordpress__token-list/tsconfig.json @@ -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"] +} diff --git a/types/wordpress__token-list/tslint.json b/types/wordpress__token-list/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/wordpress__token-list/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/wordpress__token-list/wordpress__token-list-tests.ts b/types/wordpress__token-list/wordpress__token-list-tests.ts new file mode 100644 index 0000000000..8eb8086bf2 --- /dev/null +++ b/types/wordpress__token-list/wordpress__token-list-tests.ts @@ -0,0 +1,7 @@ +import TokenList from '@wordpress/token-list'; + +// $ExpectType DOMTokenList +new TokenList(); + +// $ExpectType DOMTokenList +const list = new TokenList('foo bar');