UNPKG

pagamio-frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

28 lines (27 loc) 1.24 kB
import type { SpringBootResponse } from 'src/api'; import type { QueryConfigProps } from '../types'; export declare const createQueryConfig: (startDate: string | undefined, endDate: string | undefined, options: Partial<QueryConfigProps>, filters?: { [key: string]: string | string[] | null; }) => QueryConfigProps; /** * Helper function to get nested object value by path */ export declare const getNestedValue: (obj: any, path: string) => any; /** * Converts a simple array to a SpringBoot response format * * @param {T[]} response - The array to convert into SpringBoot response format * @returns {SpringBootResponse<T>} A SpringBoot paginated response object with the array as content * @template T - The type of items in the array */ export declare function arrayToSpringBootResponse<T>(response: T[]): SpringBootResponse<T>; /** * Generates a cryptographically secure random string * @param length - The length of the random string to generate (default: 6) * @returns A secure random string */ export declare const generateSecureRandomString: (length?: number) => string; /** * Uploads a file to a presigned URL using XMLHttpRequest */ export declare function uploadFileWithXHR(url: string, file: File): Promise<void>;