Skip to content

Commit c735618

Browse files
authored
Remove redundant override-signatures (#887)
1 parent 9732d06 commit c735618

File tree

5 files changed

+17
-161
lines changed

5 files changed

+17
-161
lines changed

baselines/dom.generated.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,7 +3778,7 @@ declare var DOMException: {
37783778

37793779
/** An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */
37803780
interface DOMImplementation {
3781-
createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;
3781+
createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument;
37823782
createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;
37833783
createHTMLDocument(title?: string): Document;
37843784
/** @deprecated */
@@ -5127,8 +5127,8 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp
51275127
* Returns the qualified names of all element's attributes. Can contain duplicates.
51285128
*/
51295129
getAttributeNames(): string[];
5130-
getAttributeNode(name: string): Attr | null;
5131-
getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null;
5130+
getAttributeNode(qualifiedName: string): Attr | null;
5131+
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
51325132
getBoundingClientRect(): DOMRect;
51335133
getClientRects(): DOMRectList;
51345134
/**
@@ -9129,7 +9129,7 @@ interface IDBDatabase extends EventTarget {
91299129
*
91309130
* Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
91319131
*/
9132-
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
9132+
createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore;
91339133
/**
91349134
* Deletes the object store with the given name.
91359135
*
@@ -9577,8 +9577,8 @@ interface ImageData {
95779577

95789578
declare var ImageData: {
95799579
prototype: ImageData;
9580-
new(width: number, height: number): ImageData;
9581-
new(array: Uint8ClampedArray, width: number, height?: number): ImageData;
9580+
new(sw: number, sh: number): ImageData;
9581+
new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData;
95829582
};
95839583

95849584
interface InnerHTML {

baselines/dom.iterable.generated.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ interface Headers {
109109
values(): IterableIterator<string>;
110110
}
111111

112+
interface IDBDatabase {
113+
/**
114+
* Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.
115+
*/
116+
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
117+
}
118+
112119
interface IDBObjectStore {
113120
/**
114121
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.

baselines/webworker.generated.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ interface IDBDatabase extends EventTarget {
17611761
*
17621762
* Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
17631763
*/
1764-
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
1764+
createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore;
17651765
/**
17661766
* Deletes the object store with the given name.
17671767
*
@@ -2199,8 +2199,8 @@ interface ImageData {
21992199

22002200
declare var ImageData: {
22012201
prototype: ImageData;
2202-
new(width: number, height: number): ImageData;
2203-
new(array: Uint8ClampedArray, width: number, height?: number): ImageData;
2202+
new(sw: number, sh: number): ImageData;
2203+
new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData;
22042204
};
22052205

22062206
/** This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties. */

inputfiles/overridingTypes.json

Lines changed: 0 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
{
22
"mixins": {
33
"mixin": {
4-
"GlobalFetch": {
5-
"name": "GlobalFetch",
6-
"methods": {
7-
"method": {
8-
"fetch": {
9-
"name": "fetch",
10-
"override-signatures": [
11-
"fetch(input: RequestInfo, init?: RequestInit): Promise<Response>"
12-
]
13-
}
14-
}
15-
}
16-
},
174
"Animatable": {
185
"name": "Animatable",
196
"methods": {
@@ -227,12 +214,6 @@
227214
"(event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error): any"
228215
]
229216
},
230-
"DecodeErrorCallback": {
231-
"name": "DecodeErrorCallback",
232-
"override-signatures": [
233-
"(error: DOMException): void"
234-
]
235-
},
236217
"QueuingStrategySizeCallback": {
237218
"type-parameters": [
238219
{
@@ -531,12 +512,6 @@
531512
"getElementById(elementId: string): HTMLElement | null"
532513
]
533514
},
534-
"elementsFromPoint": {
535-
"name": "elementsFromPoint",
536-
"override-signatures": [
537-
"elementsFromPoint(x: number, y: number): Element[]"
538-
]
539-
},
540515
"getElementsByTagNameNS": {
541516
"name": "getElementsByTagNameNS",
542517
"override-signatures": [
@@ -693,13 +668,6 @@
693668
},
694669
"properties": {
695670
"property": {
696-
"isConnected": {
697-
"name": "isConnected",
698-
"default": "false",
699-
"read-only": 1,
700-
"type-original": "boolean",
701-
"type": "boolean"
702-
},
703671
"parentNode": {
704672
"override-type": "Node & ParentNode | null"
705673
},
@@ -811,23 +779,6 @@
811779
}
812780
}
813781
},
814-
"MediaError": {
815-
"name": "MediaError",
816-
"properties": {
817-
"property": {
818-
"message": {
819-
"specs": "html5",
820-
"name": "message",
821-
"tags": "Media",
822-
"type": "DOMString",
823-
"type-original": "DOMString",
824-
"read-only": 1,
825-
"exposed": "Window",
826-
"default": "\"\""
827-
}
828-
}
829-
}
830-
},
831782
"IDBIndex": {
832783
"name": "IDBIndex",
833784
"properties": {
@@ -885,33 +836,6 @@
885836
}
886837
}
887838
},
888-
"IDBDatabase": {
889-
"name": "IDBDatabase",
890-
"methods": {
891-
"method": {
892-
"createObjectStore": {
893-
"name": "createObjectStore",
894-
"override-signatures": [
895-
"createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore"
896-
]
897-
},
898-
"transaction": {
899-
"name": "transaction",
900-
"override-signatures": [
901-
"transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction"
902-
]
903-
}
904-
}
905-
},
906-
"properties": {
907-
"property": {
908-
"version": {
909-
"name": "version",
910-
"override-type": "number"
911-
}
912-
}
913-
}
914-
},
915839
"HTMLCanvasElement": {
916840
"methods": {
917841
"method": {
@@ -1019,24 +943,6 @@
1019943
}
1020944
}
1021945
},
1022-
"ImageData": {
1023-
"name": "ImageData",
1024-
"exposed": "Window Worker",
1025-
"constructor": {
1026-
"override-signatures": [
1027-
"new(width: number, height: number): ImageData",
1028-
"new(array: Uint8ClampedArray, width: number, height?: number): ImageData"
1029-
]
1030-
}
1031-
},
1032-
"DOMException": {
1033-
"name": "DOMException",
1034-
"constructor": {
1035-
"override-signatures": [
1036-
"new(message?: string, name?: string): DOMException"
1037-
]
1038-
}
1039-
},
1040946
"HTMLSelectElement": {
1041947
"name": "HTMLSelectElement",
1042948
"properties": {
@@ -1125,16 +1031,6 @@
11251031
},
11261032
"HTMLTableSectionElement": {
11271033
"name": "HTMLTableSectionElement",
1128-
"methods": {
1129-
"method": {
1130-
"insertRow": {
1131-
"name": "insertRow",
1132-
"override-signatures": [
1133-
"insertRow(index?: number): HTMLTableRowElement"
1134-
]
1135-
}
1136-
}
1137-
},
11381034
"properties": {
11391035
"property": {
11401036
"rows": {
@@ -1148,18 +1044,6 @@
11481044
"name": "Element",
11491045
"methods": {
11501046
"method": {
1151-
"getAttributeNodeNS": {
1152-
"name": "getAttributeNodeNS",
1153-
"override-signatures": [
1154-
"getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null"
1155-
]
1156-
},
1157-
"getAttributeNode": {
1158-
"name": "getAttributeNode",
1159-
"override-signatures": [
1160-
"getAttributeNode(name: string): Attr | null"
1161-
]
1162-
},
11631047
"getElementsByTagNameNS": {
11641048
"name": "getElementsByTagNameNS",
11651049
"override-signatures": [
@@ -1287,23 +1171,6 @@
12871171
}
12881172
},
12891173
"Storage": {
1290-
"name": "Storage",
1291-
"methods": {
1292-
"method": {
1293-
"getItem": {
1294-
"name": "getItem",
1295-
"override-signatures": [
1296-
"getItem(key: string): string | null"
1297-
]
1298-
},
1299-
"key": {
1300-
"name": "key",
1301-
"override-signatures": [
1302-
"key(index: number): string | null"
1303-
]
1304-
}
1305-
}
1306-
},
13071174
"override-index-signatures": [
13081175
"[name: string]: any"
13091176
]
@@ -1401,16 +1268,6 @@
14011268
"name": "HTMLInputElement",
14021269
"properties": {
14031270
"property": {
1404-
"files": {
1405-
"name": "files",
1406-
"read-only": 0,
1407-
"override-type": "FileList | null"
1408-
},
1409-
"form": {
1410-
"name": "form",
1411-
"read-only": 1,
1412-
"override-type": "HTMLFormElement | null"
1413-
},
14141271
"selectionDirection": {
14151272
"name": "selectionDirection",
14161273
"override-type": "\"forward\" | \"backward\" | \"none\""
@@ -1461,12 +1318,6 @@
14611318
"hasFeature(...args: any[]): true"
14621319
],
14631320
"deprecated": 1
1464-
},
1465-
"createDocument": {
1466-
"name": "createDocument",
1467-
"override-signatures": [
1468-
"createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document"
1469-
]
14701321
}
14711322
}
14721323
}

src/emitter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor, iterator: boo
701701
method["override-signatures"]!.forEach(s => printLine(`${prefix}${s};`));
702702
}
703703
else if (method.signature) {
704-
if (method["additional-signatures"]) {
705-
method["additional-signatures"]!.forEach(s => printLine(`${prefix}${s};`));
706-
}
704+
method["additional-signatures"]?.forEach(s => printLine(`${prefix}${s};`));
707705
method.signature.forEach(sig => emitSignature(sig, prefix, name, printLine));
708706
}
709707
}

0 commit comments

Comments
 (0)