/** * Counts the number of arguments a function has; paying attention to the function's signature * to avoid edge cases. * This is used to allow for compiler optimizations. * @param {(...args: any[]) => any} fn * @returns {number} */ export function countArguments(fn: (...args: any[]) => any): number;