[@wordpress/html-entities] add new definitions (#35879)

This commit is contained in:
Derek Sifford 2019-06-03 20:53:01 -04:00 committed by Andrew Casey
parent 05a805867b
commit 063fc9d608
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,9 @@
// Type definitions for @wordpress/html-entities 2.3
// Project: https://github.com/WordPress/gutenberg/tree/master/packages/html-entities/README.md
// Definitions by: Derek Sifford <https://github.com/dsifford>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Decodes the HTML entities from a given string.
*/
export function decodeEntities(html: string): string;

View File

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

View File

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

View File

@ -0,0 +1,3 @@
import { decodeEntities } from "@wordpress/html-entities";
decodeEntities("&aacute;"); // "á"