Skip to content

Commit 56a53e1

Browse files
authored
Merge pull request #219 from NColey/form-data-methods
Add missing methods for FormData type
2 parents c882947 + 0f76e1f commit 56a53e1

File tree

4 files changed

+57
-3
lines changed

4 files changed

+57
-3
lines changed

baselines/dom.generated.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3796,7 +3796,12 @@ declare var FocusNavigationEvent: {
37963796
}
37973797

37983798
interface FormData {
3799-
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;
38003805
}
38013806

38023807
declare var FormData: {
@@ -14940,4 +14945,5 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
1494014945
type IDBValidKey = number | string | Date | IDBArrayKey;
1494114946
type BufferSource = ArrayBuffer | ArrayBufferView;
1494214947
type MouseWheelEvent = WheelEvent;
14943-
type ScrollRestoration = "auto" | "manual";
14948+
type ScrollRestoration = "auto" | "manual";
14949+
type FormDataEntryValue = string | File;

baselines/webworker.generated.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,4 +1745,5 @@ type IDBKeyPath = string;
17451745
type RequestInfo = Request | string;
17461746
type USVString = string;
17471747
type IDBValidKey = number | string | Date | IDBArrayKey;
1748-
type BufferSource = ArrayBuffer | ArrayBufferView;
1748+
type BufferSource = ArrayBuffer | ArrayBufferView;
1749+
type FormDataEntryValue = string | File;

inputfiles/addedTypes.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,5 +1534,45 @@
15341534
"name": "getElementById",
15351535
"flavor": "DOM",
15361536
"signatures": ["getElementById(elementId: string): HTMLElement | null"]
1537+
},
1538+
{
1539+
"kind": "typedef",
1540+
"name": "FormDataEntryValue",
1541+
"type": "string | File"
1542+
},
1543+
{
1544+
"kind": "method",
1545+
"interface": "FormData",
1546+
"name": "delete",
1547+
"flavor": "Web",
1548+
"signatures": ["delete(name: string): void"]
1549+
},
1550+
{
1551+
"kind": "method",
1552+
"interface": "FormData",
1553+
"name": "get",
1554+
"flavor": "Web",
1555+
"signatures": ["get(name: string): FormDataEntryValue | null"]
1556+
},
1557+
{
1558+
"kind": "method",
1559+
"interface": "FormData",
1560+
"name": "getAll",
1561+
"flavor": "Web",
1562+
"signatures": ["getAll(name: string): FormDataEntryValue[]"]
1563+
},
1564+
{
1565+
"kind": "method",
1566+
"interface": "FormData",
1567+
"name": "has",
1568+
"flavor": "Web",
1569+
"signatures": ["has(name: string): boolean"]
1570+
},
1571+
{
1572+
"kind": "method",
1573+
"interface": "FormData",
1574+
"name": "set",
1575+
"flavor": "Web",
1576+
"signatures": ["set(name: string, value: string | Blob, fileName?: string): void"]
15371577
}
15381578
]

inputfiles/overridingTypes.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,5 +1016,12 @@
10161016
"interface": "DOMImplementation",
10171017
"name": "createDocument",
10181018
"signatures": ["createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document"]
1019+
},
1020+
{
1021+
"kind": "method",
1022+
"interface": "FormData",
1023+
"name": "append",
1024+
"flavor": "Web",
1025+
"signatures": ["append(name: string, value: string | Blob, fileName?: string): void"]
10191026
}
10201027
]

0 commit comments

Comments
 (0)