mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* array.prototype.flatmap: support ReadonlyArray * array.prototype.flatmap: support readonly result from callback
23 lines
770 B
TypeScript
23 lines
770 B
TypeScript
// Type definitions for array.prototype.flatmap 1.2
|
|
// Project: https://github.com/es-shims/Array.prototype.flatMap#readme
|
|
// Definitions by: Jesse Hallett <https://github.com/hallettj>
|
|
// Jordan Harband <https://github.com/ljharb>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.3
|
|
|
|
import flatMapImpl = require("./implementation");
|
|
|
|
interface 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[];
|
|
getPolyfill(): typeof flatMapImpl;
|
|
implementation: typeof flatMapImpl;
|
|
shim(): typeof flatMapImpl;
|
|
}
|
|
|
|
declare const flatMap: FlatMap;
|
|
export = flatMap;
|