/** * Checks if given variable is function. * * @param {*} func Variable to check. * @returns {boolean} */ export declare function isFunction(func: T): func is T & ((...args: unknown[]) => unknown); /** * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over time (`wait`). * * @param {Function} func Function to invoke. * @param {number} wait Delay in miliseconds. * @returns {Function} */ export declare function throttle(func: (...args: unknown[]) => unknown, wait?: number): (...args: unknown[]) => unknown; /** * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over * time (`wait`) after specified hits. * * @param {Function} func Function to invoke. * @param {number} wait Delay in miliseconds. * @param {number} hits Number of hits after throttling will be applied. * @returns {Function} */ export declare function throttleAfterHits(func: (...args: unknown[]) => unknown, wait?: number, hits?: number): (...args: unknown[]) => unknown; /** * Creates debounce function that enforces a function (`func`) not be called again until a certain amount of time (`wait`) * has passed without it being called. * * @param {Function} func Function to invoke. * @param {number} wait Delay in milliseconds. * @returns {Function} The debounced function. It has a `cancel` method that clears a pending timer. */ export declare function debounce(func: (...args: unknown[]) => unknown, wait?: number): ((...args: unknown[]) => unknown) & { cancel: () => void; }; /** * Creates the function that returns the result of calling the given functions. Result of the first function is passed to * the second as an argument and so on. Only first function in the chain can handle multiple arguments. * * @param {Function} functions Functions to compose. * @returns {Function} */ export declare function pipe(...functions: Array<(...args: unknown[]) => unknown>): (...args: unknown[]) => unknown; /** * Creates the function that returns the function with cached arguments. * * @param {Function} func Function to partialization. * @param {Array} params Function arguments to cache. * @returns {Function} */ export declare function partial(func: (...args: unknown[]) => unknown, ...params: unknown[]): (...args: unknown[]) => unknown; /** * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched * to the arguments defined in `func` then function will be invoked. * Arguments are added to the stack in direction from the left to the right. * * @example * ``` * var replace = curry(function(find, replace, string) { * return string.replace(find, replace); * }); * * // returns function with bounded first argument * var replace = replace('foo') * * // returns replaced string - all arguments was passed so function was invoked * replace('bar', 'Some test with foo...'); * * ``` * * @param {Function} func Function to currying. * @returns {Function} */ export declare function curry(func: (...args: unknown[]) => unknown): (...args: unknown[]) => unknown; /** * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched * to the arguments defined in `func` then function will be invoked. * Arguments are added to the stack in direction from the right to the left. * * @example * ``` * var replace = curry(function(find, replace, string) { * return string.replace(find, replace); * }); * * // returns function with bounded first argument * var replace = replace('Some test with foo...') * * // returns replaced string - all arguments was passed so function was invoked * replace('bar', 'foo'); * * ``` * * @param {Function} func Function to currying. * @returns {Function} */ export declare function curryRight(func: (...args: unknown[]) => unknown): (...args: unknown[]) => unknown; /** * Calls a function in the quickest way available. * * In contrast to the `apply()` method that passes arguments as an array, * the `call()` method passes arguments directly, to avoid garbage collection costs. * * @param {Function} func The function to call. * @param {*} context The value to use as `this` when calling the `func` function. * @param {*} [arg1] An argument passed to the `func` function. * @param {*} [arg2] An argument passed to `func` function. * @param {*} [arg3] An argument passed to `func` function. * @param {*} [arg4] An argument passed to `func` function. * @param {*} [arg5] An argument passed to `func` function. * @param {*} [arg6] An argument passed to `func` function. * @returns {*} */ export declare function fastCall(func: (...args: unknown[]) => unknown, context: unknown, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown, arg5?: unknown, arg6?: unknown): unknown;