mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Added axios.formToJSON method; (#4735)
* Draft * Added `formDataToJSON` helper; Added `axios.formToJSON` method; Added client tests; Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Vendored
+7
@@ -300,6 +300,12 @@ export interface GenericFormData {
|
||||
append(name: string, value: any, options?: any): any;
|
||||
}
|
||||
|
||||
export interface GenericHTMLFormElement {
|
||||
name: string;
|
||||
method: string;
|
||||
submit(): void;
|
||||
}
|
||||
|
||||
export interface AxiosStatic extends AxiosInstance {
|
||||
create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||
Cancel: CancelStatic;
|
||||
@@ -312,6 +318,7 @@ export interface AxiosStatic extends AxiosInstance {
|
||||
spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
||||
isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
||||
toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
|
||||
formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
|
||||
}
|
||||
|
||||
declare const axios: AxiosStatic;
|
||||
|
||||
Reference in New Issue
Block a user