import { B as BaseRouter } from '../index-BMSbpSmF.js'; import '@palmares/core'; import '../status-RlKnv8eR.js'; import '../response/utils.js'; declare function parseParamsValue(value: any, type: (BaseRouter['__queryParamsAndPath']['params'] extends Map ? TType : any) | (BaseRouter['__urlParamsAndPath']['params'] extends Map ? TType : any)): string | number | boolean | undefined; declare function parseQueryParams(value: any, type: BaseRouter['__queryParamsAndPath']['params'] extends Map ? TType : any): string | number | boolean | (string | number | boolean | undefined)[] | undefined; /** * Since not all runtime environments support FormData, this function should be used to create a form data like object. * See: https://developer.mozilla.org/en-US/docs/Web/API/FormData for more information. * * @returns - A class that can be used to create a new FormData-like instance. This FormData-like instance behave the * same way as the original FormData class. */ declare function formDataLikeFactory(): { new (proxyCallback?: { /** * This function will be called when a value is needed. It should return an array of object for the given key. * * If the key is a File or Blob, fileName should be defined. Otherwise just return on value. A File object is * prefered over a Blob object, because it can hold more information about the file. * * @example * ```ts * const formData = new FormDataLike({ * getValue: (name) => { * if (name === 'file') return [{ value: new File([''], 'file.txt'), fileName: 'file.txt' }]; * else return [{ value: 'value' }]; * }, * }); * formData.get('file'); // File { name: 'file.txt' } * ``` * * @param name - The name of the key to get the value from. */ getValue: (name: string) => { value: string | Blob | File; fileName?: string; }[]; /** * This function will be called for returning all keys of the form data in order to transform it to a json * object. * * @example * ```ts * const formData = new FormDataLike({ * getValue: (name) => { * if (name === 'file') return [{ value: new File([''], 'file.txt'), fileName: 'file.txt' }]; * else return [{ value: 'value' }]; * }, * getKeys: () => ['file', 'key'], * }); * * formData.toJSON(); // { file: File { name: 'file.txt' }, key: 'value' } * ``` * * @returns - An array of all keys of the form data. */ getKeys: () => string[]; }): { $$type: string; proxyCallback: ConstructorParameters[0]; data: Record; append(name: string, value: string | Blob | File, fileName?: string): void; get(name: string): string | Blob | null; getAll(name: string): any[]; has(name: string): boolean; set(name: string, value: string | Blob | File, fileName?: string): void; delete(name: string): void; /** * Converts the form data like object to a json object, this way it can be validated by schemas or anything else. * * Important: Be aware that this function will only return the first value of each key, if you want to get all * values of a key use getAll instead. */ toJSON(): Record; }; }; export { formDataLikeFactory, parseParamsValue, parseQueryParams };