DefinitelyTyped/types/array.prototype.flatmap/auto.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

14 lines
389 B
TypeScript

interface Array<T> {
flatMap<U, R extends object | undefined = undefined>(
fn: (this: R, x: T, index: number, array: this) => ReadonlyArray<U>,
thisArg?: R
): U[];
}
interface ReadonlyArray<T> {
flatMap<U, R extends object | undefined = undefined>(
fn: (this: R, x: T, index: number, array: this) => ReadonlyArray<U>,
thisArg?: R
): U[];
}