-
Notifications
You must be signed in to change notification settings - Fork 440
Add missing methods for FormData type #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c3f73f5
53ffc3f
2e50da8
86cee06
0f76e1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3796,7 +3796,12 @@ declare var FocusNavigationEvent: { | |
} | ||
|
||
interface FormData { | ||
append(name: any, value: any, blobName?: string): void; | ||
append(name: string, value: string | blob, fileName?: string): void; | ||
delete(name: string): void; | ||
get(name: string): FormDataEntryValue | null; | ||
getAll(name: string): FormDataEntryValue[]; | ||
has(name: string): boolean; | ||
set(name: string, value: string | blob, fileName?: string): void; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the spec: https://xhr.spec.whatwg.org/#formdata the definition should look like: type FormDataEntryValue = File or string;
interface FormData {
append(name: string, value: string): void;
append(name:string, blobValue:Blob, filename?:string):void;
delete(name: string):void;
get(name:string): FormDataEntryValue | null;
getAll(name: string): FormDataEntryValue[];
has(name: string): boolean;
set(name:string, value:string): void;
set(name: string, blobValue:Blob, filename?: string): void;
}; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can add arbitrary Blob, but you can only get File back? interesting |
||
|
||
declare var FormData: { | ||
|
@@ -14940,4 +14945,5 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; | |
type IDBValidKey = number | string | Date | IDBArrayKey; | ||
type BufferSource = ArrayBuffer | ArrayBufferView; | ||
type MouseWheelEvent = WheelEvent; | ||
type ScrollRestoration = "auto" | "manual"; | ||
type ScrollRestoration = "auto" | "manual"; | ||
type FormDataEntryValue = string | File; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean
Blob
, my guess is this is what is causing the test failure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're totally right, thanks so much for catching that. I just fixed it and it seems to be passing now. Thank you!