mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Create html-entities definitions file (#8890)
* Create html-entities definitions file * Fix Travis test
This commit is contained in:
committed by
Masahiro Wakame
parent
0ea6c46516
commit
883f016ef7
@@ -0,0 +1,10 @@
|
||||
/// <reference path="html-entities.d.ts" />
|
||||
|
||||
import * as htmlEntities from "html-entities";
|
||||
|
||||
let entities = new htmlEntities.AllHtmlEntities();
|
||||
|
||||
console.log(entities.encode('<>"\'&©®')); // <>"'&©®
|
||||
console.log(entities.encodeNonUTF('<>"\'&©®')); // <>"'&©®
|
||||
console.log(entities.encodeNonASCII('<>"\'&©®')); // <>"\'&©®
|
||||
console.log(entities.decode('<>"'&©®∆')); // <>"'&©®∆
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for html-entities v1.2.0
|
||||
// Project: https://www.npmjs.com/package/html-entities
|
||||
// Definitions by: Xavier Stouder <https://github.com/xstoudi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "html-entities" {
|
||||
abstract class Entities {
|
||||
encode(toEncode: string): string;
|
||||
encodeNonUTF(toEncode: string): string;
|
||||
encodeNonASCII(toEncode: string): string;
|
||||
decode(toDecode: string): string;
|
||||
}
|
||||
class XmlEntities extends Entities {}
|
||||
class Html4Entities extends Entities {}
|
||||
class Html5Entities extends Entities {}
|
||||
class AllHtmlEntities extends Entities {}
|
||||
}
|
||||
Reference in New Issue
Block a user