-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Native FormData implementation has overload for accepting Blob with filename for append and set:
append(name: string, value: unknown, fileName?: string): void
set(name: string, value: unknown, fileName?: string): voidThese types are from undici.
I did saw typed-formdata implementation has the fieldname argument covered by both methods, it's just types are not reflecting the implementation.
We can add these overloads:
append(key: string, value: Blob, fileName?: string): void;
set(key: string, value: Blob, fileName?: string): void;For now I intersect the missing overloads using module augmentation:
declare module "@k1eu/typed-formdata" {
interface TypedFormData<T extends Record<string, string | File>> {
append(key: string, value: Blob, fileName?: string): void;
set(key: string, value: Blob, fileName?: string): void;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels