import { Box } from '../types'; /** * The method won't do anything. * @returns * Return input itself. */ export declare function noChange(input: T): T; /** * If input is not an array, change it to an array. * @returns * Return `[]` if input is null or undefined. * @returns * Return an array if input is valid value. */ export declare function group(input: MaybeGroup): T[]; /** * Find the first value recursively that is not an array. * @example * ungroup([[[1], 2], 3]) // 1 * ungroup([null, [1]]) // null */ export declare function ungroup(input: T): Ungroup; /** * Convert percentage string to number. * @param input * The percentage string or number to transform. * @param relative * The meta number of percentage input. */ export declare function getPercentageNumber(input: Meta, relative: number): number; /** * Measure the length of a piece of text. * @param text * The text to measure. * @param fontSize * The fontSize of the text. * @param fontFamily * The fontFamily of the text which cannot be empty. */ export declare function getTextWidth(text: Meta, fontSize?: Meta, fontFamily?: string): number; /** * Judge magnitude of number. * @param number * The value to be estimated. * @example * getMagnitude(300) // 100 * getMagnitude(50) // 10 */ export declare function getMagnitude(number: number): number; /** * Download string as a file. * @param data * The string about to download. * @param fileName * The name with suffix. */ export declare function download(data: string, fileName: string): void; /** * Generates a numeric sequence starting from the given start and stop values. * @param step * The step defaults to 1. * @param toFixed * The parameter of Number.toFixed which defaults to 8. * @returns */ export declare function robustRange(start: number, end: number, step?: number, toFixed?: number): number[]; /** * Swap two values or a property of two objects. * @param a * Object or array or variable. * @param b * Object or array or variable. * @example * swap([1, 2], [3, 4], 0, 1) // [4, 2] and [3, 1] * swap({a: 1}, {a: 2}, 'a') // {a: 2} and {a: 1} */ export declare function swap(a: any, b: any, key1: Meta, key2?: Meta): void; /** * Syntax sugar for try and catch. * @param fn * The function that may throw error. * @param onError * The error handler. */ export declare function errorCatcher(fn: Fn, onError: (error: Error) => void): (...args: Parameters) => ReturnType | undefined; /** * Rectangle Collision Detection. * @returns * Return collision or not. */ export declare function isBoxCollision(box1: Box, box2: Box): boolean; /** * A wrapper around the while syntax, limiting the maximum number of loops. * Return false in the body function to break out of the loop. */ export declare function safeLoop(condition: AnyFunction, body: (times: number) => false | unknown, maxTimes?: number): number; /** * Create a registration function that can extend the built-in class. * @param mapping * Internal map of register functions. * @returns * The register function. * @internal */ export declare function createClassRegister(mapping: AnyObject): (key: K, klass: Newable) => void; /** * Attach strong type resolution to native methods. * @see Object.fromEntries */ export declare function fromEntries(entries: [Key, Value][]): Record; /** * Syntactic sugar for computed properties. * @param computable * Property value or property value generating function. * @param params * Function arguments that generate properties. * @returns * The attribute value. */ export declare function compute(computable: Computable, params: P): T; /** * Parse svg path command. * @param path * The path string. * @returns * Path data for easy processing. */ export declare function parsePath(path: string): { command: string; data: number[]; }[];