mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 05:04:48 +00:00
Remove __textEncoding and __performanceUtil namespaces (#4663)
This commit is contained in:
parent
caff550b6c
commit
51f5276e8c
1 changed files with 40 additions and 61 deletions
101
cli/js/lib.deno.shared_globals.d.ts
vendored
101
cli/js/lib.deno.shared_globals.d.ts
vendored
|
@ -13,8 +13,6 @@
|
||||||
|
|
||||||
declare interface WindowOrWorkerGlobalScope {
|
declare interface WindowOrWorkerGlobalScope {
|
||||||
// methods
|
// methods
|
||||||
atob: typeof __textEncoding.atob;
|
|
||||||
btoa: typeof __textEncoding.btoa;
|
|
||||||
fetch: typeof __fetch.fetch;
|
fetch: typeof __fetch.fetch;
|
||||||
// properties
|
// properties
|
||||||
console: __console.Console;
|
console: __console.Console;
|
||||||
|
@ -27,12 +25,9 @@ declare interface WindowOrWorkerGlobalScope {
|
||||||
URLSearchParams: typeof __urlSearchParams.URLSearchParams;
|
URLSearchParams: typeof __urlSearchParams.URLSearchParams;
|
||||||
Headers: __domTypes.HeadersConstructor;
|
Headers: __domTypes.HeadersConstructor;
|
||||||
FormData: __domTypes.FormDataConstructor;
|
FormData: __domTypes.FormDataConstructor;
|
||||||
TextEncoder: typeof __textEncoding.TextEncoder;
|
|
||||||
TextDecoder: typeof __textEncoding.TextDecoder;
|
|
||||||
ReadableStream: __domTypes.ReadableStreamConstructor;
|
ReadableStream: __domTypes.ReadableStreamConstructor;
|
||||||
Request: __domTypes.RequestConstructor;
|
Request: __domTypes.RequestConstructor;
|
||||||
Response: typeof __fetch.Response;
|
Response: typeof __fetch.Response;
|
||||||
performance: __performanceUtil.Performance;
|
|
||||||
Worker: typeof __workers.WorkerImpl;
|
Worker: typeof __workers.WorkerImpl;
|
||||||
location: __domTypes.Location;
|
location: __domTypes.Location;
|
||||||
|
|
||||||
|
@ -221,8 +216,6 @@ declare namespace WebAssembly {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare const atob: typeof __textEncoding.atob;
|
|
||||||
declare const btoa: typeof __textEncoding.btoa;
|
|
||||||
declare const fetch: typeof __fetch.fetch;
|
declare const fetch: typeof __fetch.fetch;
|
||||||
|
|
||||||
/** Sets a timer which executes a function once after the timer expires. */
|
/** Sets a timer which executes a function once after the timer expires. */
|
||||||
|
@ -255,12 +248,9 @@ declare const URLSearchParams: typeof __urlSearchParams.URLSearchParams;
|
||||||
declare const Headers: __domTypes.HeadersConstructor;
|
declare const Headers: __domTypes.HeadersConstructor;
|
||||||
declare const location: __domTypes.Location;
|
declare const location: __domTypes.Location;
|
||||||
declare const FormData: __domTypes.FormDataConstructor;
|
declare const FormData: __domTypes.FormDataConstructor;
|
||||||
declare const TextEncoder: typeof __textEncoding.TextEncoder;
|
|
||||||
declare const TextDecoder: typeof __textEncoding.TextDecoder;
|
|
||||||
declare const ReadableStream: __domTypes.ReadableStreamConstructor;
|
declare const ReadableStream: __domTypes.ReadableStreamConstructor;
|
||||||
declare const Request: __domTypes.RequestConstructor;
|
declare const Request: __domTypes.RequestConstructor;
|
||||||
declare const Response: typeof __fetch.Response;
|
declare const Response: typeof __fetch.Response;
|
||||||
declare const performance: __performanceUtil.Performance;
|
|
||||||
declare const Worker: typeof __workers.WorkerImpl;
|
declare const Worker: typeof __workers.WorkerImpl;
|
||||||
|
|
||||||
declare const addEventListener: (
|
declare const addEventListener: (
|
||||||
|
@ -288,8 +278,6 @@ declare type URL = __url.URL;
|
||||||
declare type URLSearchParams = __domTypes.URLSearchParams;
|
declare type URLSearchParams = __domTypes.URLSearchParams;
|
||||||
declare type Headers = __domTypes.Headers;
|
declare type Headers = __domTypes.Headers;
|
||||||
declare type FormData = __domTypes.FormData;
|
declare type FormData = __domTypes.FormData;
|
||||||
declare type TextEncoder = __textEncoding.TextEncoder;
|
|
||||||
declare type TextDecoder = __textEncoding.TextDecoder;
|
|
||||||
declare type ReadableStream<R = any> = __domTypes.ReadableStream<R>;
|
declare type ReadableStream<R = any> = __domTypes.ReadableStream<R>;
|
||||||
declare type Request = __domTypes.Request;
|
declare type Request = __domTypes.Request;
|
||||||
declare type Response = __domTypes.Response;
|
declare type Response = __domTypes.Response;
|
||||||
|
@ -1366,44 +1354,37 @@ declare namespace __fetch {
|
||||||
): Promise<Response>;
|
): Promise<Response>;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare namespace __textEncoding {
|
declare function atob(s: string): string;
|
||||||
export function atob(s: string): string;
|
|
||||||
/** Creates a base-64 ASCII string from the input string. */
|
/** Creates a base-64 ASCII string from the input string. */
|
||||||
export function btoa(s: string): string;
|
declare function btoa(s: string): string;
|
||||||
export interface TextDecodeOptions {
|
|
||||||
stream?: false;
|
declare class TextDecoder {
|
||||||
}
|
/** Returns encoding's name, lowercased. */
|
||||||
export interface TextDecoderOptions {
|
readonly encoding: string;
|
||||||
fatal?: boolean;
|
/** Returns `true` if error mode is "fatal", and `false` otherwise. */
|
||||||
ignoreBOM?: boolean;
|
readonly fatal: boolean;
|
||||||
}
|
/** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
|
||||||
export class TextDecoder {
|
readonly ignoreBOM = false;
|
||||||
/** Returns encoding's name, lowercased. */
|
constructor(
|
||||||
readonly encoding: string;
|
label?: string,
|
||||||
/** Returns `true` if error mode is "fatal", and `false` otherwise. */
|
options?: { fatal?: boolean; ignoreBOM?: boolean }
|
||||||
readonly fatal: boolean;
|
);
|
||||||
/** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
|
/** Returns the result of running encoding's decoder. */
|
||||||
readonly ignoreBOM = false;
|
decode(input?: __domTypes.BufferSource, options?: { stream?: false }): string;
|
||||||
constructor(label?: string, options?: TextDecoderOptions);
|
readonly [Symbol.toStringTag]: string;
|
||||||
/** Returns the result of running encoding's decoder. */
|
}
|
||||||
decode(
|
|
||||||
input?: __domTypes.BufferSource,
|
declare class TextEncoder {
|
||||||
options?: TextDecodeOptions
|
/** Returns "utf-8". */
|
||||||
): string;
|
readonly encoding = "utf-8";
|
||||||
readonly [Symbol.toStringTag]: string;
|
/** Returns the result of running UTF-8's encoder. */
|
||||||
}
|
encode(input?: string): Uint8Array;
|
||||||
interface TextEncoderEncodeIntoResult {
|
encodeInto(
|
||||||
read: number;
|
input: string,
|
||||||
written: number;
|
dest: Uint8Array
|
||||||
}
|
): { read: number; written: number };
|
||||||
export class TextEncoder {
|
readonly [Symbol.toStringTag]: string;
|
||||||
/** Returns "utf-8". */
|
|
||||||
readonly encoding = "utf-8";
|
|
||||||
/** Returns the result of running UTF-8's encoder. */
|
|
||||||
encode(input?: string): Uint8Array;
|
|
||||||
encodeInto(input: string, dest: Uint8Array): TextEncoderEncodeIntoResult;
|
|
||||||
readonly [Symbol.toStringTag]: string;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare namespace __urlSearchParams {
|
declare namespace __urlSearchParams {
|
||||||
|
@ -1554,17 +1535,15 @@ declare namespace __workers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare namespace __performanceUtil {
|
declare namespace performance {
|
||||||
export class Performance {
|
/** Returns a current time from Deno's start in milliseconds.
|
||||||
/** Returns a current time from Deno's start in milliseconds.
|
*
|
||||||
*
|
* Use the flag --allow-hrtime return a precise value.
|
||||||
* Use the flag --allow-hrtime return a precise value.
|
*
|
||||||
*
|
* const t = performance.now();
|
||||||
* const t = performance.now();
|
* console.log(`${t} ms since start!`);
|
||||||
* console.log(`${t} ms since start!`);
|
*/
|
||||||
*/
|
export function now(): number;
|
||||||
now(): number;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any */
|
/* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue