UNPKG

@beenotung/tslib

Version:
21 lines (20 loc) 735 B
export type FormPrimitive = string | number | boolean | File; export interface FormObject { [key: string]: FormValue; } export interface FormArray { readonly length: number; [key: number]: FormValue; } export type FormValue = FormPrimitive | FormObject | FormArray; /** * @description also support files in { [field: string]: File[] | File } * One use-case is for FileFieldsInterceptor in nest-client */ export declare function jsonToFormData(json: FormObject, formData?: FormData): FormData; export interface PostFormResponse<T> { status: number; statusText: string; data: Buffer | string | T; } export declare function postMultipartFormData<T>(url: string, json: FormObject): Promise<PostFormResponse<T>>;