Skip to content

Commit f3e2895

Browse files
committed
add Console types
1 parent ae4137a commit f3e2895

11 files changed

+170
-165
lines changed

baselines/dom.generated.d.ts

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,41 +3252,6 @@ interface ConcatParams extends Algorithm {
32523252
publicInfo?: Uint8Array;
32533253
}
32543254

3255-
interface Console {
3256-
memory: any;
3257-
assert(condition?: boolean, message?: string, ...data: any[]): void;
3258-
clear(): void;
3259-
count(label?: string): void;
3260-
debug(message?: any, ...optionalParams: any[]): void;
3261-
dir(value?: any, ...optionalParams: any[]): void;
3262-
dirxml(value: any): void;
3263-
error(message?: any, ...optionalParams: any[]): void;
3264-
exception(message?: string, ...optionalParams: any[]): void;
3265-
group(groupTitle?: string, ...optionalParams: any[]): void;
3266-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
3267-
groupEnd(): void;
3268-
info(message?: any, ...optionalParams: any[]): void;
3269-
log(message?: any, ...optionalParams: any[]): void;
3270-
markTimeline(label?: string): void;
3271-
msIsIndependentlyComposed(element: Element): boolean;
3272-
profile(reportName?: string): void;
3273-
profileEnd(): void;
3274-
select(element: Element): void;
3275-
table(...tabularData: any[]): void;
3276-
time(label?: string): void;
3277-
timeEnd(label?: string): void;
3278-
timeStamp(label?: string): void;
3279-
timeline(label?: string): void;
3280-
timelineEnd(label?: string): void;
3281-
trace(message?: any, ...optionalParams: any[]): void;
3282-
warn(message?: any, ...optionalParams: any[]): void;
3283-
}
3284-
3285-
declare var Console: {
3286-
prototype: Console;
3287-
new(): Console;
3288-
};
3289-
32903255
interface ConvolverNode extends AudioNode {
32913256
buffer: AudioBuffer | null;
32923257
normalize: boolean;
@@ -15428,7 +15393,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap {
1542815393
"waiting": Event;
1542915394
}
1543015395

15431-
interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch {
15396+
interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch {
1543215397
Blob: typeof Blob;
1543315398
URL: typeof URL;
1543415399
URLSearchParams: typeof URLSearchParams;
@@ -15636,10 +15601,6 @@ interface WindowBase64 {
1563615601
btoa(rawString: string): string;
1563715602
}
1563815603

15639-
interface WindowConsole {
15640-
readonly console: Console;
15641-
}
15642-
1564315604
interface WindowEventHandlersEventMap {
1564415605
"afterprint": Event;
1564515606
"beforeprint": Event;
@@ -15954,6 +15915,26 @@ declare var webkitRTCPeerConnection: {
1595415915
new(configuration: RTCConfiguration): webkitRTCPeerConnection;
1595515916
};
1595615917

15918+
declare namespace console {
15919+
function assert(condition?: boolean, ...data: any[]): void;
15920+
function clear(): void;
15921+
function count(label?: string): void;
15922+
function debug(...data: any[]): void;
15923+
function dir(item: any, options?: any): void;
15924+
function dirxml(...data: any[]): void;
15925+
function error(...data: any[]): void;
15926+
function group(...data: any[]): void;
15927+
function groupCollapsed(...data: any[]): void;
15928+
function groupEnd(): void;
15929+
function info(...data: any[]): void;
15930+
function log(...data: any[]): void;
15931+
function table(tabularData: any, properties?: string[]): void;
15932+
function time(label?: string): void;
15933+
function timeEnd(label?: string): void;
15934+
function trace(...data: any[]): void;
15935+
function warn(...data: any[]): void;
15936+
}
15937+
1595715938
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
1595815939

1595915940
interface DecodeErrorCallback {
@@ -16461,7 +16442,6 @@ declare function setImmediate(handler: (...args: any[]) => void): number;
1646116442
declare function setImmediate(handler: any, ...args: any[]): number;
1646216443
declare var sessionStorage: Storage;
1646316444
declare var localStorage: Storage;
16464-
declare var console: Console;
1646516445
declare var onpointercancel: ((this: Window, ev: PointerEvent) => any) | null;
1646616446
declare var onpointerdown: ((this: Window, ev: PointerEvent) => any) | null;
1646716447
declare var onpointerenter: ((this: Window, ev: PointerEvent) => any) | null;

baselines/webworker.generated.d.ts

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -408,41 +408,6 @@ interface ConcatParams extends Algorithm {
408408
publicInfo?: Uint8Array;
409409
}
410410

411-
interface Console {
412-
memory: any;
413-
assert(condition?: boolean, message?: string, ...data: any[]): void;
414-
clear(): void;
415-
count(label?: string): void;
416-
debug(message?: any, ...optionalParams: any[]): void;
417-
dir(value?: any, ...optionalParams: any[]): void;
418-
dirxml(value: any): void;
419-
error(message?: any, ...optionalParams: any[]): void;
420-
exception(message?: string, ...optionalParams: any[]): void;
421-
group(groupTitle?: string, ...optionalParams: any[]): void;
422-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
423-
groupEnd(): void;
424-
info(message?: any, ...optionalParams: any[]): void;
425-
log(message?: any, ...optionalParams: any[]): void;
426-
markTimeline(label?: string): void;
427-
msIsIndependentlyComposed(element: object): boolean;
428-
profile(reportName?: string): void;
429-
profileEnd(): void;
430-
select(element: object): void;
431-
table(...tabularData: any[]): void;
432-
time(label?: string): void;
433-
timeEnd(label?: string): void;
434-
timeStamp(label?: string): void;
435-
timeline(label?: string): void;
436-
timelineEnd(label?: string): void;
437-
trace(message?: any, ...optionalParams: any[]): void;
438-
warn(message?: any, ...optionalParams: any[]): void;
439-
}
440-
441-
declare var Console: {
442-
prototype: Console;
443-
new(): Console;
444-
};
445-
446411
interface CryptoKey {
447412
readonly algorithm: KeyAlgorithm;
448413
readonly extractable: boolean;
@@ -1874,10 +1839,6 @@ declare var WindowClient: {
18741839
new(): WindowClient;
18751840
};
18761841

1877-
interface WindowConsole {
1878-
readonly console: Console;
1879-
}
1880-
18811842
interface WorkerEventMap extends AbstractWorkerEventMap {
18821843
"message": MessageEvent;
18831844
}
@@ -1902,7 +1863,7 @@ interface WorkerGlobalScopeEventMap {
19021863
"error": ErrorEvent;
19031864
}
19041865

1905-
interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, GlobalFetch {
1866+
interface WorkerGlobalScope extends EventTarget, WorkerUtils, GlobalFetch {
19061867
readonly caches: CacheStorage;
19071868
readonly isSecureContext: boolean;
19081869
readonly location: WorkerLocation;
@@ -2049,6 +2010,26 @@ declare var XMLHttpRequestUpload: {
20492010
new(): XMLHttpRequestUpload;
20502011
};
20512012

2013+
declare namespace console {
2014+
function assert(condition?: boolean, ...data: any[]): void;
2015+
function clear(): void;
2016+
function count(label?: string): void;
2017+
function debug(...data: any[]): void;
2018+
function dir(item: any, options?: any): void;
2019+
function dirxml(...data: any[]): void;
2020+
function error(...data: any[]): void;
2021+
function group(...data: any[]): void;
2022+
function groupCollapsed(...data: any[]): void;
2023+
function groupEnd(): void;
2024+
function info(...data: any[]): void;
2025+
function log(...data: any[]): void;
2026+
function table(tabularData: any, properties?: string[]): void;
2027+
function time(label?: string): void;
2028+
function timeEnd(label?: string): void;
2029+
function trace(...data: any[]): void;
2030+
function warn(...data: any[]): void;
2031+
}
2032+
20522033
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
20532034

20542035
interface ErrorEventHandler {
@@ -2097,7 +2078,6 @@ declare function setInterval(handler: any, timeout?: any, ...args: any[]): numbe
20972078
declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
20982079
declare function atob(encodedString: string): string;
20992080
declare function btoa(rawString: string): string;
2100-
declare var console: Console;
21012081
declare function fetch(input?: Request | string, init?: RequestInit): Promise<Response>;
21022082
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
21032083
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;

inputfiles/idl/Console.widl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 count(optional DOMString label = "default");
7+
void debug(any... data);
8+
void error(any... data);
9+
void info(any... data);
10+
void log(any... data);
11+
void table(any tabularData, optional sequence<DOMString> properties);
12+
void trace(any... data);
13+
void warn(any... data);
14+
void dir(any item, optional object? options);
15+
void dirxml(any... data);
16+
17+
// Grouping
18+
void group(any... data);
19+
void groupCollapsed(any... data);
20+
void groupEnd();
21+
22+
// Timing
23+
void time(optional DOMString label = "default");
24+
void timeEnd(optional DOMString label = "default");
25+
};

inputfiles/idlSources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[
2+
{
3+
"url": "https://console.spec.whatwg.org/",
4+
"title": "Console"
5+
},
26
{
37
"url": "https://encoding.spec.whatwg.org/",
48
"title": "Encoding"

inputfiles/overridingTypes.json

Lines changed: 17 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,23 @@
248248
}
249249
}
250250
},
251-
"overide-index-signatures": []
251+
"overide-index-signatures": [],
252+
"override-implements": [
253+
"WindowTimers",
254+
"WindowSessionStorage",
255+
"WindowLocalStorage",
256+
"GlobalEventHandlers",
257+
"IDBEnvironment",
258+
"WindowBase64",
259+
"GlobalFetch"
260+
]
261+
},
262+
"WorkerGlobalScope": {
263+
"name": "WorkerGlobalScope",
264+
"override-implements": [
265+
"WorkerUtils",
266+
"GlobalFetch"
267+
]
252268
},
253269
"Document": {
254270
"name": "Document",
@@ -878,73 +894,6 @@
878894
}
879895
}
880896
},
881-
"Console": {
882-
"name": "Console",
883-
"methods": {
884-
"method": {
885-
"debug": {
886-
"name": "debug",
887-
"override-signatures": [
888-
"debug(message?: any, ...optionalParams: any[]): void"
889-
]
890-
},
891-
"dir": {
892-
"name": "dir",
893-
"override-signatures": [
894-
"dir(value?: any, ...optionalParams: any[]): void"
895-
]
896-
},
897-
"dirxml": {
898-
"name": "dirxml",
899-
"override-signatures": [
900-
"dirxml(value: any): void"
901-
]
902-
},
903-
"error": {
904-
"name": "error",
905-
"override-signatures": [
906-
"error(message?: any, ...optionalParams: any[]): void"
907-
]
908-
},
909-
"info": {
910-
"name": "info",
911-
"override-signatures": [
912-
"info(message?: any, ...optionalParams: any[]): void"
913-
]
914-
},
915-
"log": {
916-
"name": "log",
917-
"override-signatures": [
918-
"log(message?: any, ...optionalParams: any[]): void"
919-
]
920-
},
921-
"warn": {
922-
"name": "warn",
923-
"override-signatures": [
924-
"warn(message?: any, ...optionalParams: any[]): void"
925-
]
926-
},
927-
"group": {
928-
"name": "group",
929-
"override-signatures": [
930-
"group(groupTitle?: string, ...optionalParams: any[]): void"
931-
]
932-
},
933-
"groupCollapsed": {
934-
"name": "groupCollapsed",
935-
"override-signatures": [
936-
"groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void"
937-
]
938-
},
939-
"trace": {
940-
"name": "trace",
941-
"override-signatures": [
942-
"trace(message?: any, ...optionalParams: any[]): void"
943-
]
944-
}
945-
}
946-
}
947-
},
948897
"FormData": {
949898
"name": "FormData",
950899
"methods": {

inputfiles/removedTypes.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
},
77
"mixins": {
88
"mixin": {
9-
"XMLHttpRequestEventTarget": null
9+
"XMLHttpRequestEventTarget": null,
10+
"WindowConsole": null
1011
}
1112
},
1213
"callback-interfaces": {
@@ -20,6 +21,7 @@
2021
},
2122
"interfaces": {
2223
"interface": {
24+
"Console": null,
2325
"FileReaderProgressEvent": null,
2426
"HTMLElement": {
2527
"methods": {
@@ -51,6 +53,11 @@
5153
}
5254
}
5355
},
56+
"namespaces": {
57+
"namespace": {
58+
59+
}
60+
},
5461
"dictionaries": {
5562
"dictionary": {
5663
"ObjectURLOptions": null,

0 commit comments

Comments
 (0)