source: node_modules/entities/lib/escape.d.ts@ 7deb3e2

Last change on this file since 7deb3e2 was 57e58a3, checked in by ste08 <sjovanoska@…>, 4 months ago

Initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1export declare const xmlReplacer: RegExp;
2export declare const getCodePoint: (str: string, index: number) => number;
3/**
4 * Encodes all non-ASCII characters, as well as characters not valid in XML
5 * documents using XML entities.
6 *
7 * If a character has no equivalent entity, a
8 * numeric hexadecimal reference (eg. `&#xfc;`) will be used.
9 */
10export declare function encodeXML(str: string): string;
11/**
12 * Encodes all non-ASCII characters, as well as characters not valid in XML
13 * documents using numeric hexadecimal reference (eg. `&#xfc;`).
14 *
15 * Have a look at `escapeUTF8` if you want a more concise output at the expense
16 * of reduced transportability.
17 *
18 * @param data String to escape.
19 */
20export declare const escape: typeof encodeXML;
21/**
22 * Encodes all characters not valid in XML documents using XML entities.
23 *
24 * Note that the output will be character-set dependent.
25 *
26 * @param data String to escape.
27 */
28export declare const escapeUTF8: (data: string) => string;
29/**
30 * Encodes all characters that have to be escaped in HTML attributes,
31 * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
32 *
33 * @param data String to escape.
34 */
35export declare const escapeAttribute: (data: string) => string;
36/**
37 * Encodes all characters that have to be escaped in HTML text,
38 * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
39 *
40 * @param data String to escape.
41 */
42export declare const escapeText: (data: string) => string;
43//# sourceMappingURL=escape.d.ts.map
Note: See TracBrowser for help on using the repository browser.