@arkasuryawan/m2-interfaces
Version:
Squaremetre Data Interfaces
53 lines (52 loc) • 1.8 kB
TypeScript
/**
* Generates a random UUID
* @param a - The parameter a is a number that is used to generate the UUID. If you don't pass a
* parameter, the function will generate a random number.
*/
/**
* Return a new array with the elements of the original array in a random order.
* @param arr - The array to shuffle.
*/
export declare const shuffleArray: (arr: any[]) => any[];
/**
* It takes an array, converts it to a Set, and then converts it back to an array
* @param arr - The array to be filtered.
*/
export declare const getUniqueArray: (arr: any[]) => any[];
/**
* If the current element is an array, flatten it, otherwise, add it to the accumulator.
*/
/**
* Generate a random hex colour code.
*/
export declare const generateRandomHexColor: () => string;
/**
* It takes three numbers, one for red, one for green, and one for blue, and returns a hexadecimal
* string representing the color
* @param r - red value
* @param g - The green value of the color.
* @param b - blue
*/
export declare const rgbToHex: (r: number, g: number, b: number) => string;
/**
* It converts a hexadecimal color code to an RGB color code.
* @param hex - The hexadecimal color code.
*/
export declare const hexToRgb: (hex: any) => any;
/**
* Given an array of numbers, return the average of those numbers.
*/
export declare const average: (arr: any[]) => number;
/**
* It converts a string to camel case.
*/
export declare const toCamelCase: (str: string) => string;
/**
* Replace all words in a string with the first letter capitalized and the rest of the letters
* lowercase.
*/
export declare const toTitleCase: (str: string) => string;
/**
* Replace all whitespace characters with underscores and convert the string to lowercase.
*/
export declare const toSnakeCase: (str: string) => string;