immutable 4.0.0-rc.6 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,3 @@
1
- /**
2
- * Copyright (c) 2014-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
1
  /**
9
2
  * This file provides type definitions for use with the Flow type checker.
10
3
  *
@@ -25,14 +18,49 @@
25
18
  *
26
19
  * takesASeq(someSeq)
27
20
  *
28
- * @flow
21
+ * @flow strict
29
22
  */
30
23
 
31
24
  // Helper type that represents plain objects allowed as arguments to
32
25
  // some constructors and functions.
33
- type PlainObjInput<K, V> = {[key: K]: V, __proto__: null};
34
-
35
- declare class _Collection<K, +V> /*implements ValueObject*/ {
26
+ type PlainObjInput<K, V> = { +[key: K]: V, __proto__: null };
27
+
28
+ type K<T> = $Keys<T>;
29
+
30
+ // Helper types to extract the "keys" and "values" use by the *In() methods.
31
+ type $KeyOf<C> = $Call<
32
+ (<K>(?_Collection<K, mixed>) => K) &
33
+ (<T>(?$ReadOnlyArray<T>) => number) &
34
+ (<T>(?RecordInstance<T> | T) => $Keys<T>) &
35
+ (<T: Object>(T) => $Keys<T>),
36
+ C
37
+ >;
38
+
39
+ type $ValOf<C, K = $KeyOf<C>> = $Call<
40
+ (<V>(?_Collection<any, V>) => V) &
41
+ (<T>(?$ReadOnlyArray<T>) => T) &
42
+ (<T, K: $Keys<T>>(?RecordInstance<T> | T, K) => $ElementType<T, K>) &
43
+ (<T: Object>(T) => $Values<T>),
44
+ C,
45
+ K
46
+ >;
47
+
48
+ type $IterableOf<C> = $Call<
49
+ (<V: Array<any> | IndexedCollection<any> | SetCollection<any>>(
50
+ V
51
+ ) => Iterable<$ValOf<V>>) &
52
+ (<
53
+ V:
54
+ | KeyedCollection<any, any>
55
+ | RecordInstance<any>
56
+ | PlainObjInput<any, any>
57
+ >(
58
+ V
59
+ ) => Iterable<[$KeyOf<V>, $ValOf<V>]>),
60
+ C
61
+ >;
62
+
63
+ declare class _Collection<K, +V> implements ValueObject {
36
64
  equals(other: mixed): boolean;
37
65
  hashCode(): number;
38
66
  get(key: K, ..._: []): V | void;
@@ -40,17 +68,46 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
40
68
  has(key: K): boolean;
41
69
  includes(value: V): boolean;
42
70
  contains(value: V): boolean;
43
- first(): V | void;
44
- last(): V | void;
71
+ first<NSV>(notSetValue?: NSV): V | NSV;
72
+ last<NSV>(notSetValue?: NSV): V | NSV;
45
73
 
46
- getIn(keyPath: Iterable<mixed>, notSetValue?: mixed): any;
47
74
  hasIn(keyPath: Iterable<mixed>): boolean;
48
75
 
76
+ getIn(keyPath: [], notSetValue?: mixed): this;
77
+ getIn<NSV>(keyPath: [K], notSetValue: NSV): V | NSV;
78
+ getIn<NSV, K2: $KeyOf<V>>(
79
+ keyPath: [K, K2],
80
+ notSetValue: NSV
81
+ ): $ValOf<V, K2> | NSV;
82
+ getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
83
+ keyPath: [K, K2, K3],
84
+ notSetValue: NSV
85
+ ): $ValOf<$ValOf<V, K2>, K3> | NSV;
86
+ getIn<
87
+ NSV,
88
+ K2: $KeyOf<V>,
89
+ K3: $KeyOf<$ValOf<V, K2>>,
90
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
91
+ >(
92
+ keyPath: [K, K2, K3, K4],
93
+ notSetValue: NSV
94
+ ): $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV;
95
+ getIn<
96
+ NSV,
97
+ K2: $KeyOf<V>,
98
+ K3: $KeyOf<$ValOf<V, K2>>,
99
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
100
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
101
+ >(
102
+ keyPath: [K, K2, K3, K4, K5],
103
+ notSetValue: NSV
104
+ ): $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV;
105
+
49
106
  update<U>(updater: (value: this) => U): U;
50
107
 
51
108
  toJS(): Array<any> | { [key: string]: mixed };
52
109
  toJSON(): Array<V> | { [key: string]: V };
53
- toArray(): Array<V> | Array<[K,V]>;
110
+ toArray(): Array<V> | Array<[K, V]>;
54
111
  toObject(): { [key: string]: V };
55
112
  toMap(): Map<K, V>;
56
113
  toOrderedMap(): OrderedMap<K, V>;
@@ -94,12 +151,24 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
94
151
  butLast(): this;
95
152
  skip(amount: number): this;
96
153
  skipLast(amount: number): this;
97
- skipWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
98
- skipUntil(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
154
+ skipWhile(
155
+ predicate: (value: V, key: K, iter: this) => mixed,
156
+ context?: mixed
157
+ ): this;
158
+ skipUntil(
159
+ predicate: (value: V, key: K, iter: this) => mixed,
160
+ context?: mixed
161
+ ): this;
99
162
  take(amount: number): this;
100
163
  takeLast(amount: number): this;
101
- takeWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
102
- takeUntil(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
164
+ takeWhile(
165
+ predicate: (value: V, key: K, iter: this) => mixed,
166
+ context?: mixed
167
+ ): this;
168
+ takeUntil(
169
+ predicate: (value: V, key: K, iter: this) => mixed,
170
+ context?: mixed
171
+ ): this;
103
172
 
104
173
  filterNot(
105
174
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -109,27 +178,37 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
109
178
  reduce<R>(
110
179
  reducer: (reduction: R, value: V, key: K, iter: this) => R,
111
180
  initialReduction: R,
112
- context?: mixed,
113
- ): R;
114
- reduce<R>(
115
- reducer: (reduction: V | R, value: V, key: K, iter: this) => R
181
+ context?: mixed
116
182
  ): R;
183
+ reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;
117
184
 
118
185
  reduceRight<R>(
119
186
  reducer: (reduction: R, value: V, key: K, iter: this) => R,
120
187
  initialReduction: R,
121
- context?: mixed,
188
+ context?: mixed
122
189
  ): R;
123
190
  reduceRight<R>(
124
191
  reducer: (reduction: V | R, value: V, key: K, iter: this) => R
125
192
  ): R;
126
193
 
127
- every(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): boolean;
128
- some(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): boolean;
194
+ every(
195
+ predicate: (value: V, key: K, iter: this) => mixed,
196
+ context?: mixed
197
+ ): boolean;
198
+ some(
199
+ predicate: (value: V, key: K, iter: this) => mixed,
200
+ context?: mixed
201
+ ): boolean;
129
202
  join(separator?: string): string;
130
203
  isEmpty(): boolean;
131
- count(predicate?: (value: V, key: K, iter: this) => mixed, context?: mixed): number;
132
- countBy<G>(grouper: (value: V, key: K, iter: this) => G, context?: mixed): Map<G, number>;
204
+ count(
205
+ predicate?: (value: V, key: K, iter: this) => mixed,
206
+ context?: mixed
207
+ ): number;
208
+ countBy<G>(
209
+ grouper: (value: V, key: K, iter: this) => G,
210
+ context?: mixed
211
+ ): Map<G, number>;
133
212
 
134
213
  find<NSV>(
135
214
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -143,10 +222,18 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
143
222
  ): V | NSV;
144
223
 
145
224
  findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
146
- findLastEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
225
+ findLastEntry(
226
+ predicate: (value: V, key: K, iter: this) => mixed
227
+ ): [K, V] | void;
147
228
 
148
- findKey(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): K | void;
149
- findLastKey(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): K | void;
229
+ findKey(
230
+ predicate: (value: V, key: K, iter: this) => mixed,
231
+ context?: mixed
232
+ ): K | void;
233
+ findLastKey(
234
+ predicate: (value: V, key: K, iter: this) => mixed,
235
+ context?: mixed
236
+ ): K | void;
150
237
 
151
238
  keyOf(searchValue: V): K | void;
152
239
  lastKeyOf(searchValue: V): K | void;
@@ -166,21 +253,46 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
166
253
  isSuperset(iter: Iterable<V>): boolean;
167
254
  }
168
255
 
169
- declare function isImmutable(maybeImmutable: mixed): boolean %checks(maybeImmutable instanceof Collection);
170
- declare function isCollection(maybeCollection: mixed): boolean %checks(maybeCollection instanceof Collection);
171
- declare function isKeyed(maybeKeyed: mixed): boolean %checks(maybeKeyed instanceof KeyedCollection);
172
- declare function isIndexed(maybeIndexed: mixed): boolean %checks(maybeIndexed instanceof IndexedCollection);
173
- declare function isAssociative(maybeAssociative: mixed): boolean %checks(
174
- maybeAssociative instanceof KeyedCollection ||
175
- maybeAssociative instanceof IndexedCollection
176
- );
177
- declare function isOrdered(maybeOrdered: mixed): boolean %checks(
178
- maybeOrdered instanceof IndexedCollection ||
256
+ declare function isImmutable(
257
+ maybeImmutable: mixed
258
+ ): boolean %checks(maybeImmutable instanceof Collection);
259
+ declare function isCollection(
260
+ maybeCollection: mixed
261
+ ): boolean %checks(maybeCollection instanceof Collection);
262
+ declare function isKeyed(
263
+ maybeKeyed: mixed
264
+ ): boolean %checks(maybeKeyed instanceof KeyedCollection);
265
+ declare function isIndexed(
266
+ maybeIndexed: mixed
267
+ ): boolean %checks(maybeIndexed instanceof IndexedCollection);
268
+ declare function isAssociative(
269
+ maybeAssociative: mixed
270
+ ): boolean %checks(maybeAssociative instanceof KeyedCollection ||
271
+ maybeAssociative instanceof IndexedCollection);
272
+ declare function isOrdered(
273
+ maybeOrdered: mixed
274
+ ): boolean %checks(maybeOrdered instanceof IndexedCollection ||
179
275
  maybeOrdered instanceof OrderedMap ||
180
- maybeOrdered instanceof OrderedSet
181
- );
276
+ maybeOrdered instanceof OrderedSet);
182
277
  declare function isValueObject(maybeValue: mixed): boolean;
183
278
 
279
+ declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq);
280
+ declare function isList(maybeList: any): boolean %checks(maybeList instanceof
281
+ List);
282
+ declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map);
283
+ declare function isOrderedMap(
284
+ maybeOrderedMap: any
285
+ ): boolean %checks(maybeOrderedMap instanceof OrderedMap);
286
+ declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof
287
+ Stack);
288
+ declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set);
289
+ declare function isOrderedSet(
290
+ maybeOrderedSet: any
291
+ ): boolean %checks(maybeOrderedSet instanceof OrderedSet);
292
+ declare function isRecord(
293
+ maybeRecord: any
294
+ ): boolean %checks(maybeRecord instanceof Record);
295
+
184
296
  declare interface ValueObject {
185
297
  equals(other: mixed): boolean;
186
298
  hashCode(): number;
@@ -199,8 +311,9 @@ declare class Collection<K, +V> extends _Collection<K, V> {
199
311
  }
200
312
 
201
313
  declare class KeyedCollection<K, +V> extends Collection<K, V> {
202
- static <K, V>(iter?: Iterable<[K, V]>): KeyedCollection<K, V>;
203
- static <K, V>(obj?: PlainObjInput<K, V>): KeyedCollection<K, V>;
314
+ static <K, V>(
315
+ values?: Iterable<[K, V]> | PlainObjInput<K, V>
316
+ ): KeyedCollection<K, V>;
204
317
 
205
318
  toJS(): { [key: string]: mixed };
206
319
  toJSON(): { [key: string]: V };
@@ -209,8 +322,9 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
209
322
  toSeq(): KeyedSeq<K, V>;
210
323
  flip(): KeyedCollection<V, K>;
211
324
 
212
- concat<KC, VC>(...iters: Array<Iterable<[KC, VC]>>): KeyedCollection<K | KC, V | VC>;
213
- concat<KC, VC>(...iters: Array<PlainObjInput<KC, VC>>): KeyedCollection<K | KC, V | VC>;
325
+ concat<KC, VC>(
326
+ ...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>>
327
+ ): KeyedCollection<K | KC, V | VC>;
214
328
 
215
329
  filter(predicate: typeof Boolean): KeyedCollection<K, $NonMaybeType<V>>;
216
330
  filter(
@@ -242,7 +356,7 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
242
356
  flatten(shallow?: boolean): KeyedCollection<any, any>;
243
357
  }
244
358
 
245
- Collection.Keyed = KeyedCollection
359
+ Collection.Keyed = KeyedCollection;
246
360
 
247
361
  declare class IndexedCollection<+T> extends Collection<number, T> {
248
362
  static <T>(iter?: Iterable<T>): IndexedCollection<T>;
@@ -255,16 +369,9 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
255
369
  fromEntrySeq<K, V>(): KeyedSeq<K, V>;
256
370
  interpose(separator: T): this;
257
371
  interleave(...collections: Iterable<T>[]): this;
258
- splice(
259
- index: number,
260
- removeNum: number,
261
- ...values: T[]
262
- ): this;
372
+ splice(index: number, removeNum: number, ...values: T[]): this;
263
373
 
264
- zip<A>(
265
- a: Iterable<A>,
266
- ..._: []
267
- ): IndexedCollection<[T, A]>;
374
+ zip<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T, A]>;
268
375
  zip<A, B>(
269
376
  a: Iterable<A>,
270
377
  b: Iterable<B>,
@@ -292,28 +399,25 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
292
399
  ..._: []
293
400
  ): IndexedCollection<[T, A, B, C, D, E]>;
294
401
 
295
- zipAll<A>(
296
- a: Iterable<A>,
297
- ..._: []
298
- ): IndexedCollection<[T|void, A|void]>;
402
+ zipAll<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T | void, A | void]>;
299
403
  zipAll<A, B>(
300
404
  a: Iterable<A>,
301
405
  b: Iterable<B>,
302
406
  ..._: []
303
- ): IndexedCollection<[T|void, A|void, B|void]>;
407
+ ): IndexedCollection<[T | void, A | void, B | void]>;
304
408
  zipAll<A, B, C>(
305
409
  a: Iterable<A>,
306
410
  b: Iterable<B>,
307
411
  c: Iterable<C>,
308
412
  ..._: []
309
- ): IndexedCollection<[T|void, A|void, B|void, C|void]>;
413
+ ): IndexedCollection<[T | void, A | void, B | void, C | void]>;
310
414
  zipAll<A, B, C, D>(
311
415
  a: Iterable<A>,
312
416
  b: Iterable<B>,
313
417
  c: Iterable<C>,
314
418
  d: Iterable<D>,
315
419
  ..._: []
316
- ): IndexedCollection<[T|void, A|void, B|void, C|void, D|void]>;
420
+ ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>;
317
421
  zipAll<A, B, C, D, E>(
318
422
  a: Iterable<A>,
319
423
  b: Iterable<B>,
@@ -321,7 +425,9 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
321
425
  d: Iterable<D>,
322
426
  e: Iterable<E>,
323
427
  ..._: []
324
- ): IndexedCollection<[T|void, A|void, B|void, C|void, D|void, E|void]>;
428
+ ): IndexedCollection<
429
+ [T | void, A | void, B | void, C | void, D | void, E | void]
430
+ >;
325
431
 
326
432
  zipWith<A, R>(
327
433
  zipper: (value: T, a: A) => R,
@@ -401,7 +507,7 @@ declare class SetCollection<+T> extends Collection<T, T> {
401
507
  @@iterator(): Iterator<T>;
402
508
  toSeq(): SetSeq<T>;
403
509
 
404
- concat<C>(...iters: Array<Iterable<C> | C>): SetCollection<T | C>;
510
+ concat<U>(...collections: Iterable<U>[]): SetCollection<T | U>;
405
511
 
406
512
  // `filter`, `map` and `flatMap` cannot be defined further up the hierarchy,
407
513
  // because the implementation for `KeyedCollection` allows the value type to
@@ -427,16 +533,17 @@ declare class SetCollection<+T> extends Collection<T, T> {
427
533
  flatten(shallow?: boolean): SetCollection<any>;
428
534
  }
429
535
 
430
- declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof Seq);
536
+ declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof
537
+ Seq);
431
538
  declare class Seq<K, +V> extends _Collection<K, V> {
432
539
  static Keyed: typeof KeyedSeq;
433
540
  static Indexed: typeof IndexedSeq;
434
541
  static Set: typeof SetSeq;
435
542
 
436
- static <K, V>(iter: KeyedSeq<K, V>): KeyedSeq<K, V>;
437
- static <T>(iter: SetSeq<T>): SetSeq<K, V>;
438
- static <T>(iter?: Iterable<T>): IndexedSeq<T>;
439
- static <K, V>(iter: PlainObjInput<K, V>): KeyedSeq<K, V>;
543
+ static <K, V>(values: KeyedSeq<K, V>): KeyedSeq<K, V>;
544
+ static <T>(values: SetSeq<T>): SetSeq<K, V>;
545
+ static <T>(values: Iterable<T>): IndexedSeq<T>;
546
+ static <K, V>(values?: PlainObjInput<K, V>): KeyedSeq<K, V>;
440
547
 
441
548
  static isSeq: typeof isSeq;
442
549
 
@@ -446,14 +553,16 @@ declare class Seq<K, +V> extends _Collection<K, V> {
446
553
  }
447
554
 
448
555
  declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
449
- static <K, V>(iter?: Iterable<[K, V]>): KeyedSeq<K, V>;
450
- static <K, V>(iter?: PlainObjInput<K, V>): KeyedSeq<K, V>;
556
+ static <K, V>(
557
+ values?: Iterable<[K, V]> | PlainObjInput<K, V>
558
+ ): KeyedSeq<K, V>;
451
559
 
452
560
  // Override specialized return types
453
561
  flip(): KeyedSeq<V, K>;
454
562
 
455
- concat<KC, VC>(...iters: Array<Iterable<[KC, VC]>>): KeyedSeq<K | KC, V | VC>;
456
- concat<KC, VC>(...iters: Array<PlainObjInput<KC, VC>>): KeyedSeq<K | KC, V | VC>;
563
+ concat<KC, VC>(
564
+ ...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>>
565
+ ): KeyedSeq<K | KC, V | VC>;
457
566
 
458
567
  filter(predicate: typeof Boolean): KeyedSeq<K, $NonMaybeType<V>>;
459
568
  filter(
@@ -485,8 +594,11 @@ declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
485
594
  flatten(shallow?: boolean): KeyedSeq<any, any>;
486
595
  }
487
596
 
488
- declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T> {
489
- static <T>(iter?: Iterable<T>): IndexedSeq<T>;
597
+ declare class IndexedSeq<+T>
598
+ extends Seq<number, T>
599
+ mixins IndexedCollection<T>
600
+ {
601
+ static <T>(values?: Iterable<T>): IndexedSeq<T>;
490
602
 
491
603
  static of<T>(...values: T[]): IndexedSeq<T>;
492
604
 
@@ -513,15 +625,8 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
513
625
  flatten(depth?: number): IndexedSeq<any>;
514
626
  flatten(shallow?: boolean): IndexedSeq<any>;
515
627
 
516
- zip<A>(
517
- a: Iterable<A>,
518
- ..._: []
519
- ): IndexedSeq<[T, A]>;
520
- zip<A, B>(
521
- a: Iterable<A>,
522
- b: Iterable<B>,
523
- ..._: []
524
- ): IndexedSeq<[T, A, B]>;
628
+ zip<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T, A]>;
629
+ zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): IndexedSeq<[T, A, B]>;
525
630
  zip<A, B, C>(
526
631
  a: Iterable<A>,
527
632
  b: Iterable<B>,
@@ -544,28 +649,25 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
544
649
  ..._: []
545
650
  ): IndexedSeq<[T, A, B, C, D, E]>;
546
651
 
547
- zipAll<A>(
548
- a: Iterable<A>,
549
- ..._: []
550
- ): IndexedSeq<[T|void, A|void]>;
652
+ zipAll<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T | void, A | void]>;
551
653
  zipAll<A, B>(
552
654
  a: Iterable<A>,
553
655
  b: Iterable<B>,
554
656
  ..._: []
555
- ): IndexedSeq<[T|void, A|void, B|void]>;
657
+ ): IndexedSeq<[T | void, A | void, B | void]>;
556
658
  zipAll<A, B, C>(
557
659
  a: Iterable<A>,
558
660
  b: Iterable<B>,
559
661
  c: Iterable<C>,
560
662
  ..._: []
561
- ): IndexedSeq<[T|void, A|void, B|void, C|void]>;
663
+ ): IndexedSeq<[T | void, A | void, B | void, C | void]>;
562
664
  zipAll<A, B, C, D>(
563
665
  a: Iterable<A>,
564
666
  b: Iterable<B>,
565
667
  c: Iterable<C>,
566
668
  d: Iterable<D>,
567
669
  ..._: []
568
- ): IndexedSeq<[T|void, A|void, B|void, C|void, D|void]>;
670
+ ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>;
569
671
  zipAll<A, B, C, D, E>(
570
672
  a: Iterable<A>,
571
673
  b: Iterable<B>,
@@ -573,7 +675,7 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
573
675
  d: Iterable<D>,
574
676
  e: Iterable<E>,
575
677
  ..._: []
576
- ): IndexedSeq<[T|void, A|void, B|void, C|void, D|void, E|void]>;
678
+ ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>;
577
679
 
578
680
  zipWith<A, R>(
579
681
  zipper: (value: T, a: A) => R,
@@ -613,13 +715,13 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
613
715
  }
614
716
 
615
717
  declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> {
616
- static <T>(iter?: Iterable<T>): IndexedSeq<T>;
718
+ static <T>(values?: Iterable<T>): SetSeq<T>;
617
719
 
618
720
  static of<T>(...values: T[]): SetSeq<T>;
619
721
 
620
722
  // Override specialized return types
621
723
 
622
- concat<C>(...iters: Array<Iterable<C> | C>): SetSeq<T | C>;
724
+ concat<U>(...collections: Iterable<U>[]): SetSeq<T | U>;
623
725
 
624
726
  filter(predicate: typeof Boolean): SetSeq<$NonMaybeType<T>>;
625
727
  filter(
@@ -641,8 +743,161 @@ declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> {
641
743
  flatten(shallow?: boolean): SetSeq<any>;
642
744
  }
643
745
 
644
- declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof List);
645
- declare class List<+T> extends IndexedCollection<T> {
746
+ declare class UpdatableInCollection<K, +V> {
747
+ setIn<S>(keyPath: [], value: S): S;
748
+ setIn(keyPath: [K], value: V): this;
749
+ setIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], value: S): this;
750
+ setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(
751
+ keyPath: [K, K2, K3],
752
+ value: S
753
+ ): this;
754
+ setIn<
755
+ K2: $KeyOf<V>,
756
+ K3: $KeyOf<$ValOf<V, K2>>,
757
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
758
+ S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
759
+ >(
760
+ keyPath: [K, K2, K3, K4],
761
+ value: S
762
+ ): this;
763
+ setIn<
764
+ K2: $KeyOf<V>,
765
+ K3: $KeyOf<$ValOf<V, K2>>,
766
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
767
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
768
+ S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
769
+ >(
770
+ keyPath: [K, K2, K3, K4, K5],
771
+ value: S
772
+ ): this;
773
+
774
+ deleteIn(keyPath: []): void;
775
+ deleteIn(keyPath: [K]): this;
776
+ deleteIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
777
+ deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
778
+ keyPath: [K, K2, K3]
779
+ ): this;
780
+ deleteIn<
781
+ K2: $KeyOf<V>,
782
+ K3: $KeyOf<$ValOf<V, K2>>,
783
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
784
+ >(
785
+ keyPath: [K, K2, K3, K4]
786
+ ): this;
787
+ deleteIn<
788
+ K2: $KeyOf<V>,
789
+ K3: $KeyOf<$ValOf<V, K2>>,
790
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
791
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
792
+ >(
793
+ keyPath: [K, K2, K3, K4, K5]
794
+ ): this;
795
+
796
+ removeIn(keyPath: []): void;
797
+ removeIn(keyPath: [K]): this;
798
+ removeIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
799
+ removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
800
+ keyPath: [K, K2, K3]
801
+ ): this;
802
+ removeIn<
803
+ K2: $KeyOf<V>,
804
+ K3: $KeyOf<$ValOf<V, K2>>,
805
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
806
+ >(
807
+ keyPath: [K, K2, K3, K4]
808
+ ): this;
809
+ removeIn<
810
+ K2: $KeyOf<V>,
811
+ K3: $KeyOf<$ValOf<V, K2>>,
812
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
813
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
814
+ >(
815
+ keyPath: [K, K2, K3, K4, K5]
816
+ ): this;
817
+
818
+ updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
819
+ updateIn<U>(keyPath: [], updater: (value: this) => U): U;
820
+ updateIn<NSV>(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this;
821
+ updateIn(keyPath: [K], updater: (value: V) => V): this;
822
+ updateIn<NSV, K2: $KeyOf<V>, S: $ValOf<V, K2>>(
823
+ keyPath: [K, K2],
824
+ notSetValue: NSV,
825
+ updater: (value: $ValOf<V, K2> | NSV) => S
826
+ ): this;
827
+ updateIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(
828
+ keyPath: [K, K2],
829
+ updater: (value: $ValOf<V, K2>) => S
830
+ ): this;
831
+ updateIn<
832
+ NSV,
833
+ K2: $KeyOf<V>,
834
+ K3: $KeyOf<$ValOf<V, K2>>,
835
+ S: $ValOf<$ValOf<V, K2>, K3>
836
+ >(
837
+ keyPath: [K, K2, K3],
838
+ notSetValue: NSV,
839
+ updater: (value: $ValOf<$ValOf<V, K2>, K3> | NSV) => S
840
+ ): this;
841
+ updateIn<
842
+ K2: $KeyOf<V>,
843
+ K3: $KeyOf<$ValOf<V, K2>>,
844
+ S: $ValOf<$ValOf<V, K2>, K3>
845
+ >(
846
+ keyPath: [K, K2, K3],
847
+ updater: (value: $ValOf<$ValOf<V, K2>, K3>) => S
848
+ ): this;
849
+ updateIn<
850
+ NSV,
851
+ K2: $KeyOf<V>,
852
+ K3: $KeyOf<$ValOf<V, K2>>,
853
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
854
+ S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
855
+ >(
856
+ keyPath: [K, K2, K3, K4],
857
+ notSetValue: NSV,
858
+ updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV) => S
859
+ ): this;
860
+ updateIn<
861
+ K2: $KeyOf<V>,
862
+ K3: $KeyOf<$ValOf<V, K2>>,
863
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
864
+ S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
865
+ >(
866
+ keyPath: [K, K2, K3, K4],
867
+ updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>) => S
868
+ ): this;
869
+ updateIn<
870
+ NSV,
871
+ K2: $KeyOf<V>,
872
+ K3: $KeyOf<$ValOf<V, K2>>,
873
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
874
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
875
+ S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
876
+ >(
877
+ keyPath: [K, K2, K3, K4, K5],
878
+ notSetValue: NSV,
879
+ updater: (
880
+ value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV
881
+ ) => S
882
+ ): this;
883
+ updateIn<
884
+ K2: $KeyOf<V>,
885
+ K3: $KeyOf<$ValOf<V, K2>>,
886
+ K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
887
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
888
+ S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
889
+ >(
890
+ keyPath: [K, K2, K3, K4, K5],
891
+ updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>) => S
892
+ ): this;
893
+ }
894
+
895
+ declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof
896
+ List);
897
+ declare class List<+T>
898
+ extends IndexedCollection<T>
899
+ mixins UpdatableInCollection<number, T>
900
+ {
646
901
  static (collection?: Iterable<T>): List<T>;
647
902
 
648
903
  static of<T>(...values: T[]): List<T>;
@@ -663,28 +918,22 @@ declare class List<+T> extends IndexedCollection<T> {
663
918
 
664
919
  update<U>(updater: (value: this) => U): U;
665
920
  update<U>(index: number, updater: (value: T) => U): List<T | U>;
666
- update<U>(index: number, notSetValue: U, updater: (value: T) => U): List<T | U>;
921
+ update<U>(
922
+ index: number,
923
+ notSetValue: U,
924
+ updater: (value: T) => U
925
+ ): List<T | U>;
667
926
 
668
927
  merge<U>(...collections: Iterable<U>[]): List<T | U>;
669
928
 
670
929
  setSize(size: number): this;
671
- setIn(keyPath: Iterable<mixed>, value: mixed): this;
672
- deleteIn(keyPath: Iterable<mixed>, value: mixed): this;
673
- removeIn(keyPath: Iterable<mixed>, value: mixed): this;
674
930
 
675
- updateIn(
676
- keyPath: Iterable<mixed>,
677
- notSetValue: mixed,
678
- updater: (value: any) => mixed
679
- ): this;
680
- updateIn(
931
+ mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
932
+ mergeDeepIn(
681
933
  keyPath: Iterable<mixed>,
682
- updater: (value: any) => mixed
934
+ ...collections: Iterable<mixed>[]
683
935
  ): this;
684
936
 
685
- mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
686
- mergeDeepIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
687
-
688
937
  withMutations(mutator: (mutable: this) => mixed): this;
689
938
  asMutable(): this;
690
939
  wasAltered(): boolean;
@@ -713,15 +962,8 @@ declare class List<+T> extends IndexedCollection<T> {
713
962
  flatten(depth?: number): List<any>;
714
963
  flatten(shallow?: boolean): List<any>;
715
964
 
716
- zip<A>(
717
- a: Iterable<A>,
718
- ..._: []
719
- ): List<[T, A]>;
720
- zip<A, B>(
721
- a: Iterable<A>,
722
- b: Iterable<B>,
723
- ..._: []
724
- ): List<[T, A, B]>;
965
+ zip<A>(a: Iterable<A>, ..._: []): List<[T, A]>;
966
+ zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): List<[T, A, B]>;
725
967
  zip<A, B, C>(
726
968
  a: Iterable<A>,
727
969
  b: Iterable<B>,
@@ -744,28 +986,25 @@ declare class List<+T> extends IndexedCollection<T> {
744
986
  ..._: []
745
987
  ): List<[T, A, B, C, D, E]>;
746
988
 
747
- zipAll<A>(
748
- a: Iterable<A>,
749
- ..._: []
750
- ): List<[T|void, A|void]>;
989
+ zipAll<A>(a: Iterable<A>, ..._: []): List<[T | void, A | void]>;
751
990
  zipAll<A, B>(
752
991
  a: Iterable<A>,
753
992
  b: Iterable<B>,
754
993
  ..._: []
755
- ): List<[T|void, A|void, B|void]>;
994
+ ): List<[T | void, A | void, B | void]>;
756
995
  zipAll<A, B, C>(
757
996
  a: Iterable<A>,
758
997
  b: Iterable<B>,
759
998
  c: Iterable<C>,
760
999
  ..._: []
761
- ): List<[T|void, A|void, B|void, C|void]>;
1000
+ ): List<[T | void, A | void, B | void, C | void]>;
762
1001
  zipAll<A, B, C, D>(
763
1002
  a: Iterable<A>,
764
1003
  b: Iterable<B>,
765
1004
  c: Iterable<C>,
766
1005
  d: Iterable<D>,
767
1006
  ..._: []
768
- ): List<[T|void, A|void, B|void, C|void, D|void]>;
1007
+ ): List<[T | void, A | void, B | void, C | void, D | void]>;
769
1008
  zipAll<A, B, C, D, E>(
770
1009
  a: Iterable<A>,
771
1010
  b: Iterable<B>,
@@ -773,7 +1012,7 @@ declare class List<+T> extends IndexedCollection<T> {
773
1012
  d: Iterable<D>,
774
1013
  e: Iterable<E>,
775
1014
  ..._: []
776
- ): List<[T|void, A|void, B|void, C|void, D|void, E|void]>;
1015
+ ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>;
777
1016
 
778
1017
  zipWith<A, R>(
779
1018
  zipper: (value: T, a: A) => R,
@@ -812,10 +1051,13 @@ declare class List<+T> extends IndexedCollection<T> {
812
1051
  ): List<R>;
813
1052
  }
814
1053
 
815
- declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof Map);
816
- declare class Map<K, +V> extends KeyedCollection<K, V> {
817
- static <K, V>(collection: Iterable<[K, V]>): Map<K, V>;
818
- static <K, V>(obj?: PlainObjInput<K, V>): Map<K, V>;
1054
+ declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof
1055
+ Map);
1056
+ declare class Map<K, +V>
1057
+ extends KeyedCollection<K, V>
1058
+ mixins UpdatableInCollection<K, V>
1059
+ {
1060
+ static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): Map<K, V>;
819
1061
 
820
1062
  static isMap: typeof isMap;
821
1063
 
@@ -831,11 +1073,18 @@ declare class Map<K, +V> extends KeyedCollection<K, V> {
831
1073
 
832
1074
  update<U>(updater: (value: this) => U): U;
833
1075
  update<V_>(key: K, updater: (value: V) => V_): Map<K, V | V_>;
834
- update<V_>(key: K, notSetValue: V_, updater: (value: V) => V_): Map<K, V | V_>;
1076
+ update<V_>(
1077
+ key: K,
1078
+ notSetValue: V_,
1079
+ updater: (value: V) => V_
1080
+ ): Map<K, V | V_>;
835
1081
 
836
1082
  merge<K_, V_>(
837
1083
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
838
1084
  ): Map<K | K_, V | V_>;
1085
+ concat<K_, V_>(
1086
+ ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
1087
+ ): Map<K | K_, V | V_>;
839
1088
 
840
1089
  mergeWith<K_, W, X>(
841
1090
  merger: (oldVal: V, newVal: W, key: K) => X,
@@ -846,24 +1095,10 @@ declare class Map<K, +V> extends KeyedCollection<K, V> {
846
1095
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
847
1096
  ): Map<K | K_, V | V_>;
848
1097
 
849
- mergeDeepWith<K_, W, X>(
850
- merger: (oldVal: V, newVal: W, key: K) => X,
851
- ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
852
- ): Map<K | K_, V | W | X>;
853
-
854
- setIn(keyPath: Iterable<mixed>, value: mixed): this;
855
- deleteIn(keyPath: Iterable<mixed>, value: mixed): this;
856
- removeIn(keyPath: Iterable<mixed>, value: mixed): this;
857
-
858
- updateIn(
859
- keyPath: Iterable<mixed>,
860
- notSetValue: mixed,
861
- updater: (value: any) => mixed
862
- ): this;
863
- updateIn(
864
- keyPath: Iterable<mixed>,
865
- updater: (value: any) => mixed
866
- ): this;
1098
+ mergeDeepWith<K_, V_>(
1099
+ merger: (oldVal: any, newVal: any, key: any) => mixed,
1100
+ ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
1101
+ ): Map<K | K_, V | V_>;
867
1102
 
868
1103
  mergeIn(
869
1104
  keyPath: Iterable<mixed>,
@@ -883,9 +1118,6 @@ declare class Map<K, +V> extends KeyedCollection<K, V> {
883
1118
 
884
1119
  flip(): Map<V, K>;
885
1120
 
886
- concat<KC, VC>(...iters: Array<Iterable<[KC, VC]>>): Map<K | KC, V | VC>;
887
- concat<KC, VC>(...iters: Array<PlainObjInput<KC, VC>>): Map<K | KC, V | VC>;
888
-
889
1121
  filter(predicate: typeof Boolean): Map<K, $NonMaybeType<V>>;
890
1122
  filter(
891
1123
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -916,10 +1148,16 @@ declare class Map<K, +V> extends KeyedCollection<K, V> {
916
1148
  flatten(shallow?: boolean): Map<any, any>;
917
1149
  }
918
1150
 
919
- declare function isOrderedMap(maybeOrderedMap: mixed): boolean %checks(maybeOrderedMap instanceof OrderedMap);
920
- declare class OrderedMap<K, +V> extends Map<K, V> {
921
- static <K, V>(collection: Iterable<[K, V]>): OrderedMap<K, V>;
922
- static <K, V>(obj?: PlainObjInput<K, V>): OrderedMap<K, V>;
1151
+ declare function isOrderedMap(
1152
+ maybeOrderedMap: mixed
1153
+ ): boolean %checks(maybeOrderedMap instanceof OrderedMap);
1154
+ declare class OrderedMap<K, +V>
1155
+ extends Map<K, V>
1156
+ mixins UpdatableInCollection<K, V>
1157
+ {
1158
+ static <K, V>(
1159
+ values?: Iterable<[K, V]> | PlainObjInput<K, V>
1160
+ ): OrderedMap<K, V>;
923
1161
 
924
1162
  static isOrderedMap: typeof isOrderedMap;
925
1163
 
@@ -932,11 +1170,18 @@ declare class OrderedMap<K, +V> extends Map<K, V> {
932
1170
 
933
1171
  update<U>(updater: (value: this) => U): U;
934
1172
  update<V_>(key: K, updater: (value: V) => V_): OrderedMap<K, V | V_>;
935
- update<V_>(key: K, notSetValue: V_, updater: (value: V) => V_): OrderedMap<K, V | V_>;
1173
+ update<V_>(
1174
+ key: K,
1175
+ notSetValue: V_,
1176
+ updater: (value: V) => V_
1177
+ ): OrderedMap<K, V | V_>;
936
1178
 
937
1179
  merge<K_, V_>(
938
1180
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
939
1181
  ): OrderedMap<K | K_, V | V_>;
1182
+ concat<K_, V_>(
1183
+ ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
1184
+ ): OrderedMap<K | K_, V | V_>;
940
1185
 
941
1186
  mergeWith<K_, W, X>(
942
1187
  merger: (oldVal: V, newVal: W, key: K) => X,
@@ -947,24 +1192,10 @@ declare class OrderedMap<K, +V> extends Map<K, V> {
947
1192
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
948
1193
  ): OrderedMap<K | K_, V | V_>;
949
1194
 
950
- mergeDeepWith<K_, W, X>(
951
- merger: (oldVal: V, newVal: W, key: K) => X,
952
- ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
953
- ): OrderedMap<K | K_, V | W | X>;
954
-
955
- setIn(keyPath: Iterable<mixed>, value: mixed): this;
956
- deleteIn(keyPath: Iterable<mixed>, value: mixed): this;
957
- removeIn(keyPath: Iterable<mixed>, value: mixed): this;
958
-
959
- updateIn(
960
- keyPath: Iterable<mixed>,
961
- notSetValue: mixed,
962
- updater: (value: any) => mixed
963
- ): this;
964
- updateIn(
965
- keyPath: Iterable<mixed>,
966
- updater: (value: any) => mixed
967
- ): this;
1195
+ mergeDeepWith<K_, V_>(
1196
+ merger: (oldVal: any, newVal: any, key: any) => mixed,
1197
+ ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
1198
+ ): OrderedMap<K | K_, V | V_>;
968
1199
 
969
1200
  mergeIn(
970
1201
  keyPath: Iterable<mixed>,
@@ -984,9 +1215,6 @@ declare class OrderedMap<K, +V> extends Map<K, V> {
984
1215
 
985
1216
  flip(): OrderedMap<V, K>;
986
1217
 
987
- concat<KC, VC>(...iters: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
988
- concat<KC, VC>(...iters: Array<PlainObjInput<KC, VC>>): OrderedMap<K | KC, V | VC>;
989
-
990
1218
  filter(predicate: typeof Boolean): OrderedMap<K, $NonMaybeType<V>>;
991
1219
  filter(
992
1220
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -1017,13 +1245,15 @@ declare class OrderedMap<K, +V> extends Map<K, V> {
1017
1245
  flatten(shallow?: boolean): OrderedMap<any, any>;
1018
1246
  }
1019
1247
 
1020
- declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof Set);
1248
+ declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof
1249
+ Set);
1021
1250
  declare class Set<+T> extends SetCollection<T> {
1022
- static <T>(collection?: Iterable<T>): Set<T>;
1251
+ static <T>(values?: Iterable<T>): Set<T>;
1023
1252
 
1024
1253
  static of<T>(...values: T[]): Set<T>;
1025
- static fromKeys<T>(iter: Iterable<[T, mixed]>): Set<T>;
1026
- static fromKeys<K>(object: PlainObjInput<K, mixed>): Set<K>;
1254
+ static fromKeys<T>(
1255
+ values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
1256
+ ): Set<T>;
1027
1257
 
1028
1258
  static intersect(sets: Iterable<Iterable<T>>): Set<T>;
1029
1259
  static union(sets: Iterable<Iterable<T>>): Set<T>;
@@ -1038,6 +1268,7 @@ declare class Set<+T> extends SetCollection<T> {
1038
1268
  clear(): this;
1039
1269
  union<U>(...collections: Iterable<U>[]): Set<T | U>;
1040
1270
  merge<U>(...collections: Iterable<U>[]): Set<T | U>;
1271
+ concat<U>(...collections: Iterable<U>[]): Set<T | U>;
1041
1272
  intersect<U>(...collections: Iterable<U>[]): Set<T & U>;
1042
1273
  subtract(...collections: Iterable<mixed>[]): this;
1043
1274
 
@@ -1048,8 +1279,6 @@ declare class Set<+T> extends SetCollection<T> {
1048
1279
 
1049
1280
  // Override specialized return types
1050
1281
 
1051
- concat<C>(...iters: Array<Iterable<C> | C>): Set<T | C>;
1052
-
1053
1282
  filter(predicate: typeof Boolean): Set<$NonMaybeType<T>>;
1054
1283
  filter(
1055
1284
  predicate: (value: T, value: T, iter: this) => mixed,
@@ -1071,14 +1300,16 @@ declare class Set<+T> extends SetCollection<T> {
1071
1300
  }
1072
1301
 
1073
1302
  // Overrides except for `isOrderedSet` are for specialized return types
1074
- declare function isOrderedSet(maybeOrderedSet: mixed): boolean %checks(maybeOrderedSet instanceof OrderedSet);
1303
+ declare function isOrderedSet(
1304
+ maybeOrderedSet: mixed
1305
+ ): boolean %checks(maybeOrderedSet instanceof OrderedSet);
1075
1306
  declare class OrderedSet<+T> extends Set<T> {
1076
- static <T>(collection: Iterable<T>): OrderedSet<T>;
1077
- static (_: void): OrderedSet<any>;
1307
+ static <T>(values?: Iterable<T>): OrderedSet<T>;
1078
1308
 
1079
1309
  static of<T>(...values: T[]): OrderedSet<T>;
1080
- static fromKeys<T>(iter: Iterable<[T, mixed]>): OrderedSet<T>;
1081
- static fromKeys<K>(object: PlainObjInput<K, mixed>): OrderedSet<K>;
1310
+ static fromKeys<T>(
1311
+ values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
1312
+ ): OrderedSet<T>;
1082
1313
 
1083
1314
  static isOrderedSet: typeof isOrderedSet;
1084
1315
 
@@ -1087,10 +1318,9 @@ declare class OrderedSet<+T> extends Set<T> {
1087
1318
  add<U>(value: U): OrderedSet<T | U>;
1088
1319
  union<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
1089
1320
  merge<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
1321
+ concat<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
1090
1322
  intersect<U>(...collections: Iterable<U>[]): OrderedSet<T & U>;
1091
1323
 
1092
- concat<C>(...iters: Array<Iterable<C> | C>): OrderedSet<T | C>;
1093
-
1094
1324
  filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType<T>>;
1095
1325
  filter(
1096
1326
  predicate: (value: T, value: T, iter: this) => mixed,
@@ -1110,15 +1340,8 @@ declare class OrderedSet<+T> extends Set<T> {
1110
1340
  flatten(depth?: number): OrderedSet<any>;
1111
1341
  flatten(shallow?: boolean): OrderedSet<any>;
1112
1342
 
1113
- zip<A>(
1114
- a: Iterable<A>,
1115
- ..._: []
1116
- ): OrderedSet<[T, A]>;
1117
- zip<A, B>(
1118
- a: Iterable<A>,
1119
- b: Iterable<B>,
1120
- ..._: []
1121
- ): OrderedSet<[T, A, B]>;
1343
+ zip<A>(a: Iterable<A>, ..._: []): OrderedSet<[T, A]>;
1344
+ zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): OrderedSet<[T, A, B]>;
1122
1345
  zip<A, B, C>(
1123
1346
  a: Iterable<A>,
1124
1347
  b: Iterable<B>,
@@ -1141,28 +1364,25 @@ declare class OrderedSet<+T> extends Set<T> {
1141
1364
  ..._: []
1142
1365
  ): OrderedSet<[T, A, B, C, D, E]>;
1143
1366
 
1144
- zipAll<A>(
1145
- a: Iterable<A>,
1146
- ..._: []
1147
- ): OrderedSet<[T|void, A|void]>;
1367
+ zipAll<A>(a: Iterable<A>, ..._: []): OrderedSet<[T | void, A | void]>;
1148
1368
  zipAll<A, B>(
1149
1369
  a: Iterable<A>,
1150
1370
  b: Iterable<B>,
1151
1371
  ..._: []
1152
- ): OrderedSet<[T|void, A|void, B|void]>;
1372
+ ): OrderedSet<[T | void, A | void, B | void]>;
1153
1373
  zipAll<A, B, C>(
1154
1374
  a: Iterable<A>,
1155
1375
  b: Iterable<B>,
1156
1376
  c: Iterable<C>,
1157
1377
  ..._: []
1158
- ): OrderedSet<[T|void, A|void, B|void, C|void]>;
1378
+ ): OrderedSet<[T | void, A | void, B | void, C | void]>;
1159
1379
  zipAll<A, B, C, D>(
1160
1380
  a: Iterable<A>,
1161
1381
  b: Iterable<B>,
1162
1382
  c: Iterable<C>,
1163
1383
  d: Iterable<D>,
1164
1384
  ..._: []
1165
- ): OrderedSet<[T|void, A|void, B|void, C|void, D|void]>;
1385
+ ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>;
1166
1386
  zipAll<A, B, C, D, E>(
1167
1387
  a: Iterable<A>,
1168
1388
  b: Iterable<B>,
@@ -1170,7 +1390,7 @@ declare class OrderedSet<+T> extends Set<T> {
1170
1390
  d: Iterable<D>,
1171
1391
  e: Iterable<E>,
1172
1392
  ..._: []
1173
- ): OrderedSet<[T|void, A|void, B|void, C|void, D|void, E|void]>;
1393
+ ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>;
1174
1394
 
1175
1395
  zipWith<A, R>(
1176
1396
  zipper: (value: T, a: A) => R,
@@ -1209,7 +1429,9 @@ declare class OrderedSet<+T> extends Set<T> {
1209
1429
  ): OrderedSet<R>;
1210
1430
  }
1211
1431
 
1212
- declare function isStack(maybeStack: mixed): boolean %checks(maybeStack instanceof Stack);
1432
+ declare function isStack(
1433
+ maybeStack: mixed
1434
+ ): boolean %checks(maybeStack instanceof Stack);
1213
1435
  declare class Stack<+T> extends IndexedCollection<T> {
1214
1436
  static <T>(collection?: Iterable<T>): Stack<T>;
1215
1437
 
@@ -1257,15 +1479,8 @@ declare class Stack<+T> extends IndexedCollection<T> {
1257
1479
  flatten(depth?: number): Stack<any>;
1258
1480
  flatten(shallow?: boolean): Stack<any>;
1259
1481
 
1260
- zip<A>(
1261
- a: Iterable<A>,
1262
- ..._: []
1263
- ): Stack<[T, A]>;
1264
- zip<A, B>(
1265
- a: Iterable<A>,
1266
- b: Iterable<B>,
1267
- ..._: []
1268
- ): Stack<[T, A, B]>;
1482
+ zip<A>(a: Iterable<A>, ..._: []): Stack<[T, A]>;
1483
+ zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): Stack<[T, A, B]>;
1269
1484
  zip<A, B, C>(
1270
1485
  a: Iterable<A>,
1271
1486
  b: Iterable<B>,
@@ -1288,28 +1503,25 @@ declare class Stack<+T> extends IndexedCollection<T> {
1288
1503
  ..._: []
1289
1504
  ): Stack<[T, A, B, C, D, E]>;
1290
1505
 
1291
- zipAll<A>(
1292
- a: Iterable<A>,
1293
- ..._: []
1294
- ): Stack<[T|void, A|void]>;
1506
+ zipAll<A>(a: Iterable<A>, ..._: []): Stack<[T | void, A | void]>;
1295
1507
  zipAll<A, B>(
1296
1508
  a: Iterable<A>,
1297
1509
  b: Iterable<B>,
1298
1510
  ..._: []
1299
- ): Stack<[T|void, A|void, B|void]>;
1511
+ ): Stack<[T | void, A | void, B | void]>;
1300
1512
  zipAll<A, B, C>(
1301
1513
  a: Iterable<A>,
1302
1514
  b: Iterable<B>,
1303
1515
  c: Iterable<C>,
1304
1516
  ..._: []
1305
- ): Stack<[T|void, A|void, B|void, C|void]>;
1517
+ ): Stack<[T | void, A | void, B | void, C | void]>;
1306
1518
  zipAll<A, B, C, D>(
1307
1519
  a: Iterable<A>,
1308
1520
  b: Iterable<B>,
1309
1521
  c: Iterable<C>,
1310
1522
  d: Iterable<D>,
1311
1523
  ..._: []
1312
- ): Stack<[T|void, A|void, B|void, C|void, D|void]>;
1524
+ ): Stack<[T | void, A | void, B | void, C | void, D | void]>;
1313
1525
  zipAll<A, B, C, D, E>(
1314
1526
  a: Iterable<A>,
1315
1527
  b: Iterable<B>,
@@ -1317,7 +1529,7 @@ declare class Stack<+T> extends IndexedCollection<T> {
1317
1529
  d: Iterable<D>,
1318
1530
  e: Iterable<E>,
1319
1531
  ..._: []
1320
- ): Stack<[T|void, A|void, B|void, C|void, D|void, E|void]>;
1532
+ ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>;
1321
1533
 
1322
1534
  zipWith<A, R>(
1323
1535
  zipper: (value: T, a: A) => R,
@@ -1356,66 +1568,328 @@ declare class Stack<+T> extends IndexedCollection<T> {
1356
1568
  ): Stack<R>;
1357
1569
  }
1358
1570
 
1359
- declare function Range(start?: number, end?: number, step?: number): IndexedSeq<number>;
1571
+ declare function Range(
1572
+ start?: number,
1573
+ end?: number,
1574
+ step?: number
1575
+ ): IndexedSeq<number>;
1360
1576
  declare function Repeat<T>(value: T, times?: number): IndexedSeq<T>;
1361
1577
 
1362
1578
  // The type of a Record factory function.
1363
1579
  type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
1364
1580
 
1365
1581
  // The type of runtime Record instances.
1366
- type RecordOf<Values: Object> = RecordInstance<Values> & Values;
1582
+ type RecordOf<Values: Object> = RecordInstance<Values> & $ReadOnly<Values>;
1367
1583
 
1368
- declare function isRecord(maybeRecord: any): boolean %checks(maybeRecord instanceof RecordInstance);
1584
+ // The values of a Record instance.
1585
+ type _RecordValues<T, R: RecordInstance<T> | T> = R;
1586
+ type RecordValues<R> = _RecordValues<*, R>;
1587
+
1588
+ declare function isRecord(
1589
+ maybeRecord: any
1590
+ ): boolean %checks(maybeRecord instanceof RecordInstance);
1369
1591
  declare class Record {
1370
- static <Values: Object>(spec: Values, name?: string): RecordFactory<Values>;
1371
- constructor<Values: Object>(spec: Values, name?: string): RecordFactory<Values>;
1592
+ static <Values: Object>(spec: Values, name?: string): typeof RecordInstance;
1593
+ constructor<Values: Object>(
1594
+ spec: Values,
1595
+ name?: string
1596
+ ): typeof RecordInstance;
1372
1597
 
1373
1598
  static isRecord: typeof isRecord;
1374
1599
 
1375
1600
  static getDescriptiveName(record: RecordInstance<any>): string;
1376
1601
  }
1377
1602
 
1378
- declare class RecordInstance<T: Object> {
1379
- static (values?: $Shape<T> | Iterable<[string, any]>): RecordOf<T>;
1603
+ declare class RecordInstance<T: Object = Object> {
1604
+ static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>;
1380
1605
  // Note: a constructor can only create an instance of RecordInstance<T>,
1381
1606
  // it's encouraged to not use `new` when creating Records.
1382
- constructor (values?: $Shape<T> | Iterable<[string, any]>): void;
1607
+ constructor(values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
1383
1608
 
1384
1609
  size: number;
1385
1610
 
1386
1611
  has(key: string): boolean;
1387
- get<K: $Keys<T>>(key: K): $ElementType<T, K>;
1612
+
1613
+ get<K: $Keys<T>>(key: K, ..._: []): $ElementType<T, K>;
1614
+ get<K: $Keys<T>, NSV>(key: K, notSetValue: NSV): $ElementType<T, K> | NSV;
1388
1615
 
1389
1616
  hasIn(keyPath: Iterable<mixed>): boolean;
1390
- getIn(keyPath: Iterable<mixed>, notSetValue?: mixed): any;
1617
+
1618
+ getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly<T>;
1619
+ getIn<K: $Keys<T>>(keyPath: [K], notSetValue?: mixed): $ElementType<T, K>;
1620
+ getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
1621
+ keyPath: [K, K2],
1622
+ notSetValue: NSV
1623
+ ): $ValOf<$ValOf<T, K>, K2> | NSV;
1624
+ getIn<
1625
+ NSV,
1626
+ K: $Keys<T>,
1627
+ K2: $KeyOf<$ValOf<T, K>>,
1628
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
1629
+ >(
1630
+ keyPath: [K, K2, K3],
1631
+ notSetValue: NSV
1632
+ ): $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV;
1633
+ getIn<
1634
+ NSV,
1635
+ K: $Keys<T>,
1636
+ K2: $KeyOf<$ValOf<T, K>>,
1637
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1638
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
1639
+ >(
1640
+ keyPath: [K, K2, K3, K4],
1641
+ notSetValue: NSV
1642
+ ): $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV;
1643
+ getIn<
1644
+ NSV,
1645
+ K: $Keys<T>,
1646
+ K2: $KeyOf<$ValOf<T, K>>,
1647
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1648
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1649
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
1650
+ >(
1651
+ keyPath: [K, K2, K3, K4, K5],
1652
+ notSetValue: NSV
1653
+ ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV;
1391
1654
 
1392
1655
  equals(other: any): boolean;
1393
1656
  hashCode(): number;
1394
1657
 
1395
- set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & T;
1396
- update<K: $Keys<T>>(key: K, updater: (value: $ElementType<T, K>) => $ElementType<T, K>): this & T;
1397
- merge(...collections: Array<$Shape<T> | Iterable<[string, any]>>): this & T;
1398
- mergeDeep(...collections: Array<$Shape<T> | Iterable<[string, any]>>): this & T;
1658
+ set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & $ReadOnly<T>;
1659
+ update<K: $Keys<T>>(
1660
+ key: K,
1661
+ updater: (value: $ElementType<T, K>) => $ElementType<T, K>
1662
+ ): this & $ReadOnly<T>;
1663
+ merge(
1664
+ ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1665
+ ): this & $ReadOnly<T>;
1666
+ mergeDeep(
1667
+ ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1668
+ ): this & $ReadOnly<T>;
1399
1669
 
1400
1670
  mergeWith(
1401
- merger: (oldVal: any, newVal: any, key: $Keys<T>) => any,
1402
- ...collections: Array<$Shape<T> | Iterable<[string, any]>>
1403
- ): this & T;
1671
+ merger: (oldVal: $ValOf<T>, newVal: $ValOf<T>, key: $Keys<T>) => $ValOf<T>,
1672
+ ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1673
+ ): this & $ReadOnly<T>;
1404
1674
  mergeDeepWith(
1405
1675
  merger: (oldVal: any, newVal: any, key: any) => any,
1406
- ...collections: Array<$Shape<T> | Iterable<[string, any]>>
1407
- ): this & T;
1408
-
1409
- delete<K: $Keys<T>>(key: K): this & T;
1410
- remove<K: $Keys<T>>(key: K): this & T;
1411
- clear(): this & T;
1676
+ ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1677
+ ): this & $ReadOnly<T>;
1678
+
1679
+ delete<K: $Keys<T>>(key: K): this & $ReadOnly<T>;
1680
+ remove<K: $Keys<T>>(key: K): this & $ReadOnly<T>;
1681
+ clear(): this & $ReadOnly<T>;
1682
+
1683
+ setIn<S>(keyPath: [], value: S): S;
1684
+ setIn<K: $Keys<T>, S: $ValOf<T, K>>(
1685
+ keyPath: [K],
1686
+ value: S
1687
+ ): this & $ReadOnly<T>;
1688
+ setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(
1689
+ keyPath: [K, K2],
1690
+ value: S
1691
+ ): this & $ReadOnly<T>;
1692
+ setIn<
1693
+ K: $Keys<T>,
1694
+ K2: $KeyOf<$ValOf<T, K>>,
1695
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1696
+ S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
1697
+ >(
1698
+ keyPath: [K, K2, K3],
1699
+ value: S
1700
+ ): this & $ReadOnly<T>;
1701
+ setIn<
1702
+ K: $Keys<T>,
1703
+ K2: $KeyOf<$ValOf<T, K>>,
1704
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1705
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1706
+ S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
1707
+ >(
1708
+ keyPath: [K, K2, K3, K4],
1709
+ value: S
1710
+ ): this & $ReadOnly<T>;
1711
+ setIn<
1712
+ K: $Keys<T>,
1713
+ K2: $KeyOf<$ValOf<T, K>>,
1714
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1715
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1716
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
1717
+ S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
1718
+ >(
1719
+ keyPath: [K, K2, K3, K4, K5],
1720
+ value: S
1721
+ ): this & $ReadOnly<T>;
1722
+
1723
+ deleteIn(keyPath: []): void;
1724
+ deleteIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>;
1725
+ deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
1726
+ keyPath: [K, K2]
1727
+ ): this & $ReadOnly<T>;
1728
+ deleteIn<
1729
+ K: $Keys<T>,
1730
+ K2: $KeyOf<$ValOf<T, K>>,
1731
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
1732
+ >(
1733
+ keyPath: [K, K2, K3]
1734
+ ): this & $ReadOnly<T>;
1735
+ deleteIn<
1736
+ K: $Keys<T>,
1737
+ K2: $KeyOf<$ValOf<T, K>>,
1738
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1739
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
1740
+ >(
1741
+ keyPath: [K, K2, K3, K4]
1742
+ ): this & $ReadOnly<T>;
1743
+ deleteIn<
1744
+ K: $Keys<T>,
1745
+ K2: $KeyOf<$ValOf<T, K>>,
1746
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1747
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1748
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
1749
+ >(
1750
+ keyPath: [K, K2, K3, K4, K5]
1751
+ ): this & $ReadOnly<T>;
1752
+
1753
+ removeIn(keyPath: []): void;
1754
+ removeIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>;
1755
+ removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
1756
+ keyPath: [K, K2]
1757
+ ): this & $ReadOnly<T>;
1758
+ removeIn<
1759
+ K: $Keys<T>,
1760
+ K2: $KeyOf<$ValOf<T, K>>,
1761
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
1762
+ >(
1763
+ keyPath: [K, K2, K3]
1764
+ ): this & $ReadOnly<T>;
1765
+ removeIn<
1766
+ K: $Keys<T>,
1767
+ K2: $KeyOf<$ValOf<T, K>>,
1768
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1769
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
1770
+ >(
1771
+ keyPath: [K, K2, K3, K4]
1772
+ ): this & $ReadOnly<T>;
1773
+ removeIn<
1774
+ K: $Keys<T>,
1775
+ K2: $KeyOf<$ValOf<T, K>>,
1776
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1777
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1778
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
1779
+ >(
1780
+ keyPath: [K, K2, K3, K4, K5]
1781
+ ): this & $ReadOnly<T>;
1782
+
1783
+ updateIn<U>(
1784
+ keyPath: [],
1785
+ notSetValue: mixed,
1786
+ updater: (value: this & T) => U
1787
+ ): U;
1788
+ updateIn<U>(keyPath: [], updater: (value: this & T) => U): U;
1789
+ updateIn<NSV, K: $Keys<T>, S: $ValOf<T, K>>(
1790
+ keyPath: [K],
1791
+ notSetValue: NSV,
1792
+ updater: (value: $ValOf<T, K>) => S
1793
+ ): this & $ReadOnly<T>;
1794
+ updateIn<K: $Keys<T>, S: $ValOf<T, K>>(
1795
+ keyPath: [K],
1796
+ updater: (value: $ValOf<T, K>) => S
1797
+ ): this & $ReadOnly<T>;
1798
+ updateIn<
1799
+ NSV,
1800
+ K: $Keys<T>,
1801
+ K2: $KeyOf<$ValOf<T, K>>,
1802
+ S: $ValOf<$ValOf<T, K>, K2>
1803
+ >(
1804
+ keyPath: [K, K2],
1805
+ notSetValue: NSV,
1806
+ updater: (value: $ValOf<$ValOf<T, K>, K2> | NSV) => S
1807
+ ): this & $ReadOnly<T>;
1808
+ updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(
1809
+ keyPath: [K, K2],
1810
+ updater: (value: $ValOf<$ValOf<T, K>, K2>) => S
1811
+ ): this & $ReadOnly<T>;
1812
+ updateIn<
1813
+ NSV,
1814
+ K: $Keys<T>,
1815
+ K2: $KeyOf<$ValOf<T, K>>,
1816
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1817
+ S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
1818
+ >(
1819
+ keyPath: [K, K2, K3],
1820
+ notSetValue: NSV,
1821
+ updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV) => S
1822
+ ): this & $ReadOnly<T>;
1823
+ updateIn<
1824
+ K: $Keys<T>,
1825
+ K2: $KeyOf<$ValOf<T, K>>,
1826
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1827
+ S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
1828
+ >(
1829
+ keyPath: [K, K2, K3],
1830
+ updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>) => S
1831
+ ): this & $ReadOnly<T>;
1832
+ updateIn<
1833
+ NSV,
1834
+ K: $Keys<T>,
1835
+ K2: $KeyOf<$ValOf<T, K>>,
1836
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1837
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1838
+ S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
1839
+ >(
1840
+ keyPath: [K, K2, K3, K4],
1841
+ notSetValue: NSV,
1842
+ updater: (
1843
+ value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV
1844
+ ) => S
1845
+ ): this & $ReadOnly<T>;
1846
+ updateIn<
1847
+ K: $Keys<T>,
1848
+ K2: $KeyOf<$ValOf<T, K>>,
1849
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1850
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1851
+ S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
1852
+ >(
1853
+ keyPath: [K, K2, K3, K4],
1854
+ updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>) => S
1855
+ ): this & $ReadOnly<T>;
1856
+ updateIn<
1857
+ NSV,
1858
+ K: $Keys<T>,
1859
+ K2: $KeyOf<$ValOf<T, K>>,
1860
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1861
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1862
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
1863
+ S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
1864
+ >(
1865
+ keyPath: [K, K2, K3, K4, K5],
1866
+ notSetValue: NSV,
1867
+ updater: (
1868
+ value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV
1869
+ ) => S
1870
+ ): this & $ReadOnly<T>;
1871
+ updateIn<
1872
+ K: $Keys<T>,
1873
+ K2: $KeyOf<$ValOf<T, K>>,
1874
+ K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
1875
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
1876
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
1877
+ S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
1878
+ >(
1879
+ keyPath: [K, K2, K3, K4, K5],
1880
+ updater: (
1881
+ value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
1882
+ ) => S
1883
+ ): this & $ReadOnly<T>;
1412
1884
 
1413
- setIn(keyPath: Iterable<mixed>, value: any): this & T;
1414
- updateIn(keyPath: Iterable<mixed>, updater: (value: any) => any): this & T;
1415
- mergeIn(keyPath: Iterable<mixed>, ...collections: Array<any>): this & T;
1416
- mergeDeepIn(keyPath: Iterable<mixed>, ...collections: Array<any>): this & T;
1417
- deleteIn(keyPath: Iterable<mixed>): this & T;
1418
- removeIn(keyPath: Iterable<mixed>): this & T;
1885
+ mergeIn(
1886
+ keyPath: Iterable<mixed>,
1887
+ ...collections: Array<any>
1888
+ ): this & $ReadOnly<T>;
1889
+ mergeDeepIn(
1890
+ keyPath: Iterable<mixed>,
1891
+ ...collections: Array<any>
1892
+ ): this & $ReadOnly<T>;
1419
1893
 
1420
1894
  toSeq(): KeyedSeq<$Keys<T>, any>;
1421
1895
 
@@ -1423,12 +1897,12 @@ declare class RecordInstance<T: Object> {
1423
1897
  toJSON(): T;
1424
1898
  toObject(): T;
1425
1899
 
1426
- withMutations(mutator: (mutable: this) => mixed): this & T;
1427
- asMutable(): this & T;
1900
+ withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly<T>;
1901
+ asMutable(): this & $ReadOnly<T>;
1428
1902
  wasAltered(): boolean;
1429
- asImmutable(): this & T;
1903
+ asImmutable(): this & $ReadOnly<T>;
1430
1904
 
1431
- @@iterator(): Iterator<[$Keys<T>, any]>;
1905
+ @@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;
1432
1906
  }
1433
1907
 
1434
1908
  declare function fromJS(
@@ -1438,15 +1912,346 @@ declare function fromJS(
1438
1912
  sequence: KeyedCollection<string, mixed> | IndexedCollection<mixed>,
1439
1913
  path?: Array<string | number>
1440
1914
  ) => mixed
1441
- ): mixed;
1915
+ ): Collection<mixed, mixed>;
1442
1916
 
1443
1917
  declare function is(first: mixed, second: mixed): boolean;
1444
1918
  declare function hash(value: mixed): number;
1445
1919
 
1920
+ declare function get<C: Object, K: $Keys<C>>(
1921
+ collection: C,
1922
+ key: K,
1923
+ notSetValue: mixed
1924
+ ): $ValOf<C, K>;
1925
+ declare function get<C, K: $KeyOf<C>, NSV>(
1926
+ collection: C,
1927
+ key: K,
1928
+ notSetValue: NSV
1929
+ ): $ValOf<C, K> | NSV;
1930
+
1931
+ declare function has(collection: Object, key: mixed): boolean;
1932
+ declare function remove<C>(collection: C, key: $KeyOf<C>): C;
1933
+ declare function set<C, K: $KeyOf<C>, V: $ValOf<C, K>>(
1934
+ collection: C,
1935
+ key: K,
1936
+ value: V
1937
+ ): C;
1938
+ declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>, NSV>(
1939
+ collection: C,
1940
+ key: K,
1941
+ notSetValue: NSV,
1942
+ updater: ($ValOf<C, K> | NSV) => V
1943
+ ): C;
1944
+ declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>>(
1945
+ collection: C,
1946
+ key: K,
1947
+ updater: ($ValOf<C, K>) => V
1948
+ ): C;
1949
+
1950
+ declare function getIn<C>(collection: C, keyPath: [], notSetValue?: mixed): C;
1951
+ declare function getIn<C, K: $KeyOf<C>, NSV>(
1952
+ collection: C,
1953
+ keyPath: [K],
1954
+ notSetValue: NSV
1955
+ ): $ValOf<C, K> | NSV;
1956
+ declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, NSV>(
1957
+ collection: C,
1958
+ keyPath: [K, K2],
1959
+ notSetValue: NSV
1960
+ ): $ValOf<$ValOf<C, K>, K2> | NSV;
1961
+ declare function getIn<
1962
+ C,
1963
+ K: $KeyOf<C>,
1964
+ K2: $KeyOf<$ValOf<C, K>>,
1965
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
1966
+ NSV
1967
+ >(
1968
+ collection: C,
1969
+ keyPath: [K, K2, K3],
1970
+ notSetValue: NSV
1971
+ ): $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV;
1972
+ declare function getIn<
1973
+ C,
1974
+ K: $KeyOf<C>,
1975
+ K2: $KeyOf<$ValOf<C, K>>,
1976
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
1977
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
1978
+ NSV
1979
+ >(
1980
+ collection: C,
1981
+ keyPath: [K, K2, K3, K4],
1982
+ notSetValue: NSV
1983
+ ): $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV;
1984
+ declare function getIn<
1985
+ C,
1986
+ K: $KeyOf<C>,
1987
+ K2: $KeyOf<$ValOf<C, K>>,
1988
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
1989
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
1990
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
1991
+ NSV
1992
+ >(
1993
+ collection: C,
1994
+ keyPath: [K, K2, K3, K4, K5],
1995
+ notSetValue: NSV
1996
+ ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV;
1997
+
1998
+ declare function hasIn(collection: Object, keyPath: Iterable<mixed>): boolean;
1999
+
2000
+ declare function removeIn<C>(collection: C, keyPath: []): void;
2001
+ declare function removeIn<C, K: $KeyOf<C>>(collection: C, keyPath: [K]): C;
2002
+ declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>>(
2003
+ collection: C,
2004
+ keyPath: [K, K2]
2005
+ ): C;
2006
+ declare function removeIn<
2007
+ C,
2008
+ K: $KeyOf<C>,
2009
+ K2: $KeyOf<$ValOf<C>>,
2010
+ K3: $KeyOf<$ValOf<$ValOf<C>, K2>>
2011
+ >(
2012
+ collection: C,
2013
+ keyPath: [K, K2, K3]
2014
+ ): C;
2015
+ declare function removeIn<
2016
+ C,
2017
+ K: $KeyOf<C>,
2018
+ K2: $KeyOf<$ValOf<C>>,
2019
+ K3: $KeyOf<$ValOf<$ValOf<C>, K2>>,
2020
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>>
2021
+ >(
2022
+ collection: C,
2023
+ keyPath: [K, K2, K3, K4]
2024
+ ): C;
2025
+ declare function removeIn<
2026
+ C,
2027
+ K: $KeyOf<C>,
2028
+ K2: $KeyOf<$ValOf<C>>,
2029
+ K3: $KeyOf<$ValOf<$ValOf<C>, K2>>,
2030
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>>,
2031
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>, K4>>
2032
+ >(
2033
+ collection: C,
2034
+ keyPath: [K, K2, K3, K4, K5]
2035
+ ): C;
2036
+
2037
+ declare function setIn<S>(collection: Object, keyPath: [], value: S): S;
2038
+ declare function setIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(
2039
+ collection: C,
2040
+ keyPath: [K],
2041
+ value: S
2042
+ ): C;
2043
+ declare function setIn<
2044
+ C,
2045
+ K: $KeyOf<C>,
2046
+ K2: $KeyOf<$ValOf<C, K>>,
2047
+ S: $ValOf<$ValOf<C, K>, K2>
2048
+ >(
2049
+ collection: C,
2050
+ keyPath: [K, K2],
2051
+ value: S
2052
+ ): C;
2053
+ declare function setIn<
2054
+ C,
2055
+ K: $KeyOf<C>,
2056
+ K2: $KeyOf<$ValOf<C, K>>,
2057
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2058
+ S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>
2059
+ >(
2060
+ collection: C,
2061
+ keyPath: [K, K2, K3],
2062
+ value: S
2063
+ ): C;
2064
+ declare function setIn<
2065
+ C,
2066
+ K: $KeyOf<C>,
2067
+ K2: $KeyOf<$ValOf<C, K>>,
2068
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2069
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2070
+ S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>
2071
+ >(
2072
+ collection: C,
2073
+ keyPath: [K, K2, K3, K4],
2074
+ value: S
2075
+ ): C;
2076
+ declare function setIn<
2077
+ C,
2078
+ K: $KeyOf<C>,
2079
+ K2: $KeyOf<$ValOf<C, K>>,
2080
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2081
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2082
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
2083
+ S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
2084
+ >(
2085
+ collection: C,
2086
+ keyPath: [K, K2, K3, K4, K5],
2087
+ value: S
2088
+ ): C;
2089
+
2090
+ declare function updateIn<C, S>(
2091
+ collection: C,
2092
+ keyPath: [],
2093
+ notSetValue: mixed,
2094
+ updater: (value: C) => S
2095
+ ): S;
2096
+ declare function updateIn<C, S>(
2097
+ collection: C,
2098
+ keyPath: [],
2099
+ updater: (value: C) => S
2100
+ ): S;
2101
+ declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>, NSV>(
2102
+ collection: C,
2103
+ keyPath: [K],
2104
+ notSetValue: NSV,
2105
+ updater: (value: $ValOf<C, K> | NSV) => S
2106
+ ): C;
2107
+ declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(
2108
+ collection: C,
2109
+ keyPath: [K],
2110
+ updater: (value: $ValOf<C, K>) => S
2111
+ ): C;
2112
+ declare function updateIn<
2113
+ C,
2114
+ K: $KeyOf<C>,
2115
+ K2: $KeyOf<$ValOf<C, K>>,
2116
+ S: $ValOf<$ValOf<C, K>, K2>,
2117
+ NSV
2118
+ >(
2119
+ collection: C,
2120
+ keyPath: [K, K2],
2121
+ notSetValue: NSV,
2122
+ updater: (value: $ValOf<$ValOf<C, K>, K2> | NSV) => S
2123
+ ): C;
2124
+ declare function updateIn<
2125
+ C,
2126
+ K: $KeyOf<C>,
2127
+ K2: $KeyOf<$ValOf<C, K>>,
2128
+ S: $ValOf<$ValOf<C, K>, K2>
2129
+ >(
2130
+ collection: C,
2131
+ keyPath: [K, K2],
2132
+ updater: (value: $ValOf<$ValOf<C, K>, K2>) => S
2133
+ ): C;
2134
+ declare function updateIn<
2135
+ C,
2136
+ K: $KeyOf<C>,
2137
+ K2: $KeyOf<$ValOf<C, K>>,
2138
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2139
+ S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>,
2140
+ NSV
2141
+ >(
2142
+ collection: C,
2143
+ keyPath: [K, K2, K3],
2144
+ notSetValue: NSV,
2145
+ updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV) => S
2146
+ ): C;
2147
+ declare function updateIn<
2148
+ C,
2149
+ K: $KeyOf<C>,
2150
+ K2: $KeyOf<$ValOf<C, K>>,
2151
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2152
+ S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>
2153
+ >(
2154
+ collection: C,
2155
+ keyPath: [K, K2, K3],
2156
+ updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>) => S
2157
+ ): C;
2158
+ declare function updateIn<
2159
+ C,
2160
+ K: $KeyOf<C>,
2161
+ K2: $KeyOf<$ValOf<C, K>>,
2162
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2163
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2164
+ S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>,
2165
+ NSV
2166
+ >(
2167
+ collection: C,
2168
+ keyPath: [K, K2, K3, K4],
2169
+ notSetValue: NSV,
2170
+ updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV) => S
2171
+ ): C;
2172
+ declare function updateIn<
2173
+ C,
2174
+ K: $KeyOf<C>,
2175
+ K2: $KeyOf<$ValOf<C, K>>,
2176
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2177
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2178
+ S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>
2179
+ >(
2180
+ collection: C,
2181
+ keyPath: [K, K2, K3, K4],
2182
+ updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>) => S
2183
+ ): C;
2184
+ declare function updateIn<
2185
+ C,
2186
+ K: $KeyOf<C>,
2187
+ K2: $KeyOf<$ValOf<C, K>>,
2188
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2189
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2190
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
2191
+ S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>,
2192
+ NSV
2193
+ >(
2194
+ collection: C,
2195
+ keyPath: [K, K2, K3, K4, K5],
2196
+ notSetValue: NSV,
2197
+ updater: (
2198
+ value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV
2199
+ ) => S
2200
+ ): C;
2201
+ declare function updateIn<
2202
+ C,
2203
+ K: $KeyOf<C>,
2204
+ K2: $KeyOf<$ValOf<C, K>>,
2205
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2206
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2207
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
2208
+ S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
2209
+ >(
2210
+ collection: C,
2211
+ keyPath: [K, K2, K3, K4, K5],
2212
+ updater: (
2213
+ value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
2214
+ ) => S
2215
+ ): C;
2216
+
2217
+ declare function merge<C>(
2218
+ collection: C,
2219
+ ...collections: Array<
2220
+ | $IterableOf<C>
2221
+ | $Shape<RecordValues<C>>
2222
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2223
+ >
2224
+ ): C;
2225
+ declare function mergeWith<C>(
2226
+ merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>,
2227
+ collection: C,
2228
+ ...collections: Array<
2229
+ | $IterableOf<C>
2230
+ | $Shape<RecordValues<C>>
2231
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2232
+ >
2233
+ ): C;
2234
+ declare function mergeDeep<C>(
2235
+ collection: C,
2236
+ ...collections: Array<
2237
+ | $IterableOf<C>
2238
+ | $Shape<RecordValues<C>>
2239
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2240
+ >
2241
+ ): C;
2242
+ declare function mergeDeepWith<C>(
2243
+ merger: (oldVal: any, newVal: any, key: any) => mixed,
2244
+ collection: C,
2245
+ ...collections: Array<
2246
+ | $IterableOf<C>
2247
+ | $Shape<RecordValues<C>>
2248
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2249
+ >
2250
+ ): C;
2251
+
1446
2252
  export {
1447
2253
  Collection,
1448
2254
  Seq,
1449
-
1450
2255
  List,
1451
2256
  Map,
1452
2257
  OrderedMap,
@@ -1456,11 +2261,9 @@ export {
1456
2261
  Record,
1457
2262
  Set,
1458
2263
  Stack,
1459
-
1460
2264
  fromJS,
1461
2265
  is,
1462
2266
  hash,
1463
-
1464
2267
  isImmutable,
1465
2268
  isCollection,
1466
2269
  isKeyed,
@@ -1469,7 +2272,21 @@ export {
1469
2272
  isOrdered,
1470
2273
  isRecord,
1471
2274
  isValueObject,
1472
- }
2275
+ get,
2276
+ has,
2277
+ remove,
2278
+ set,
2279
+ update,
2280
+ getIn,
2281
+ hasIn,
2282
+ removeIn,
2283
+ setIn,
2284
+ updateIn,
2285
+ merge,
2286
+ mergeWith,
2287
+ mergeDeep,
2288
+ mergeDeepWith,
2289
+ };
1473
2290
 
1474
2291
  export default {
1475
2292
  Collection,
@@ -1497,7 +2314,22 @@ export default {
1497
2314
  isOrdered,
1498
2315
  isRecord,
1499
2316
  isValueObject,
1500
- }
2317
+
2318
+ get,
2319
+ has,
2320
+ remove,
2321
+ set,
2322
+ update,
2323
+ getIn,
2324
+ hasIn,
2325
+ removeIn,
2326
+ setIn,
2327
+ updateIn,
2328
+ merge,
2329
+ mergeWith,
2330
+ mergeDeep,
2331
+ mergeDeepWith,
2332
+ };
1501
2333
 
1502
2334
  export type {
1503
2335
  KeyedCollection,
@@ -1508,5 +2340,8 @@ export type {
1508
2340
  SetSeq,
1509
2341
  RecordFactory,
1510
2342
  RecordOf,
2343
+ RecordInstance,
1511
2344
  ValueObject,
1512
- }
2345
+ $KeyOf,
2346
+ $ValOf,
2347
+ };