Skip to content

Commit 9ad6b09

Browse files
committed
add Console types
1 parent 85ea749 commit 9ad6b09

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
@@ -3669,40 +3669,6 @@ interface ConcatParams extends Algorithm {
36693669
publicInfo?: Uint8Array;
36703670
}
36713671

3672-
/** 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. */
3673-
interface Console {
3674-
memory: any;
3675-
assert(condition?: boolean, message?: string, ...data: any[]): void;
3676-
clear(): void;
3677-
count(label?: string): void;
3678-
debug(message?: any, ...optionalParams: any[]): void;
3679-
dir(value?: any, ...optionalParams: any[]): void;
3680-
dirxml(value: any): void;
3681-
error(message?: any, ...optionalParams: any[]): void;
3682-
exception(message?: string, ...optionalParams: any[]): void;
3683-
group(groupTitle?: string, ...optionalParams: any[]): void;
3684-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
3685-
groupEnd(): void;
3686-
info(message?: any, ...optionalParams: any[]): void;
3687-
log(message?: any, ...optionalParams: any[]): void;
3688-
markTimeline(label?: string): void;
3689-
profile(reportName?: string): void;
3690-
profileEnd(reportName?: string): void;
3691-
table(...tabularData: any[]): void;
3692-
time(label?: string): void;
3693-
timeEnd(label?: string): void;
3694-
timeStamp(label?: string): void;
3695-
timeline(label?: string): void;
3696-
timelineEnd(label?: string): void;
3697-
trace(message?: any, ...optionalParams: any[]): void;
3698-
warn(message?: any, ...optionalParams: any[]): void;
3699-
}
3700-
3701-
declare var Console: {
3702-
prototype: Console;
3703-
new(): Console;
3704-
};
3705-
37063672
interface ConstantSourceNode extends AudioScheduledSourceNode {
37073673
readonly offset: AudioParam;
37083674
addEventListener<K extends keyof AudioScheduledSourceNodeEventMap>(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -18512,7 +18478,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler
1851218478
}
1851318479

1851418480
/** A window containing a DOM document; the document property points to the DOM document loaded in that window. */
18515-
interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, IDBEnvironment, WindowBase64, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage, WindowTimers {
18481+
interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, IDBEnvironment, WindowBase64, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage, WindowTimers {
1851618482
readonly applicationCache: ApplicationCache;
1851718483
readonly caches: CacheStorage;
1851818484
readonly clientInformation: Navigator;
@@ -18651,10 +18617,6 @@ interface WindowBase64 {
1865118617
btoa(rawString: string): string;
1865218618
}
1865318619

18654-
interface WindowConsole {
18655-
readonly console: Console;
18656-
}
18657-
1865818620
interface WindowEventHandlersEventMap {
1865918621
"afterprint": Event;
1866018622
"beforeprint": Event;
@@ -19058,6 +19020,31 @@ declare var webkitRTCPeerConnection: {
1905819020

1905919021
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
1906019022

19023+
declare namespace console {
19024+
var memory: any;
19025+
function assert(condition?: boolean, ...data: any[]): void;
19026+
function clear(): void;
19027+
function count(label?: string): void;
19028+
function countReset(label?: string): void;
19029+
function debug(...data: any[]): void;
19030+
function dir(item: any, options?: any): void;
19031+
function dirxml(...data: any[]): void;
19032+
function error(...data: any[]): void;
19033+
function exception(message?: string, ...optionalParams: any[]): void;
19034+
function group(...data: any[]): void;
19035+
function groupCollapsed(...data: any[]): void;
19036+
function groupEnd(): void;
19037+
function info(...data: any[]): void;
19038+
function log(...data: any[]): void;
19039+
function table(tabularData: any, properties?: string[]): void;
19040+
function time(label?: string): void;
19041+
function timeEnd(label?: string): void;
19042+
function timeLog(label?: string, ...data: any[]): void;
19043+
function timeStamp(label?: string): void;
19044+
function trace(...data: any[]): void;
19045+
function warn(...data: any[]): void;
19046+
}
19047+
1906119048
declare namespace WebAssembly {
1906219049
interface CompileError {
1906319050
}
@@ -19638,7 +19625,6 @@ declare function toString(): string;
1963819625
declare function dispatchEvent(event: Event): boolean;
1963919626
declare var sessionStorage: Storage;
1964019627
declare var localStorage: Storage;
19641-
declare var console: Console;
1964219628
/**
1964319629
* Fires when the user aborts the download.
1964419630
* @param ev The event.

baselines/webworker.generated.d.ts

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -904,40 +904,6 @@ interface ConcatParams extends Algorithm {
904904
publicInfo?: Uint8Array;
905905
}
906906

907-
/** 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. */
908-
interface Console {
909-
memory: any;
910-
assert(condition?: boolean, message?: string, ...data: any[]): void;
911-
clear(): void;
912-
count(label?: string): void;
913-
debug(message?: any, ...optionalParams: any[]): void;
914-
dir(value?: any, ...optionalParams: any[]): void;
915-
dirxml(value: any): void;
916-
error(message?: any, ...optionalParams: any[]): void;
917-
exception(message?: string, ...optionalParams: any[]): void;
918-
group(groupTitle?: string, ...optionalParams: any[]): void;
919-
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
920-
groupEnd(): void;
921-
info(message?: any, ...optionalParams: any[]): void;
922-
log(message?: any, ...optionalParams: any[]): void;
923-
markTimeline(label?: string): void;
924-
profile(reportName?: string): void;
925-
profileEnd(reportName?: string): void;
926-
table(...tabularData: any[]): void;
927-
time(label?: string): void;
928-
timeEnd(label?: string): void;
929-
timeStamp(label?: string): void;
930-
timeline(label?: string): void;
931-
timelineEnd(label?: string): void;
932-
trace(message?: any, ...optionalParams: any[]): void;
933-
warn(message?: any, ...optionalParams: any[]): void;
934-
}
935-
936-
declare var Console: {
937-
prototype: Console;
938-
new(): Console;
939-
};
940-
941907
/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */
942908
interface CountQueuingStrategy extends QueuingStrategy {
943909
highWaterMark: number;
@@ -5307,10 +5273,6 @@ declare var WindowClient: {
53075273
new(): WindowClient;
53085274
};
53095275

5310-
interface WindowConsole {
5311-
readonly console: Console;
5312-
}
5313-
53145276
interface WindowOrWorkerGlobalScope {
53155277
readonly caches: CacheStorage;
53165278
readonly crypto: Crypto;
@@ -5355,7 +5317,7 @@ interface WorkerGlobalScopeEventMap {
53555317
}
53565318

53575319
/** 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. */
5358-
interface WorkerGlobalScope extends EventTarget, WindowConsole, WindowOrWorkerGlobalScope, WorkerUtils {
5320+
interface WorkerGlobalScope extends EventTarget, WindowOrWorkerGlobalScope, WorkerUtils {
53595321
readonly caches: CacheStorage;
53605322
readonly isSecureContext: boolean;
53615323
readonly location: WorkerLocation;
@@ -5592,6 +5554,31 @@ declare var XMLHttpRequestUpload: {
55925554

55935555
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
55945556

5557+
declare namespace console {
5558+
var memory: any;
5559+
function assert(condition?: boolean, ...data: any[]): void;
5560+
function clear(): void;
5561+
function count(label?: string): void;
5562+
function countReset(label?: string): void;
5563+
function debug(...data: any[]): void;
5564+
function dir(item: any, options?: any): void;
5565+
function dirxml(...data: any[]): void;
5566+
function error(...data: any[]): void;
5567+
function exception(message?: string, ...optionalParams: any[]): void;
5568+
function group(...data: any[]): void;
5569+
function groupCollapsed(...data: any[]): void;
5570+
function groupEnd(): void;
5571+
function info(...data: any[]): void;
5572+
function log(...data: any[]): void;
5573+
function table(tabularData: any, properties?: string[]): void;
5574+
function time(label?: string): void;
5575+
function timeEnd(label?: string): void;
5576+
function timeLog(label?: string, ...data: any[]): void;
5577+
function timeStamp(label?: string): void;
5578+
function trace(...data: any[]): void;
5579+
function warn(...data: any[]): void;
5580+
}
5581+
55955582
declare namespace WebAssembly {
55965583
interface Global {
55975584
value: any;
@@ -5770,7 +5757,6 @@ declare var navigator: WorkerNavigator;
57705757
declare function importScripts(...urls: string[]): void;
57715758
declare function atob(encodedString: string): string;
57725759
declare function btoa(rawString: string): string;
5773-
declare var console: Console;
57745760
declare var caches: CacheStorage;
57755761
declare var crypto: Crypto;
57765762
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
@@ -966,79 +966,6 @@
966966
}
967967
}
968968
},
969-
"Console": {
970-
"name": "Console",
971-
"methods": {
972-
"method": {
973-
"debug": {
974-
"name": "debug",
975-
"override-signatures": [
976-
"debug(message?: any, ...optionalParams: any[]): void"
977-
]
978-
},
979-
"dir": {
980-
"name": "dir",
981-
"override-signatures": [
982-
"dir(value?: any, ...optionalParams: any[]): void"
983-
]
984-
},
985-
"dirxml": {
986-
"name": "dirxml",
987-
"override-signatures": [
988-
"dirxml(value: any): void"
989-
]
990-
},
991-
"error": {
992-
"name": "error",
993-
"override-signatures": [
994-
"error(message?: any, ...optionalParams: any[]): void"
995-
]
996-
},
997-
"info": {
998-
"name": "info",
999-
"override-signatures": [
1000-
"info(message?: any, ...optionalParams: any[]): void"
1001-
]
1002-
},
1003-
"log": {
1004-
"name": "log",
1005-
"override-signatures": [
1006-
"log(message?: any, ...optionalParams: any[]): void"
1007-
]
1008-
},
1009-
"warn": {
1010-
"name": "warn",
1011-
"override-signatures": [
1012-
"warn(message?: any, ...optionalParams: any[]): void"
1013-
]
1014-
},
1015-
"group": {
1016-
"name": "group",
1017-
"override-signatures": [
1018-
"group(groupTitle?: string, ...optionalParams: any[]): void"
1019-
]
1020-
},
1021-
"groupCollapsed": {
1022-
"name": "groupCollapsed",
1023-
"override-signatures": [
1024-
"groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void"
1025-
]
1026-
},
1027-
"trace": {
1028-
"name": "trace",
1029-
"override-signatures": [
1030-
"trace(message?: any, ...optionalParams: any[]): void"
1031-
]
1032-
},
1033-
"profileEnd": {
1034-
"name": "profileEnd",
1035-
"override-signatures": [
1036-
"profileEnd(reportName?: string): void"
1037-
]
1038-
}
1039-
}
1040-
}
1041-
},
1042969
"FormData": {
1043970
"name": "FormData",
1044971
"methods": {
@@ -3151,6 +3078,33 @@
31513078
]
31523079
},
31533080
"namespaces": [
3081+
{
3082+
"name": "console",
3083+
"methods": {
3084+
"method": {
3085+
"exception": {
3086+
"name": "exception",
3087+
"override-signatures": [
3088+
"exception(message?: string, ...optionalParams: any[]): void"
3089+
]
3090+
},
3091+
"timeStamp": {
3092+
"name": "timeStamp",
3093+
"override-signatures": [
3094+
"timeStamp(label?: string): void"
3095+
]
3096+
}
3097+
}
3098+
},
3099+
"properties": {
3100+
"property": {
3101+
"memory": {
3102+
"name": "memory",
3103+
"type": "any"
3104+
}
3105+
}
3106+
}
3107+
},
31543108
{
31553109
"name": "WebAssembly",
31563110
"methods": {

inputfiles/removedTypes.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,7 @@
5757
}
5858
}
5959
},
60-
"Console": {
61-
"methods": {
62-
"method": {
63-
"msIsIndependentlyComposed": null,
64-
"select": null
65-
}
66-
}
67-
},
60+
"Console": null,
6861
"CSSStyleDeclaration": {
6962
"properties": {
7063
"property": {
@@ -280,12 +273,14 @@
280273
}
281274
},
282275
"implements": [
283-
"GlobalFetch"
276+
"GlobalFetch",
277+
"WindowConsole"
284278
]
285279
},
286280
"WorkerGlobalScope": {
287281
"implements": [
288-
"GlobalFetch"
282+
"GlobalFetch",
283+
"WindowConsole"
289284
]
290285
},
291286
"XPathNSResolver": null

0 commit comments

Comments
 (0)