Skip to content

Commit 4c5bee4

Browse files
committed
add Console types
1 parent 10a86a2 commit 4c5bee4

File tree

6 files changed

+84
-163
lines changed

6 files changed

+84
-163
lines changed

baselines/dom.generated.d.ts

Lines changed: 23 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3519,40 +3519,6 @@ interface ConcatParams extends Algorithm {
35193519
publicInfo?: Uint8Array;
35203520
}
35213521

3522-
/** Provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. */
3523-
interface Console {
3524-
memory: any;
3525-
assert(condition?: boolean, message?: string, ...data: any[]): void;
3526-
clear(): void;
3527-
count(label?: string): void;
3528-
debug(message?: any, ...optionalParams: any[]): void;
3529-
dir(value?: any, ...optionalParams: any[]): void;
3530-
dirxml(value: any): void;
3531-
error(message?: any, ...optionalParams: any[]): void;
3532-
exception(message?: string, ...optionalParams: any[]): void;
3533-
group(groupTitle?: string, ...optionalParams: any[]): void;
3534-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
3535-
groupEnd(): void;
3536-
info(message?: any, ...optionalParams: any[]): void;
3537-
log(message?: any, ...optionalParams: any[]): void;
3538-
markTimeline(label?: string): void;
3539-
profile(reportName?: string): void;
3540-
profileEnd(reportName?: string): void;
3541-
table(...tabularData: any[]): void;
3542-
time(label?: string): void;
3543-
timeEnd(label?: string): void;
3544-
timeStamp(label?: string): void;
3545-
timeline(label?: string): void;
3546-
timelineEnd(label?: string): void;
3547-
trace(message?: any, ...optionalParams: any[]): void;
3548-
warn(message?: any, ...optionalParams: any[]): void;
3549-
}
3550-
3551-
declare var Console: {
3552-
prototype: Console;
3553-
new(): Console;
3554-
};
3555-
35563522
interface ConstantSourceNode extends AudioScheduledSourceNode {
35573523
readonly offset: AudioParam;
35583524
addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -18327,7 +18293,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler
1832718293
}
1832818294

1832918295
/** A window containing a DOM document; the document property points to the DOM document loaded in that window. */
18330-
interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, AnimationFrameProvider, WindowOrWorkerGlobalScope, WindowEventHandlers {
18296+
interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, GlobalEventHandlers, IDBEnvironment, WindowBase64, AnimationFrameProvider, WindowOrWorkerGlobalScope, WindowEventHandlers {
1833118297
Blob: typeof Blob;
1833218298
TextDecoder: typeof TextDecoder;
1833318299
TextEncoder: typeof TextEncoder;
@@ -18471,10 +18437,6 @@ interface WindowBase64 {
1847118437
btoa(rawString: string): string;
1847218438
}
1847318439

18474-
interface WindowConsole {
18475-
readonly console: Console;
18476-
}
18477-
1847818440
interface WindowEventHandlersEventMap {
1847918441
"afterprint": Event;
1848018442
"beforeprint": Event;
@@ -18878,6 +18840,28 @@ declare var webkitRTCPeerConnection: {
1887818840

1887918841
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
1888018842

18843+
declare namespace console {
18844+
function assert(condition?: boolean, ...data: any[]): void;
18845+
function clear(): void;
18846+
function count(label?: string): void;
18847+
function countReset(label?: string): void;
18848+
function debug(...data: any[]): void;
18849+
function dir(item: any, options?: any): void;
18850+
function dirxml(...data: any[]): void;
18851+
function error(...data: any[]): void;
18852+
function group(...data: any[]): void;
18853+
function groupCollapsed(...data: any[]): void;
18854+
function groupEnd(): void;
18855+
function info(...data: any[]): void;
18856+
function log(...data: any[]): void;
18857+
function table(tabularData: any, properties?: string[]): void;
18858+
function time(label?: string): void;
18859+
function timeEnd(label?: string): void;
18860+
function timeLog(label?: string, ...data: any[]): void;
18861+
function trace(...data: any[]): void;
18862+
function warn(...data: any[]): void;
18863+
}
18864+
1888118865
declare namespace WebAssembly {
1888218866
interface CompileError {
1888318867
}
@@ -19455,7 +19439,6 @@ declare function toString(): string;
1945519439
declare function dispatchEvent(event: Event): boolean;
1945619440
declare var sessionStorage: Storage;
1945719441
declare var localStorage: Storage;
19458-
declare var console: Console;
1945919442
/**
1946019443
* Fires when the user aborts the download.
1946119444
* @param ev The event.

baselines/webworker.generated.d.ts

Lines changed: 23 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -895,40 +895,6 @@ interface ConcatParams extends Algorithm {
895895
publicInfo?: Uint8Array;
896896
}
897897

898-
/** Provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. */
899-
interface Console {
900-
memory: any;
901-
assert(condition?: boolean, message?: string, ...data: any[]): void;
902-
clear(): void;
903-
count(label?: string): void;
904-
debug(message?: any, ...optionalParams: any[]): void;
905-
dir(value?: any, ...optionalParams: any[]): void;
906-
dirxml(value: any): void;
907-
error(message?: any, ...optionalParams: any[]): void;
908-
exception(message?: string, ...optionalParams: any[]): void;
909-
group(groupTitle?: string, ...optionalParams: any[]): void;
910-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
911-
groupEnd(): void;
912-
info(message?: any, ...optionalParams: any[]): void;
913-
log(message?: any, ...optionalParams: any[]): void;
914-
markTimeline(label?: string): void;
915-
profile(reportName?: string): void;
916-
profileEnd(reportName?: string): void;
917-
table(...tabularData: any[]): void;
918-
time(label?: string): void;
919-
timeEnd(label?: string): void;
920-
timeStamp(label?: string): void;
921-
timeline(label?: string): void;
922-
timelineEnd(label?: string): void;
923-
trace(message?: any, ...optionalParams: any[]): void;
924-
warn(message?: any, ...optionalParams: any[]): void;
925-
}
926-
927-
declare var Console: {
928-
prototype: Console;
929-
new(): Console;
930-
};
931-
932898
/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */
933899
interface CountQueuingStrategy extends QueuingStrategy {
934900
highWaterMark: number;
@@ -5284,10 +5250,6 @@ declare var WindowClient: {
52845250
new(): WindowClient;
52855251
};
52865252

5287-
interface WindowConsole {
5288-
readonly console: Console;
5289-
}
5290-
52915253
interface WindowOrWorkerGlobalScope {
52925254
readonly caches: CacheStorage;
52935255
readonly crypto: Crypto;
@@ -5332,7 +5294,7 @@ interface WorkerGlobalScopeEventMap {
53325294
}
53335295

53345296
/** This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */
5335-
interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, WindowOrWorkerGlobalScope {
5297+
interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowOrWorkerGlobalScope {
53365298
readonly caches: CacheStorage;
53375299
readonly isSecureContext: boolean;
53385300
readonly location: WorkerLocation;
@@ -5569,6 +5531,28 @@ declare var XMLHttpRequestUpload: {
55695531

55705532
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
55715533

5534+
declare namespace console {
5535+
function assert(condition?: boolean, ...data: any[]): void;
5536+
function clear(): void;
5537+
function count(label?: string): void;
5538+
function countReset(label?: string): void;
5539+
function debug(...data: any[]): void;
5540+
function dir(item: any, options?: any): void;
5541+
function dirxml(...data: any[]): void;
5542+
function error(...data: any[]): void;
5543+
function group(...data: any[]): void;
5544+
function groupCollapsed(...data: any[]): void;
5545+
function groupEnd(): void;
5546+
function info(...data: any[]): void;
5547+
function log(...data: any[]): void;
5548+
function table(tabularData: any, properties?: string[]): void;
5549+
function time(label?: string): void;
5550+
function timeEnd(label?: string): void;
5551+
function timeLog(label?: string, ...data: any[]): void;
5552+
function trace(...data: any[]): void;
5553+
function warn(...data: any[]): void;
5554+
}
5555+
55725556
declare namespace WebAssembly {
55735557
interface Global {
55745558
value: any;
@@ -5739,7 +5723,6 @@ declare var navigator: WorkerNavigator;
57395723
declare function importScripts(...urls: string[]): void;
57405724
declare function atob(encodedString: string): string;
57415725
declare function btoa(rawString: string): string;
5742-
declare var console: Console;
57435726
declare var caches: CacheStorage;
57445727
declare var crypto: Crypto;
57455728
declare var indexedDB: IDBFactory;

inputfiles/idl/Console.widl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[Exposed=(Window,Worker,Worklet)]
2+
namespace console { // but see namespace object requirements below
3+
// Logging
4+
void assert(optional boolean condition = false, any... data);
5+
void clear();
6+
void debug(any... data);
7+
void error(any... data);
8+
void info(any... data);
9+
void log(any... data);
10+
void table(any tabularData, optional sequence<DOMString> properties);
11+
void trace(any... data);
12+
void warn(any... data);
13+
void dir(any item, optional object? options);
14+
void dirxml(any... data);
15+
16+
// Counting
17+
void count(optional DOMString label = "default");
18+
void countReset(optional DOMString label = "default");
19+
20+
// Grouping
21+
void group(any... data);
22+
void groupCollapsed(any... data);
23+
void groupEnd();
24+
25+
// Timing
26+
void time(optional DOMString label = "default");
27+
void timeLog(optional DOMString label = "default", any... data);
28+
void timeEnd(optional DOMString label = "default");
29+
};

inputfiles/idlSources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"title": "Compatibility",
99
"deprecated": true
1010
},
11+
{
12+
"url": "https://console.spec.whatwg.org/",
13+
"title": "Console"
14+
},
1115
{
1216
"url": "https://www.w3.org/TR/credential-management-1/",
1317
"title": "Credential Management"

inputfiles/overridingTypes.json

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -944,79 +944,6 @@
944944
}
945945
}
946946
},
947-
"Console": {
948-
"name": "Console",
949-
"methods": {
950-
"method": {
951-
"debug": {
952-
"name": "debug",
953-
"override-signatures": [
954-
"debug(message?: any, ...optionalParams: any[]): void"
955-
]
956-
},
957-
"dir": {
958-
"name": "dir",
959-
"override-signatures": [
960-
"dir(value?: any, ...optionalParams: any[]): void"
961-
]
962-
},
963-
"dirxml": {
964-
"name": "dirxml",
965-
"override-signatures": [
966-
"dirxml(value: any): void"
967-
]
968-
},
969-
"error": {
970-
"name": "error",
971-
"override-signatures": [
972-
"error(message?: any, ...optionalParams: any[]): void"
973-
]
974-
},
975-
"info": {
976-
"name": "info",
977-
"override-signatures": [
978-
"info(message?: any, ...optionalParams: any[]): void"
979-
]
980-
},
981-
"log": {
982-
"name": "log",
983-
"override-signatures": [
984-
"log(message?: any, ...optionalParams: any[]): void"
985-
]
986-
},
987-
"warn": {
988-
"name": "warn",
989-
"override-signatures": [
990-
"warn(message?: any, ...optionalParams: any[]): void"
991-
]
992-
},
993-
"group": {
994-
"name": "group",
995-
"override-signatures": [
996-
"group(groupTitle?: string, ...optionalParams: any[]): void"
997-
]
998-
},
999-
"groupCollapsed": {
1000-
"name": "groupCollapsed",
1001-
"override-signatures": [
1002-
"groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void"
1003-
]
1004-
},
1005-
"trace": {
1006-
"name": "trace",
1007-
"override-signatures": [
1008-
"trace(message?: any, ...optionalParams: any[]): void"
1009-
]
1010-
},
1011-
"profileEnd": {
1012-
"name": "profileEnd",
1013-
"override-signatures": [
1014-
"profileEnd(reportName?: string): void"
1015-
]
1016-
}
1017-
}
1018-
}
1019-
},
1020947
"FormData": {
1021948
"name": "FormData",
1022949
"methods": {

inputfiles/removedTypes.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,7 @@
5050
}
5151
}
5252
},
53-
"Console": {
54-
"methods": {
55-
"method": {
56-
"msIsIndependentlyComposed": null,
57-
"select": null
58-
}
59-
}
60-
},
53+
"Console": null,
6154
"CSSStyleDeclaration": {
6255
"properties": {
6356
"property": {
@@ -255,7 +248,8 @@
255248
}
256249
},
257250
"implements": [
258-
"GlobalFetch"
251+
"GlobalFetch",
252+
"WindowConsole"
259253
]
260254
},
261255
"WheelEvent": {
@@ -269,7 +263,8 @@
269263
},
270264
"WorkerGlobalScope": {
271265
"implements": [
272-
"GlobalFetch"
266+
"GlobalFetch",
267+
"WindowConsole"
273268
]
274269
},
275270
"XPathEvaluator": {

0 commit comments

Comments
 (0)