summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-09-24 11:40:33 +0100
committerGitHub <noreply@github.com>2020-09-24 20:40:33 +1000
commit6a2ce3d91f513f09920cd3960adb4bd5e26c8faa (patch)
tree92a8562db791c413958d8206191ad39fbe0b9fd7
parent6254bd41b72705fc5fba02f9006302dc0c85ea80 (diff)
fix(lib.deno.shared_globals): Change the Console class to an interface (#7646)
Fixes #7494
-rw-r--r--cli/dts/lib.deno.shared_globals.d.ts86
1 files changed, 23 insertions, 63 deletions
diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts
index ba0719a83..0d55b84a2 100644
--- a/cli/dts/lib.deno.shared_globals.d.ts
+++ b/cli/dts/lib.deno.shared_globals.d.ts
@@ -191,7 +191,6 @@ interface VoidFunction {
*/
declare function queueMicrotask(func: VoidFunction): void;
-declare var console: Console;
declare var crypto: Crypto;
/** Registers an event listener in the global scope, which will be called
@@ -242,70 +241,31 @@ type BufferSource = ArrayBufferView | ArrayBuffer;
declare const isConsoleInstance: unique symbol;
-declare class Console {
- indentLevel: number;
- [isConsoleInstance]: boolean;
- /** Writes the arguments to stdout */
- log: (...args: unknown[]) => void;
- /** Writes the arguments to stdout */
- debug: (...args: unknown[]) => void;
- /** Writes the arguments to stdout */
- info: (...args: unknown[]) => void;
- /** Writes the properties of the supplied `obj` to stdout */
- dir: (
- obj: unknown,
- options?: Partial<{
- depth: number;
- indentLevel: number;
- }>,
- ) => void;
-
- /** Displays an interactive tree of the descendant elements of
- * the specified XML/HTML element. If it is not possible to display
- * as an element the JavaScript Object view is shown instead.
- * The output is presented as a hierarchical listing of expandable
- * nodes that let you see the contents of child nodes.
- *
- * Since we write to stdout, we can't display anything interactive
- * we just fall back to `console.dir`.
- *
- * > [Console.dirxml](https://developer.mozilla.org/en-US/docs/Web/API/Console/dirxml)
- * > by Mozilla Contributors is licensed under CC-BY-SA 2.5.
- */
- dirxml: (
- obj: unknown,
- options?: Partial<{
- showHidden: boolean;
- depth: number;
- colors: boolean;
- indentLevel: number;
- }>,
- ) => void;
-
- /** Writes the arguments to stdout */
- warn: (...args: unknown[]) => void;
- /** Writes the arguments to stdout */
- error: (...args: unknown[]) => void;
- /** Writes an error message to stdout if the assertion is `false`. If the
- * assertion is `true`, nothing happens.
- *
- * ref: https://console.spec.whatwg.org/#assert
- */
- assert: (condition?: boolean, ...args: unknown[]) => void;
- count: (label?: string) => void;
- countReset: (label?: string) => void;
- table: (data: unknown, properties?: string[] | undefined) => void;
- time: (label?: string) => void;
- timeLog: (label?: string, ...args: unknown[]) => void;
- timeEnd: (label?: string) => void;
- group: (...label: unknown[]) => void;
- groupCollapsed: (...label: unknown[]) => void;
- groupEnd: () => void;
- clear: () => void;
- trace: (...args: unknown[]) => void;
- static [Symbol.hasInstance](instance: Console): boolean;
+declare interface Console {
+ assert(condition?: boolean, ...data: any[]): void;
+ clear(): void;
+ count(label?: string): void;
+ countReset(label?: string): void;
+ debug(...data: any[]): void;
+ dir(item?: any, options?: any): void;
+ dirxml(...data: any[]): void;
+ error(...data: any[]): void;
+ group(...data: any[]): void;
+ groupCollapsed(...data: any[]): void;
+ groupEnd(): void;
+ info(...data: any[]): void;
+ log(...data: any[]): void;
+ table(tabularData?: any, properties?: string[]): void;
+ time(label?: string): void;
+ timeEnd(label?: string): void;
+ timeLog(label?: string, ...data: any[]): void;
+ timeStamp(label?: string): void;
+ trace(...data: any[]): void;
+ warn(...data: any[]): void;
}
+declare var console: Console;
+
declare interface Crypto {
readonly subtle: null;
getRandomValues<