// Adapted from https://github.com/microsoft/TypeScript/blob/master/lib/lib.es2019.array.d.ts /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat(receiver: U[][][][][][][][], depth: 7): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat(receiver: U[][][][][][][], depth: 6): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat(receiver: U[][][][][][], depth: 5): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat( receiver: | ReadonlyArray | ReadonlyArray> | ReadonlyArray>> | ReadonlyArray>>> | ReadonlyArray>>>> | ReadonlyArray>> | ReadonlyArray>>>> | ReadonlyArray>>>> | ReadonlyArray>>>> | ReadonlyArray>>> | ReadonlyArray>>> | ReadonlyArray>>> | ReadonlyArray>>>> | ReadonlyArray>>>> | ReadonlyArray>>>> | ReadonlyArray>>>>, depth: 4, ): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat( receiver: | ReadonlyArray | ReadonlyArray>>> | ReadonlyArray>> | ReadonlyArray> | ReadonlyArray>> | ReadonlyArray>>> | ReadonlyArray>>> | ReadonlyArray>>>, depth: 3, ): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat( receiver: | ReadonlyArray | ReadonlyArray> | ReadonlyArray>> | ReadonlyArray>>, depth: 2, ): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat(receiver: ReadonlyArray | ReadonlyArray>, depth?: 1): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. * * @param depth The maximum recursion depth */ declare function flat(receiver: ReadonlyArray, depth: 0): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the * specified depth. If no depth is provided, flat method defaults to the depth of 1. * * @param depth The maximum recursion depth */ declare function flat(receiver: ReadonlyArray, depth?: number): any[]; export = flat;