Type definitions for array.prototype.flatmap (#29437)

* Type definitions for array.prototype.flatmap

* array.prototype.flatmap: importing "/auto" extends the Array prototype
This commit is contained in:
Jesse Hallett
2018-10-08 10:36:07 -07:00
committed by Wesley Wigham
parent aef895f924
commit 1899725695
8 changed files with 117 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
// 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[]) => B[],
thisArg?: T
): B[];
export = flatMap;