|
648 | 648 | mapper: (value: T, key: number, iter: this) => M,
|
649 | 649 | context?: any
|
650 | 650 | ): List<M>;
|
| 651 | + |
| 652 | + /** |
| 653 | + * Flat-maps the List, returning a new List. |
| 654 | + * |
| 655 | + * Similar to `list.map(...).flatten(true)`. |
| 656 | + */ |
| 657 | + flatMap<M>( |
| 658 | + mapper: (value: T, key: number, iter: this) => ESIterable<M>, |
| 659 | + context?: any |
| 660 | + ): List<M>; |
651 | 661 | }
|
652 | 662 |
|
653 | 663 |
|
|
1181 | 1191 | mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
1182 | 1192 | context?: any
|
1183 | 1193 | ): Map<KM, VM>;
|
| 1194 | + |
| 1195 | + /** |
| 1196 | + * Flat-maps the Map, returning a new Map. |
| 1197 | + * |
| 1198 | + * Similar to `data.map(...).flatten(true)`. |
| 1199 | + */ |
| 1200 | + flatMap<KM, VM>( |
| 1201 | + mapper: (value: V, key: K, iter: this) => ESIterable<[KM, VM]>, |
| 1202 | + context?: any |
| 1203 | + ): Map<KM, VM>; |
1184 | 1204 | }
|
1185 | 1205 |
|
1186 | 1206 |
|
|
1257 | 1277 | mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
1258 | 1278 | context?: any
|
1259 | 1279 | ): OrderedMap<KM, VM>;
|
| 1280 | + |
| 1281 | + /** |
| 1282 | + * Flat-maps the OrderedMap, returning a new OrderedMap. |
| 1283 | + * |
| 1284 | + * Similar to `data.map(...).flatten(true)`. |
| 1285 | + */ |
| 1286 | + flatMap<KM, VM>( |
| 1287 | + mapper: (value: V, key: K, iter: this) => ESIterable<[KM, VM]>, |
| 1288 | + context?: any |
| 1289 | + ): OrderedMap<KM, VM>; |
1260 | 1290 | }
|
1261 | 1291 |
|
1262 | 1292 |
|
|
1424 | 1454 | mapper: (value: T, key: T, iter: this) => M,
|
1425 | 1455 | context?: any
|
1426 | 1456 | ): Set<M>;
|
| 1457 | + |
| 1458 | + /** |
| 1459 | + * Flat-maps the Set, returning a new Set. |
| 1460 | + * |
| 1461 | + * Similar to `set.map(...).flatten(true)`. |
| 1462 | + */ |
| 1463 | + flatMap<M>( |
| 1464 | + mapper: (value: T, key: T, iter: this) => ESIterable<M>, |
| 1465 | + context?: any |
| 1466 | + ): Set<M>; |
1427 | 1467 | }
|
1428 | 1468 |
|
1429 | 1469 |
|
|
1484 | 1524 | context?: any
|
1485 | 1525 | ): OrderedSet<M>;
|
1486 | 1526 |
|
| 1527 | + /** |
| 1528 | + * Flat-maps the OrderedSet, returning a new OrderedSet. |
| 1529 | + * |
| 1530 | + * Similar to `set.map(...).flatten(true)`. |
| 1531 | + */ |
| 1532 | + flatMap<M>( |
| 1533 | + mapper: (value: T, key: T, iter: this) => ESIterable<M>, |
| 1534 | + context?: any |
| 1535 | + ): OrderedSet<M>; |
| 1536 | + |
1487 | 1537 | /**
|
1488 | 1538 | * Returns an OrderedSet of the same type "zipped" with the provided
|
1489 | 1539 | * iterables.
|
|
1666 | 1716 | mapper: (value: T, key: number, iter: this) => M,
|
1667 | 1717 | context?: any
|
1668 | 1718 | ): Stack<M>;
|
| 1719 | + |
| 1720 | + /** |
| 1721 | + * Flat-maps the Stack, returning a new Stack. |
| 1722 | + * |
| 1723 | + * Similar to `stack.map(...).flatten(true)`. |
| 1724 | + */ |
| 1725 | + flatMap<M>( |
| 1726 | + mapper: (value: T, key: number, iter: this) => M, |
| 1727 | + context?: any |
| 1728 | + ): Stack<M>; |
1669 | 1729 | }
|
1670 | 1730 |
|
1671 | 1731 |
|
|
1977 | 2037 | mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
|
1978 | 2038 | context?: any
|
1979 | 2039 | ): Seq.Keyed<KM, VM>;
|
| 2040 | + |
| 2041 | + /** |
| 2042 | + * Flat-maps the Seq, returning a Seq of the same type. |
| 2043 | + * |
| 2044 | + * Similar to `seq.map(...).flatten(true)`. |
| 2045 | + */ |
| 2046 | + flatMap<KM, VM>( |
| 2047 | + mapper: (value: V, key: K, iter: this) => ESIterable<[KM, VM]>, |
| 2048 | + context?: any |
| 2049 | + ): Seq.Keyed<KM, VM>; |
1980 | 2050 | }
|
1981 | 2051 |
|
1982 | 2052 |
|
|
2029 | 2099 | mapper: (value: T, key: number, iter: this) => M,
|
2030 | 2100 | context?: any
|
2031 | 2101 | ): Seq.Indexed<M>;
|
| 2102 | + |
| 2103 | + /** |
| 2104 | + * Flat-maps the Seq, returning a a Seq of the same type. |
| 2105 | + * |
| 2106 | + * Similar to `seq.map(...).flatten(true)`. |
| 2107 | + */ |
| 2108 | + flatMap<M>( |
| 2109 | + mapper: (value: T, key: number, iter: this) => ESIterable<M>, |
| 2110 | + context?: any |
| 2111 | + ): Seq.Indexed<M>; |
2032 | 2112 | }
|
2033 | 2113 |
|
2034 | 2114 |
|
|
2083 | 2163 | mapper: (value: T, key: T, iter: this) => M,
|
2084 | 2164 | context?: any
|
2085 | 2165 | ): Seq.Set<M>;
|
| 2166 | + |
| 2167 | + /** |
| 2168 | + * Flat-maps the Seq, returning a Seq of the same type. |
| 2169 | + * |
| 2170 | + * Similar to `seq.map(...).flatten(true)`. |
| 2171 | + */ |
| 2172 | + flatMap<M>( |
| 2173 | + mapper: (value: T, key: T, iter: this) => ESIterable<M>, |
| 2174 | + context?: any |
| 2175 | + ): Seq.Set<M>; |
2086 | 2176 | }
|
2087 | 2177 |
|
2088 | 2178 | }
|
|
2164 | 2254 | mapper: (value: V, key: K, iter: this) => M,
|
2165 | 2255 | context?: any
|
2166 | 2256 | ): Seq<K, M>;
|
| 2257 | + |
| 2258 | + /** |
| 2259 | + * Flat-maps the Seq, returning a Seq of the same type. |
| 2260 | + * |
| 2261 | + * Similar to `seq.map(...).flatten(true)`. |
| 2262 | + */ |
| 2263 | + flatMap<M>( |
| 2264 | + mapper: (value: V, key: K, iter: this) => ESIterable<M>, |
| 2265 | + context?: any |
| 2266 | + ): Seq<K, M>; |
2167 | 2267 | }
|
2168 | 2268 |
|
2169 | 2269 | /**
|
|
2295 | 2395 | context?: any
|
2296 | 2396 | ): Iterable.Keyed<KM, VM>;
|
2297 | 2397 |
|
| 2398 | + /** |
| 2399 | + * Flat-maps the Iterable, returning an Iterable of the same type. |
| 2400 | + * |
| 2401 | + * Similar to `iterable.map(...).flatten(true)`. |
| 2402 | + */ |
| 2403 | + flatMap<KM, VM>( |
| 2404 | + mapper: (value: V, key: K, iter: this) => ESIterable<[KM, VM]>, |
| 2405 | + context?: any |
| 2406 | + ): Iterable.Keyed<KM, VM>; |
| 2407 | + |
2298 | 2408 | [Symbol.iterator](): Iterator<[K, V]>;
|
2299 | 2409 | }
|
2300 | 2410 |
|
|
2491 | 2601 | context?: any
|
2492 | 2602 | ): Iterable.Indexed<M>;
|
2493 | 2603 |
|
| 2604 | + /** |
| 2605 | + * Flat-maps the Iterable, returning an Iterable of the same type. |
| 2606 | + * |
| 2607 | + * Similar to `iterable.map(...).flatten(true)`. |
| 2608 | + */ |
| 2609 | + flatMap<M>( |
| 2610 | + mapper: (value: T, key: number, iter: this) => ESIterable<M>, |
| 2611 | + context?: any |
| 2612 | + ): Iterable.Indexed<M>; |
| 2613 | + |
2494 | 2614 | [Symbol.iterator](): Iterator<T>;
|
2495 | 2615 | }
|
2496 | 2616 |
|
|
2548 | 2668 | context?: any
|
2549 | 2669 | ): Iterable.Set<M>;
|
2550 | 2670 |
|
| 2671 | + /** |
| 2672 | + * Flat-maps the Iterable, returning an Iterable of the same type. |
| 2673 | + * |
| 2674 | + * Similar to `iterable.map(...).flatten(true)`. |
| 2675 | + */ |
| 2676 | + flatMap<M>( |
| 2677 | + mapper: (value: T, key: T, iter: this) => ESIterable<M>, |
| 2678 | + context?: any |
| 2679 | + ): Iterable.Set<M>; |
| 2680 | + |
2551 | 2681 | [Symbol.iterator](): Iterator<T>;
|
2552 | 2682 | }
|
2553 | 2683 |
|
|
3126 | 3256 | /**
|
3127 | 3257 | * Flat-maps the Iterable, returning an Iterable of the same type.
|
3128 | 3258 | *
|
3129 |
| - * Similar to `iter.map(...).flatten(true)`. |
| 3259 | + * Similar to `iterable.map(...).flatten(true)`. |
3130 | 3260 | */
|
3131 |
| - flatMap<R>( |
3132 |
| - mapper: (value: V, key: K, iter: this) => ESIterable<R>, |
| 3261 | + flatMap<M>( |
| 3262 | + mapper: (value: V, key: K, iter: this) => ESIterable<M>, |
3133 | 3263 | context?: any
|
3134 |
| - ): Iterable<K, R>; |
| 3264 | + ): Iterable<K, M>; |
3135 | 3265 |
|
3136 | 3266 | // Reducing a value
|
3137 | 3267 |
|
|
3425 | 3555 | mapper: (value: V, key: K, iter: this) => M,
|
3426 | 3556 | context?: any
|
3427 | 3557 | ): Collection.Keyed<K, M>;
|
| 3558 | + |
| 3559 | + /** |
| 3560 | + * Flat-maps the Collection, returning an Collection of the same type. |
| 3561 | + * |
| 3562 | + * Similar to `collection.map(...).flatten(true)`. |
| 3563 | + */ |
| 3564 | + flatMap<KM, VM>( |
| 3565 | + mapper: (value: V, key: K, iter: this) => ESIterable<[KM, VM]>, |
| 3566 | + context?: any |
| 3567 | + ): Collection.Keyed<KM, VM>; |
3428 | 3568 | }
|
3429 | 3569 |
|
3430 | 3570 |
|
|
3464 | 3604 | mapper: (value: T, key: number, iter: this) => M,
|
3465 | 3605 | context?: any
|
3466 | 3606 | ): Collection.Indexed<M>;
|
| 3607 | + |
| 3608 | + /** |
| 3609 | + * Flat-maps the Collection, returning an Collection of the same type. |
| 3610 | + * |
| 3611 | + * Similar to `collection.map(...).flatten(true)`. |
| 3612 | + */ |
| 3613 | + flatMap<M>( |
| 3614 | + mapper: (value: T, key: number, iter: this) => ESIterable<M>, |
| 3615 | + context?: any |
| 3616 | + ): Collection.Indexed<M>; |
3467 | 3617 | }
|
3468 | 3618 |
|
3469 | 3619 |
|
|
3507 | 3657 | mapper: (value: T, key: T, iter: this) => M,
|
3508 | 3658 | context?: any
|
3509 | 3659 | ): Collection.Set<M>;
|
3510 |
| - } |
3511 | 3660 |
|
| 3661 | + /** |
| 3662 | + * Flat-maps the Collection, returning an Collection of the same type. |
| 3663 | + * |
| 3664 | + * Similar to `collection.map(...).flatten(true)`. |
| 3665 | + */ |
| 3666 | + flatMap<M>( |
| 3667 | + mapper: (value: T, key: T, iter: this) => ESIterable<M>, |
| 3668 | + context?: any |
| 3669 | + ): Collection.Set<M>; |
| 3670 | + } |
3512 | 3671 | }
|
3513 | 3672 |
|
3514 | 3673 | export interface Collection<K, V> extends Iterable<K, V> {
|
|
0 commit comments