Skip to content

Commit 9caf516

Browse files
committed
add Console types
1 parent 4a32410 commit 9caf516

File tree

6 files changed

+117
-163
lines changed

6 files changed

+117
-163
lines changed

baselines/dom.generated.d.ts

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,40 +3723,6 @@ interface ConcatParams extends Algorithm {
37233723
publicInfo?: Uint8Array;
37243724
}
37253725

3726-
/** 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. */
3727-
interface Console {
3728-
memory: any;
3729-
assert(condition?: boolean, message?: string, ...data: any[]): void;
3730-
clear(): void;
3731-
count(label?: string): void;
3732-
debug(message?: any, ...optionalParams: any[]): void;
3733-
dir(value?: any, ...optionalParams: any[]): void;
3734-
dirxml(value: any): void;
3735-
error(message?: any, ...optionalParams: any[]): void;
3736-
exception(message?: string, ...optionalParams: any[]): void;
3737-
group(groupTitle?: string, ...optionalParams: any[]): void;
3738-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
3739-
groupEnd(): void;
3740-
info(message?: any, ...optionalParams: any[]): void;
3741-
log(message?: any, ...optionalParams: any[]): void;
3742-
markTimeline(label?: string): void;
3743-
profile(reportName?: string): void;
3744-
profileEnd(reportName?: string): void;
3745-
table(...tabularData: any[]): void;
3746-
time(label?: string): void;
3747-
timeEnd(label?: string): void;
3748-
timeStamp(label?: string): void;
3749-
timeline(label?: string): void;
3750-
timelineEnd(label?: string): void;
3751-
trace(message?: any, ...optionalParams: any[]): void;
3752-
warn(message?: any, ...optionalParams: any[]): void;
3753-
}
3754-
3755-
declare var Console: {
3756-
prototype: Console;
3757-
new(): Console;
3758-
};
3759-
37603726
interface ConstantSourceNode extends AudioScheduledSourceNode {
37613727
readonly offset: AudioParam;
37623728
addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -18590,7 +18556,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler
1859018556
}
1859118557

1859218558
/** A window containing a DOM document; the document property points to the DOM document loaded in that window. */
18593-
interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage {
18559+
interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage {
1859418560
readonly applicationCache: ApplicationCache;
1859518561
readonly clientInformation: Navigator;
1859618562
readonly closed: boolean;
@@ -18721,10 +18687,6 @@ declare var Window: {
1872118687
new(): Window;
1872218688
};
1872318689

18724-
interface WindowConsole {
18725-
readonly console: Console;
18726-
}
18727-
1872818690
interface WindowEventHandlersEventMap {
1872918691
"afterprint": Event;
1873018692
"beforeprint": Event;
@@ -19125,6 +19087,31 @@ declare var webkitRTCPeerConnection: {
1912519087

1912619088
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
1912719089

19090+
declare namespace console {
19091+
var memory: any;
19092+
function assert(condition?: boolean, ...data: any[]): void;
19093+
function clear(): void;
19094+
function count(label?: string): void;
19095+
function countReset(label?: string): void;
19096+
function debug(...data: any[]): void;
19097+
function dir(item: any, options?: any): void;
19098+
function dirxml(...data: any[]): void;
19099+
function error(...data: any[]): void;
19100+
function exception(message?: string, ...optionalParams: any[]): void;
19101+
function group(...data: any[]): void;
19102+
function groupCollapsed(...data: any[]): void;
19103+
function groupEnd(): void;
19104+
function info(...data: any[]): void;
19105+
function log(...data: any[]): void;
19106+
function table(tabularData: any, properties?: string[]): void;
19107+
function time(label?: string): void;
19108+
function timeEnd(label?: string): void;
19109+
function timeLog(label?: string, ...data: any[]): void;
19110+
function timeStamp(label?: string): void;
19111+
function trace(...data: any[]): void;
19112+
function warn(...data: any[]): void;
19113+
}
19114+
1912819115
declare namespace WebAssembly {
1912919116
interface CompileError {
1913019117
}
@@ -19706,7 +19693,6 @@ declare function toString(): string;
1970619693
declare function dispatchEvent(event: Event): boolean;
1970719694
declare var sessionStorage: Storage;
1970819695
declare var localStorage: Storage;
19709-
declare var console: Console;
1971019696
/**
1971119697
* Fires when the user aborts the download.
1971219698
* @param ev The event.

baselines/webworker.generated.d.ts

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -924,40 +924,6 @@ interface ConcatParams extends Algorithm {
924924
publicInfo?: Uint8Array;
925925
}
926926

927-
/** 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. */
928-
interface Console {
929-
memory: any;
930-
assert(condition?: boolean, message?: string, ...data: any[]): void;
931-
clear(): void;
932-
count(label?: string): void;
933-
debug(message?: any, ...optionalParams: any[]): void;
934-
dir(value?: any, ...optionalParams: any[]): void;
935-
dirxml(value: any): void;
936-
error(message?: any, ...optionalParams: any[]): void;
937-
exception(message?: string, ...optionalParams: any[]): void;
938-
group(groupTitle?: string, ...optionalParams: any[]): void;
939-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
940-
groupEnd(): void;
941-
info(message?: any, ...optionalParams: any[]): void;
942-
log(message?: any, ...optionalParams: any[]): void;
943-
markTimeline(label?: string): void;
944-
profile(reportName?: string): void;
945-
profileEnd(reportName?: string): void;
946-
table(...tabularData: any[]): void;
947-
time(label?: string): void;
948-
timeEnd(label?: string): void;
949-
timeStamp(label?: string): void;
950-
timeline(label?: string): void;
951-
timelineEnd(label?: string): void;
952-
trace(message?: any, ...optionalParams: any[]): void;
953-
warn(message?: any, ...optionalParams: any[]): void;
954-
}
955-
956-
declare var Console: {
957-
prototype: Console;
958-
new(): Console;
959-
};
960-
961927
/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */
962928
interface CountQueuingStrategy extends QueuingStrategy {
963929
highWaterMark: number;
@@ -5361,10 +5327,6 @@ declare var WindowClient: {
53615327
new(): WindowClient;
53625328
};
53635329

5364-
interface WindowConsole {
5365-
readonly console: Console;
5366-
}
5367-
53685330
interface WindowOrWorkerGlobalScope {
53695331
readonly caches: CacheStorage;
53705332
readonly crypto: Crypto;
@@ -5409,7 +5371,7 @@ interface WorkerGlobalScopeEventMap {
54095371
}
54105372

54115373
/** 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. */
5412-
interface WorkerGlobalScope extends EventTarget, WindowConsole, WindowOrWorkerGlobalScope, WorkerUtils {
5374+
interface WorkerGlobalScope extends EventTarget, WindowOrWorkerGlobalScope, WorkerUtils {
54135375
readonly caches: CacheStorage;
54145376
readonly isSecureContext: boolean;
54155377
readonly location: WorkerLocation;
@@ -5646,6 +5608,31 @@ declare var XMLHttpRequestUpload: {
56465608

56475609
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
56485610

5611+
declare namespace console {
5612+
var memory: any;
5613+
function assert(condition?: boolean, ...data: any[]): void;
5614+
function clear(): void;
5615+
function count(label?: string): void;
5616+
function countReset(label?: string): void;
5617+
function debug(...data: any[]): void;
5618+
function dir(item: any, options?: any): void;
5619+
function dirxml(...data: any[]): void;
5620+
function error(...data: any[]): void;
5621+
function exception(message?: string, ...optionalParams: any[]): void;
5622+
function group(...data: any[]): void;
5623+
function groupCollapsed(...data: any[]): void;
5624+
function groupEnd(): void;
5625+
function info(...data: any[]): void;
5626+
function log(...data: any[]): void;
5627+
function table(tabularData: any, properties?: string[]): void;
5628+
function time(label?: string): void;
5629+
function timeEnd(label?: string): void;
5630+
function timeLog(label?: string, ...data: any[]): void;
5631+
function timeStamp(label?: string): void;
5632+
function trace(...data: any[]): void;
5633+
function warn(...data: any[]): void;
5634+
}
5635+
56495636
declare namespace WebAssembly {
56505637
interface Global {
56515638
value: any;
@@ -5828,7 +5815,6 @@ declare var navigator: WorkerNavigator;
58285815
declare function importScripts(...urls: string[]): void;
58295816
declare function atob(encodedString: string): string;
58305817
declare function btoa(rawString: string): string;
5831-
declare var console: Console;
58325818
declare var caches: CacheStorage;
58335819
declare var crypto: Crypto;
58345820
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: 27 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -994,79 +994,6 @@
994994
}
995995
}
996996
},
997-
"Console": {
998-
"name": "Console",
999-
"methods": {
1000-
"method": {
1001-
"debug": {
1002-
"name": "debug",
1003-
"override-signatures": [
1004-
"debug(message?: any, ...optionalParams: any[]): void"
1005-
]
1006-
},
1007-
"dir": {
1008-
"name": "dir",
1009-
"override-signatures": [
1010-
"dir(value?: any, ...optionalParams: any[]): void"
1011-
]
1012-
},
1013-
"dirxml": {
1014-
"name": "dirxml",
1015-
"override-signatures": [
1016-
"dirxml(value: any): void"
1017-
]
1018-
},
1019-
"error": {
1020-
"name": "error",
1021-
"override-signatures": [
1022-
"error(message?: any, ...optionalParams: any[]): void"
1023-
]
1024-
},
1025-
"info": {
1026-
"name": "info",
1027-
"override-signatures": [
1028-
"info(message?: any, ...optionalParams: any[]): void"
1029-
]
1030-
},
1031-
"log": {
1032-
"name": "log",
1033-
"override-signatures": [
1034-
"log(message?: any, ...optionalParams: any[]): void"
1035-
]
1036-
},
1037-
"warn": {
1038-
"name": "warn",
1039-
"override-signatures": [
1040-
"warn(message?: any, ...optionalParams: any[]): void"
1041-
]
1042-
},
1043-
"group": {
1044-
"name": "group",
1045-
"override-signatures": [
1046-
"group(groupTitle?: string, ...optionalParams: any[]): void"
1047-
]
1048-
},
1049-
"groupCollapsed": {
1050-
"name": "groupCollapsed",
1051-
"override-signatures": [
1052-
"groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void"
1053-
]
1054-
},
1055-
"trace": {
1056-
"name": "trace",
1057-
"override-signatures": [
1058-
"trace(message?: any, ...optionalParams: any[]): void"
1059-
]
1060-
},
1061-
"profileEnd": {
1062-
"name": "profileEnd",
1063-
"override-signatures": [
1064-
"profileEnd(reportName?: string): void"
1065-
]
1066-
}
1067-
}
1068-
}
1069-
},
1070997
"FormData": {
1071998
"name": "FormData",
1072999
"methods": {
@@ -3237,6 +3164,33 @@
32373164
]
32383165
},
32393166
"namespaces": [
3167+
{
3168+
"name": "console",
3169+
"methods": {
3170+
"method": {
3171+
"exception": {
3172+
"name": "exception",
3173+
"override-signatures": [
3174+
"exception(message?: string, ...optionalParams: any[]): void"
3175+
]
3176+
},
3177+
"timeStamp": {
3178+
"name": "timeStamp",
3179+
"override-signatures": [
3180+
"timeStamp(label?: string): void"
3181+
]
3182+
}
3183+
}
3184+
},
3185+
"properties": {
3186+
"property": {
3187+
"memory": {
3188+
"name": "memory",
3189+
"type": "any"
3190+
}
3191+
}
3192+
}
3193+
},
32403194
{
32413195
"name": "WebAssembly",
32423196
"methods": {

inputfiles/removedTypes.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,7 @@
6868
}
6969
},
7070
"ClipboardItem": null,
71-
"Console": {
72-
"methods": {
73-
"method": {
74-
"msIsIndependentlyComposed": null,
75-
"select": null
76-
}
77-
}
78-
},
71+
"Console": null,
7972
"CSSStyleDeclaration": {
8073
"properties": {
8174
"property": {
@@ -321,12 +314,14 @@
321314
"GlobalFetch",
322315
"IDBEnvironment",
323316
"WindowBase64",
324-
"WindowTimers"
317+
"WindowTimers",
318+
"WindowConsole"
325319
]
326320
},
327321
"WorkerGlobalScope": {
328322
"implements": [
329-
"GlobalFetch"
323+
"GlobalFetch",
324+
"WindowConsole"
330325
]
331326
},
332327
"XPathNSResolver": null

0 commit comments

Comments
 (0)