web-ui-pack
Version:
Web package with UI elements
22 lines (21 loc) • 1.2 kB
TypeScript
interface FormDataOptions {
/** Props with `null` OR `undefined` will be written as empty-string; otherwise it's skipped
* @defaultValue false */
includeNulls?: boolean;
/** Point TRUE for bracket-notation, otherwise dot-notation by default
* * For NodeJS use bracket-notation `options[slots][0][isEnabled]: "true"`
* * For .NET use dot-notation `"options.slots[0].isEnabled": "true"
* @defaultValue false */
bracketNotation?: boolean;
/** Point true for array-notation for plain types (inside arrays): primitives | Date | File
* * If TRUE - optionIds[0]: "1", optionIds[1]: "2" but items[0].Id = "15" or items[0]Id = "1"
* * If FALSE - optionIds: "1", optionIds: "2" but items[0].Id = "15" or items[0]Id = "1"
* * For NodeJS it depends on handling library
* * For .NET use FALSE
* @defaultValue false */
arrayNotationForPlainTypes?: boolean;
}
/** Converts pointed object with nested properties to plain FormData
* @returns Pointed formData or new FormData */
export default function objectToFormData(fromObj: Record<string, any> | Array<any>, toForm?: FormData | null, opts?: FormDataOptions | null): FormData;
export {};