mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
* array.prototype.flatmap: support ReadonlyArray * array.prototype.flatmap: support readonly result from callback
14 lines
389 B
TypeScript
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[];
|
|
}
|