• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2The definitions of some interfaces implemented in jsapi/api/js_url.cpp are released under Mozilla license.
3
4The definitions and functions of these interfaces are consistent with the standard interfaces under mozila license,
5but the implementation of specific functions is independent and self-developed.
6
7All interfaces are described in d.ts, the following is the interface written in d.ts under to Mozilla license
8
9class TextDecoder {
10    readonly encoding: string;
11    readonly fatal: boolean;
12    readonly ignoreBOM = false;
13    constructor(
14        encoding?: string,
15        options?: { fatal?: boolean; ignoreBOM?: boolean },
16    );
17    decode(input: Uint8Array, options?: { stream?: false }): string;
18}
19
20class TextEncoder {
21
22    readonly encoding = "utf-8";
23    constructor();
24    encode(input?: string): Uint8Array;
25    encodeInto(
26        input: string,
27        dest: Uint8Array,
28    ): { read: number; written: number };
29}