Skip to content

Commit a469045

Browse files
committed
2 parents 8ea647a + 077bd91 commit a469045

File tree

5 files changed

+168
-11
lines changed

5 files changed

+168
-11
lines changed

baselines/dom.generated.d.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,7 @@ interface DataTransfer {
25382538
clearData(format?: string): boolean;
25392539
getData(format: string): string;
25402540
setData(format: string, data: string): boolean;
2541+
setDragImage(image: Element, x: number, y: number): void;
25412542
}
25422543

25432544
declare var DataTransfer: {
@@ -3207,7 +3208,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
32073208
* Gets or sets the version attribute specified in the declaration of an XML document.
32083209
*/
32093210
xmlVersion: string | null;
3210-
adoptNode(source: Node): Node;
3211+
adoptNode<T extends Node>(source: T): T;
32113212
captureEvents(): void;
32123213
caretRangeFromPoint(x: number, y: number): Range;
32133214
clear(): void;
@@ -3384,7 +3385,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
33843385
* Gets a value indicating whether the object currently has focus.
33853386
*/
33863387
hasFocus(): boolean;
3387-
importNode(importedNode: Node, deep: boolean): Node;
3388+
importNode<T extends Node>(importedNode: T, deep: boolean): T;
33883389
msElementsFromPoint(x: number, y: number): NodeListOf<Element>;
33893390
msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf<Element>;
33903391
/**
@@ -3795,7 +3796,12 @@ declare var FocusNavigationEvent: {
37953796
}
37963797

37973798
interface FormData {
3798-
append(name: any, value: any, blobName?: string): void;
3799+
append(name: string, value: string | Blob, fileName?: string): void;
3800+
delete(name: string): void;
3801+
get(name: string): FormDataEntryValue | null;
3802+
getAll(name: string): FormDataEntryValue[];
3803+
has(name: string): boolean;
3804+
set(name: string, value: string | Blob, fileName?: string): void;
37993805
}
38003806

38013807
declare var FormData: {
@@ -8253,15 +8259,15 @@ interface Node extends EventTarget {
82538259
contains(child: Node): boolean;
82548260
hasAttributes(): boolean;
82558261
hasChildNodes(): boolean;
8256-
insertBefore(newChild: Node, refChild: Node | null): Node;
8262+
insertBefore<T extends Node>(newChild: T, refChild: Node | null): T;
82578263
isDefaultNamespace(namespaceURI: string | null): boolean;
82588264
isEqualNode(arg: Node): boolean;
82598265
isSameNode(other: Node): boolean;
82608266
lookupNamespaceURI(prefix: string | null): string | null;
82618267
lookupPrefix(namespaceURI: string | null): string | null;
82628268
normalize(): void;
8263-
removeChild(oldChild: Node): Node;
8264-
replaceChild(newChild: Node, oldChild: Node): Node;
8269+
removeChild<T extends Node>(oldChild: T): T;
8270+
replaceChild<T extends Node>(newChild: Node, oldChild: T): T;
82658271
readonly ATTRIBUTE_NODE: number;
82668272
readonly CDATA_SECTION_NODE: number;
82678273
readonly COMMENT_NODE: number;
@@ -13231,6 +13237,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1323113237
readonly top: Window;
1323213238
readonly window: Window;
1323313239
URL: typeof URL;
13240+
URLSearchParams: typeof URLSearchParams;
1323413241
Blob: typeof Blob;
1323513242
customElements: CustomElementRegistry;
1323613243
alert(message?: any): void;
@@ -14940,6 +14947,7 @@ type IDBValidKey = number | string | Date | IDBArrayKey;
1494014947
type BufferSource = ArrayBuffer | ArrayBufferView;
1494114948
type MouseWheelEvent = WheelEvent;
1494214949
type ScrollRestoration = "auto" | "manual";
14950+
type FormDataEntryValue = string | File;
1494314951
type AppendMode = "segments" | "sequence";
1494414952
type AudioContextState = "suspended" | "running" | "closed";
1494514953
type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass";

baselines/webworker.generated.d.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ interface NotificationOptions {
6161
icon?: string;
6262
}
6363

64+
interface ObjectURLOptions {
65+
oneTimeOnly?: boolean;
66+
}
67+
6468
interface PushSubscriptionOptionsInit {
6569
userVisibleOnly?: boolean;
6670
applicationServerKey?: any;
@@ -1008,6 +1012,29 @@ declare var SyncManager: {
10081012
new(): SyncManager;
10091013
}
10101014

1015+
interface URL {
1016+
hash: string;
1017+
host: string;
1018+
hostname: string;
1019+
href: string;
1020+
readonly origin: string;
1021+
password: string;
1022+
pathname: string;
1023+
port: string;
1024+
protocol: string;
1025+
search: string;
1026+
username: string;
1027+
readonly searchParams: URLSearchParams;
1028+
toString(): string;
1029+
}
1030+
1031+
declare var URL: {
1032+
prototype: URL;
1033+
new(url: string, base?: string): URL;
1034+
createObjectURL(object: any, options?: ObjectURLOptions): string;
1035+
revokeObjectURL(url: string): void;
1036+
}
1037+
10111038
interface WebSocketEventMap {
10121039
"close": CloseEvent;
10131040
"error": Event;
@@ -1484,6 +1511,41 @@ interface ImageBitmap {
14841511
close(): void;
14851512
}
14861513

1514+
interface URLSearchParams {
1515+
/**
1516+
* Appends a specified key/value pair as a new search parameter.
1517+
*/
1518+
append(name: string, value: string): void;
1519+
/**
1520+
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
1521+
*/
1522+
delete(name: string): void;
1523+
/**
1524+
* Returns the first value associated to the given search parameter.
1525+
*/
1526+
get(name: string): string | null;
1527+
/**
1528+
* Returns all the values association with a given search parameter.
1529+
*/
1530+
getAll(name: string): string[];
1531+
/**
1532+
* Returns a Boolean indicating if such a search parameter exists.
1533+
*/
1534+
has(name: string): boolean;
1535+
/**
1536+
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
1537+
*/
1538+
set(name: string, value: string): void;
1539+
}
1540+
1541+
declare var URLSearchParams: {
1542+
prototype: URLSearchParams;
1543+
/**
1544+
* Constructor returning a URLSearchParams object.
1545+
*/
1546+
new (init?: string | URLSearchParams): URLSearchParams;
1547+
}
1548+
14871549
interface BlobPropertyBag {
14881550
type?: string;
14891551
endings?: string;
@@ -1746,6 +1808,7 @@ type RequestInfo = Request | string;
17461808
type USVString = string;
17471809
type IDBValidKey = number | string | Date | IDBArrayKey;
17481810
type BufferSource = ArrayBuffer | ArrayBufferView;
1811+
type FormDataEntryValue = string | File;
17491812
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
17501813
type IDBRequestReadyState = "pending" | "done";
17511814
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";

inputfiles/addedTypes.json

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
{
182182
"kind": "interface",
183183
"name": "URLSearchParams",
184-
"flavor": "Web",
185184
"constructorSignatures": [
186185
"new (init?: string | URLSearchParams): URLSearchParams"
187186
],
@@ -226,6 +225,13 @@
226225
"name": "URL",
227226
"type": "typeof URL"
228227
},
228+
{
229+
"kind": "property",
230+
"interface": "Window",
231+
"exposeGlobally": false,
232+
"name": "URLSearchParams",
233+
"type": "typeof URLSearchParams"
234+
},
229235
{
230236
"kind": "property",
231237
"interface": "Window",
@@ -1203,6 +1209,12 @@
12031209
"flavor": "Web",
12041210
"type": "WheelEvent"
12051211
},
1212+
{
1213+
"kind": "method",
1214+
"interface": "DataTransfer",
1215+
"name": "setDragImage",
1216+
"signatures": ["setDragImage(image: Element, x: number, y: number): void"]
1217+
},
12061218
{
12071219
"kind": "method",
12081220
"interface": "Element",
@@ -1528,5 +1540,45 @@
15281540
"name": "getElementById",
15291541
"flavor": "DOM",
15301542
"signatures": ["getElementById(elementId: string): HTMLElement | null"]
1543+
},
1544+
{
1545+
"kind": "typedef",
1546+
"name": "FormDataEntryValue",
1547+
"type": "string | File"
1548+
},
1549+
{
1550+
"kind": "method",
1551+
"interface": "FormData",
1552+
"name": "delete",
1553+
"flavor": "Web",
1554+
"signatures": ["delete(name: string): void"]
1555+
},
1556+
{
1557+
"kind": "method",
1558+
"interface": "FormData",
1559+
"name": "get",
1560+
"flavor": "Web",
1561+
"signatures": ["get(name: string): FormDataEntryValue | null"]
1562+
},
1563+
{
1564+
"kind": "method",
1565+
"interface": "FormData",
1566+
"name": "getAll",
1567+
"flavor": "Web",
1568+
"signatures": ["getAll(name: string): FormDataEntryValue[]"]
1569+
},
1570+
{
1571+
"kind": "method",
1572+
"interface": "FormData",
1573+
"name": "has",
1574+
"flavor": "Web",
1575+
"signatures": ["has(name: string): boolean"]
1576+
},
1577+
{
1578+
"kind": "method",
1579+
"interface": "FormData",
1580+
"name": "set",
1581+
"flavor": "Web",
1582+
"signatures": ["set(name: string, value: string | Blob, fileName?: string): void"]
15311583
}
15321584
]

inputfiles/knownWorkerInterfaces.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"NotificationEventInit",
6767
"NotificationOptions",
6868
"NotificationPermissionCallback",
69+
"ObjectURLOptions",
6970
"Performance",
7071
"PerformanceNavigation",
7172
"PerformanceTiming",
@@ -91,11 +92,13 @@
9192
"SyncEventInit",
9293
"SyncManager",
9394
"USVString",
95+
"URL",
96+
"URLSearchParams",
9497
"WebSocket",
9598
"WindowBase64",
9699
"WindowConsole",
97100
"Worker",
98101
"XMLHttpRequest",
99102
"XMLHttpRequestEventTarget",
100103
"XMLHttpRequestUpload"
101-
]
104+
]

inputfiles/overridingTypes.json

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,40 @@
1212
},
1313
{
1414
"kind": "method",
15-
"interface": "Node",
16-
"name": "insertBefore",
17-
"signatures": ["insertBefore(newChild: Node, refChild: Node | null): Node"]
15+
"interface": "Document",
16+
"name": "adoptNode",
17+
"signatures": ["adoptNode<T extends Node>(source: T): T"]
18+
},
19+
{
20+
"kind": "method",
21+
"interface": "Document",
22+
"name": "importNode",
23+
"signatures": ["importNode<T extends Node>(importedNode: T, deep: boolean): T"]
1824
},
1925
{
2026
"kind": "method",
2127
"interface": "Node",
2228
"name": "appendChild",
2329
"signatures": ["appendChild<T extends Node>(newChild: T): T"]
2430
},
31+
{
32+
"kind": "method",
33+
"interface": "Node",
34+
"name": "insertBefore",
35+
"signatures": ["insertBefore<T extends Node>(newChild: T, refChild: Node | null): T"]
36+
},
37+
{
38+
"kind": "method",
39+
"interface": "Node",
40+
"name": "removeChild",
41+
"signatures": ["removeChild<T extends Node>(oldChild: T): T"]
42+
},
43+
{
44+
"kind": "method",
45+
"interface": "Node",
46+
"name": "replaceChild",
47+
"signatures": ["replaceChild<T extends Node>(newChild: Node, oldChild: T): T"]
48+
},
2549
{
2650
"kind": "method",
2751
"interface": "HTMLCollection",
@@ -1016,5 +1040,12 @@
10161040
"interface": "DOMImplementation",
10171041
"name": "createDocument",
10181042
"signatures": ["createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document"]
1043+
},
1044+
{
1045+
"kind": "method",
1046+
"interface": "FormData",
1047+
"name": "append",
1048+
"flavor": "Web",
1049+
"signatures": ["append(name: string, value: string | Blob, fileName?: string): void"]
10191050
}
10201051
]

0 commit comments

Comments
 (0)