UNPKG

@nethesis/vue-components

Version:

This library contains: - a collection of Vue 3 components based on [Flowbite](https://flowbite.com/) - a set of utility functions

37 lines 1.65 kB
/** * Sort function to order array elements by a specific property (for array of objects) or by a specific index (for arrays of arrays) * */ export declare const sortByProperty: (property: string | number) => (a: any, b: any) => 1 | 0 | -1; /** * Set the focus on an element. To set the focus on a custom component, it needs to expose focus() function (see NeTextInput for an example) * */ export declare const focusElement: (elementRef: any) => void; /** * Returns a i18n key for an error returned by Axios * */ export declare const getAxiosErrorMessage: (error: any) => "error.network_error" | "error.network_timeout" | "error.http_401" | "error.http_403" | "error.http_404" | "error.http_500" | "error.generic_error"; /** * Format a byte size according to the International Electrotechnical Commission (IEC), using 1024 as multiple factor * * @param byteSize the number of bytes to format * @returns a string representing the byte size with the appropriate unit */ export declare const byteFormat1024: (byteSize: number) => string; /** * Format a byte size according to the International System of Units (SI), using 1000 as multiple factor * * @param byteSize the number of bytes to format * @returns a string representing the byte size with the appropriate unit */ export declare const byteFormat1000: (byteSize: number) => string; /** * Format kilobits per second (kbps, typically a network speed) * * @param kbps the number of kilobits to format * @returns a string representing the input value with the appropriate unit */ export declare const kbpsFormat: (kbps: number) => string; //# sourceMappingURL=utils.d.ts.map