flatten.d.ts 323 B

1234567
  1. declare type Flattened<T> = T extends Array<infer U> ? Flattened<U> : T;
  2. /**
  3. * Returns a new list by pulling every item out of it (and all its sub-arrays)
  4. * and putting them in a new array, depth-first. Stolen from Ramda.
  5. */
  6. export declare function flatten<T extends readonly any[]>(list: T): Flattened<T>[];
  7. export {};