DefinitelyTyped/types/array.prototype.flatmap/implementation.d.ts
Martin Pärtel 59020cc50a
🤖 Merge PR #46399 array.prototype.flatmap: support ReadonlyArray by @mpartel
* array.prototype.flatmap: support ReadonlyArray

* array.prototype.flatmap: support readonly result from callback
2020-07-29 02:27:37 -04:00

8 lines
295 B
TypeScript

// This is the same type as the callable signature in `FlatMap` in `index.d.ts`.
declare function flatMap<A, B, T extends object | undefined = undefined>(
xs: ReadonlyArray<A>,
fn: (this: T, x: A, index: number, array: A[]) => ReadonlyArray<B>,
thisArg?: T
): B[];
export = flatMap;