mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
37 lines
997 B
TypeScript
37 lines
997 B
TypeScript
// Type definitions for ent 2.2.0
|
|
// Project: https://github.com/substack/node-ent
|
|
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
|
|
/**
|
|
* Options for the encode() function
|
|
*/
|
|
export interface EntOpts {
|
|
/**
|
|
* If opts.numeric is false or opts.named is true, encoding will used named codes like π.
|
|
*/
|
|
numeric?: boolean;
|
|
|
|
/**
|
|
* If opts.numeric is false or opts.named is true, encoding will used named codes like π.
|
|
*/
|
|
named?: boolean;
|
|
|
|
/**
|
|
* If opts.special is set to an Object, the key names will be forced to be encoded (defaults to forcing: <>'"&)
|
|
*/
|
|
special?: any;
|
|
}
|
|
|
|
/**
|
|
* Escape unsafe characters in str with html entities. By default, entities are encoded with numeric decimal codes
|
|
*/
|
|
export function encode(s: string, opts?: EntOpts): string;
|
|
|
|
/**
|
|
* Convert html entities in str back to raw text.
|
|
*/
|
|
export function decode(s: string): string;
|