immutable 4.0.0-rc.8 → 4.1.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,31 +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};
26
+ type PlainObjInput<K, V> = { +[key: K]: V, __proto__: null };
27
+
28
+ type K<T> = $Keys<T>;
34
29
 
35
30
  // Helper types to extract the "keys" and "values" use by the *In() methods.
36
31
  type $KeyOf<C> = $Call<
37
- & (<K>(?_Collection<K, mixed>) => K)
38
- & (<T>(?$ReadOnlyArray<T>) => number)
39
- & (<T>(?RecordInstance<T> | T) => $Keys<T>),
32
+ (<K>(?_Collection<K, mixed>) => K) &
33
+ (<T>(?$ReadOnlyArray<T>) => number) &
34
+ (<T>(?RecordInstance<T> | T) => $Keys<T>) &
35
+ (<T: Object>(T) => $Keys<T>),
40
36
  C
41
37
  >;
42
38
 
43
39
  type $ValOf<C, K = $KeyOf<C>> = $Call<
44
- & (<V>(?_Collection<any, V>) => V)
45
- & (<T>(?$ReadOnlyArray<T>) => T)
46
- & (<T, K: $Keys<T>>(?RecordInstance<T> | T, K) => $ElementType<T, K>)
47
- & (<V>(?{[any]: V}) => V),
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>),
48
44
  C,
49
45
  K
50
46
  >;
51
47
 
52
- declare class _Collection<K, +V> /*implements ValueObject*/ {
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 {
53
64
  equals(other: mixed): boolean;
54
65
  hashCode(): number;
55
66
  get(key: K, ..._: []): V | void;
@@ -57,23 +68,46 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
57
68
  has(key: K): boolean;
58
69
  includes(value: V): boolean;
59
70
  contains(value: V): boolean;
60
- first(): V | void;
61
- last(): V | void;
71
+ first<NSV>(notSetValue?: NSV): V | NSV;
72
+ last<NSV>(notSetValue?: NSV): V | NSV;
62
73
 
63
74
  hasIn(keyPath: Iterable<mixed>): boolean;
64
75
 
65
76
  getIn(keyPath: [], notSetValue?: mixed): this;
66
77
  getIn<NSV>(keyPath: [K], notSetValue: NSV): V | NSV;
67
- getIn<NSV, K2: $KeyOf<V>>(keyPath: [K, K2], notSetValue: NSV): $ValOf<V, K2> | NSV;
68
- getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(keyPath: [K, K2, K3], notSetValue: NSV): $ValOf<$ValOf<V, K2>, K3> | NSV;
69
- getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>>(keyPath: [K, K2, K3, K4], notSetValue: NSV): $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV;
70
- getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | 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;
71
105
 
72
106
  update<U>(updater: (value: this) => U): U;
73
107
 
74
108
  toJS(): Array<any> | { [key: string]: mixed };
75
109
  toJSON(): Array<V> | { [key: string]: V };
76
- toArray(): Array<V> | Array<[K,V]>;
110
+ toArray(): Array<V> | Array<[K, V]>;
77
111
  toObject(): { [key: string]: V };
78
112
  toMap(): Map<K, V>;
79
113
  toOrderedMap(): OrderedMap<K, V>;
@@ -117,12 +151,24 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
117
151
  butLast(): this;
118
152
  skip(amount: number): this;
119
153
  skipLast(amount: number): this;
120
- skipWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
121
- 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;
122
162
  take(amount: number): this;
123
163
  takeLast(amount: number): this;
124
- takeWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
125
- 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;
126
172
 
127
173
  filterNot(
128
174
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -132,27 +178,37 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
132
178
  reduce<R>(
133
179
  reducer: (reduction: R, value: V, key: K, iter: this) => R,
134
180
  initialReduction: R,
135
- context?: mixed,
136
- ): R;
137
- reduce<R>(
138
- reducer: (reduction: V | R, value: V, key: K, iter: this) => R
181
+ context?: mixed
139
182
  ): R;
183
+ reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;
140
184
 
141
185
  reduceRight<R>(
142
186
  reducer: (reduction: R, value: V, key: K, iter: this) => R,
143
187
  initialReduction: R,
144
- context?: mixed,
188
+ context?: mixed
145
189
  ): R;
146
190
  reduceRight<R>(
147
191
  reducer: (reduction: V | R, value: V, key: K, iter: this) => R
148
192
  ): R;
149
193
 
150
- every(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): boolean;
151
- 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;
152
202
  join(separator?: string): string;
153
203
  isEmpty(): boolean;
154
- count(predicate?: (value: V, key: K, iter: this) => mixed, context?: mixed): number;
155
- 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>;
156
212
 
157
213
  find<NSV>(
158
214
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -166,10 +222,18 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
166
222
  ): V | NSV;
167
223
 
168
224
  findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
169
- 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;
170
228
 
171
- findKey(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): K | void;
172
- 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;
173
237
 
174
238
  keyOf(searchValue: V): K | void;
175
239
  lastKeyOf(searchValue: V): K | void;
@@ -189,21 +253,46 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
189
253
  isSuperset(iter: Iterable<V>): boolean;
190
254
  }
191
255
 
192
- declare function isImmutable(maybeImmutable: mixed): boolean %checks(maybeImmutable instanceof Collection);
193
- declare function isCollection(maybeCollection: mixed): boolean %checks(maybeCollection instanceof Collection);
194
- declare function isKeyed(maybeKeyed: mixed): boolean %checks(maybeKeyed instanceof KeyedCollection);
195
- declare function isIndexed(maybeIndexed: mixed): boolean %checks(maybeIndexed instanceof IndexedCollection);
196
- declare function isAssociative(maybeAssociative: mixed): boolean %checks(
197
- maybeAssociative instanceof KeyedCollection ||
198
- maybeAssociative instanceof IndexedCollection
199
- );
200
- declare function isOrdered(maybeOrdered: mixed): boolean %checks(
201
- 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 ||
202
275
  maybeOrdered instanceof OrderedMap ||
203
- maybeOrdered instanceof OrderedSet
204
- );
276
+ maybeOrdered instanceof OrderedSet);
205
277
  declare function isValueObject(maybeValue: mixed): boolean;
206
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
+
207
296
  declare interface ValueObject {
208
297
  equals(other: mixed): boolean;
209
298
  hashCode(): number;
@@ -222,7 +311,9 @@ declare class Collection<K, +V> extends _Collection<K, V> {
222
311
  }
223
312
 
224
313
  declare class KeyedCollection<K, +V> extends Collection<K, V> {
225
- static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): KeyedCollection<K, V>;
314
+ static <K, V>(
315
+ values?: Iterable<[K, V]> | PlainObjInput<K, V>
316
+ ): KeyedCollection<K, V>;
226
317
 
227
318
  toJS(): { [key: string]: mixed };
228
319
  toJSON(): { [key: string]: V };
@@ -231,7 +322,9 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
231
322
  toSeq(): KeyedSeq<K, V>;
232
323
  flip(): KeyedCollection<V, K>;
233
324
 
234
- concat<KC, VC>(...iters: Array<Iterable<[KC, VC]> | 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>;
235
328
 
236
329
  filter(predicate: typeof Boolean): KeyedCollection<K, $NonMaybeType<V>>;
237
330
  filter(
@@ -263,7 +356,7 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
263
356
  flatten(shallow?: boolean): KeyedCollection<any, any>;
264
357
  }
265
358
 
266
- Collection.Keyed = KeyedCollection
359
+ Collection.Keyed = KeyedCollection;
267
360
 
268
361
  declare class IndexedCollection<+T> extends Collection<number, T> {
269
362
  static <T>(iter?: Iterable<T>): IndexedCollection<T>;
@@ -276,16 +369,9 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
276
369
  fromEntrySeq<K, V>(): KeyedSeq<K, V>;
277
370
  interpose(separator: T): this;
278
371
  interleave(...collections: Iterable<T>[]): this;
279
- splice(
280
- index: number,
281
- removeNum: number,
282
- ...values: T[]
283
- ): this;
372
+ splice(index: number, removeNum: number, ...values: T[]): this;
284
373
 
285
- zip<A>(
286
- a: Iterable<A>,
287
- ..._: []
288
- ): IndexedCollection<[T, A]>;
374
+ zip<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T, A]>;
289
375
  zip<A, B>(
290
376
  a: Iterable<A>,
291
377
  b: Iterable<B>,
@@ -313,28 +399,25 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
313
399
  ..._: []
314
400
  ): IndexedCollection<[T, A, B, C, D, E]>;
315
401
 
316
- zipAll<A>(
317
- a: Iterable<A>,
318
- ..._: []
319
- ): IndexedCollection<[T|void, A|void]>;
402
+ zipAll<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T | void, A | void]>;
320
403
  zipAll<A, B>(
321
404
  a: Iterable<A>,
322
405
  b: Iterable<B>,
323
406
  ..._: []
324
- ): IndexedCollection<[T|void, A|void, B|void]>;
407
+ ): IndexedCollection<[T | void, A | void, B | void]>;
325
408
  zipAll<A, B, C>(
326
409
  a: Iterable<A>,
327
410
  b: Iterable<B>,
328
411
  c: Iterable<C>,
329
412
  ..._: []
330
- ): IndexedCollection<[T|void, A|void, B|void, C|void]>;
413
+ ): IndexedCollection<[T | void, A | void, B | void, C | void]>;
331
414
  zipAll<A, B, C, D>(
332
415
  a: Iterable<A>,
333
416
  b: Iterable<B>,
334
417
  c: Iterable<C>,
335
418
  d: Iterable<D>,
336
419
  ..._: []
337
- ): IndexedCollection<[T|void, A|void, B|void, C|void, D|void]>;
420
+ ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>;
338
421
  zipAll<A, B, C, D, E>(
339
422
  a: Iterable<A>,
340
423
  b: Iterable<B>,
@@ -342,7 +425,9 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
342
425
  d: Iterable<D>,
343
426
  e: Iterable<E>,
344
427
  ..._: []
345
- ): 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
+ >;
346
431
 
347
432
  zipWith<A, R>(
348
433
  zipper: (value: T, a: A) => R,
@@ -448,7 +533,8 @@ declare class SetCollection<+T> extends Collection<T, T> {
448
533
  flatten(shallow?: boolean): SetCollection<any>;
449
534
  }
450
535
 
451
- declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof Seq);
536
+ declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof
537
+ Seq);
452
538
  declare class Seq<K, +V> extends _Collection<K, V> {
453
539
  static Keyed: typeof KeyedSeq;
454
540
  static Indexed: typeof IndexedSeq;
@@ -467,12 +553,16 @@ declare class Seq<K, +V> extends _Collection<K, V> {
467
553
  }
468
554
 
469
555
  declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
470
- static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): KeyedSeq<K, V>;
556
+ static <K, V>(
557
+ values?: Iterable<[K, V]> | PlainObjInput<K, V>
558
+ ): KeyedSeq<K, V>;
471
559
 
472
560
  // Override specialized return types
473
561
  flip(): KeyedSeq<V, K>;
474
562
 
475
- concat<KC, VC>(...iters: Array<Iterable<[KC, VC]> | 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>;
476
566
 
477
567
  filter(predicate: typeof Boolean): KeyedSeq<K, $NonMaybeType<V>>;
478
568
  filter(
@@ -504,7 +594,10 @@ declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
504
594
  flatten(shallow?: boolean): KeyedSeq<any, any>;
505
595
  }
506
596
 
507
- declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T> {
597
+ declare class IndexedSeq<+T>
598
+ extends Seq<number, T>
599
+ mixins IndexedCollection<T>
600
+ {
508
601
  static <T>(values?: Iterable<T>): IndexedSeq<T>;
509
602
 
510
603
  static of<T>(...values: T[]): IndexedSeq<T>;
@@ -532,15 +625,8 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
532
625
  flatten(depth?: number): IndexedSeq<any>;
533
626
  flatten(shallow?: boolean): IndexedSeq<any>;
534
627
 
535
- zip<A>(
536
- a: Iterable<A>,
537
- ..._: []
538
- ): IndexedSeq<[T, A]>;
539
- zip<A, B>(
540
- a: Iterable<A>,
541
- b: Iterable<B>,
542
- ..._: []
543
- ): 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]>;
544
630
  zip<A, B, C>(
545
631
  a: Iterable<A>,
546
632
  b: Iterable<B>,
@@ -563,28 +649,25 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
563
649
  ..._: []
564
650
  ): IndexedSeq<[T, A, B, C, D, E]>;
565
651
 
566
- zipAll<A>(
567
- a: Iterable<A>,
568
- ..._: []
569
- ): IndexedSeq<[T|void, A|void]>;
652
+ zipAll<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T | void, A | void]>;
570
653
  zipAll<A, B>(
571
654
  a: Iterable<A>,
572
655
  b: Iterable<B>,
573
656
  ..._: []
574
- ): IndexedSeq<[T|void, A|void, B|void]>;
657
+ ): IndexedSeq<[T | void, A | void, B | void]>;
575
658
  zipAll<A, B, C>(
576
659
  a: Iterable<A>,
577
660
  b: Iterable<B>,
578
661
  c: Iterable<C>,
579
662
  ..._: []
580
- ): IndexedSeq<[T|void, A|void, B|void, C|void]>;
663
+ ): IndexedSeq<[T | void, A | void, B | void, C | void]>;
581
664
  zipAll<A, B, C, D>(
582
665
  a: Iterable<A>,
583
666
  b: Iterable<B>,
584
667
  c: Iterable<C>,
585
668
  d: Iterable<D>,
586
669
  ..._: []
587
- ): IndexedSeq<[T|void, A|void, B|void, C|void, D|void]>;
670
+ ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>;
588
671
  zipAll<A, B, C, D, E>(
589
672
  a: Iterable<A>,
590
673
  b: Iterable<B>,
@@ -592,7 +675,7 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
592
675
  d: Iterable<D>,
593
676
  e: Iterable<E>,
594
677
  ..._: []
595
- ): 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]>;
596
679
 
597
680
  zipWith<A, R>(
598
681
  zipper: (value: T, a: A) => R,
@@ -664,40 +747,157 @@ declare class UpdatableInCollection<K, +V> {
664
747
  setIn<S>(keyPath: [], value: S): S;
665
748
  setIn(keyPath: [K], value: V): this;
666
749
  setIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], value: S): this;
667
- setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(keyPath: [K, K2, K3], value: S): this;
668
- setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], value: S): this;
669
- setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], 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;
670
773
 
671
774
  deleteIn(keyPath: []): void;
672
775
  deleteIn(keyPath: [K]): this;
673
776
  deleteIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
674
- deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(keyPath: [K, K2, K3]): this;
675
- deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this;
676
- deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5]): 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;
677
795
 
678
796
  removeIn(keyPath: []): void;
679
797
  removeIn(keyPath: [K]): this;
680
798
  removeIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
681
- removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(keyPath: [K, K2, K3]): this;
682
- removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this;
683
- removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5]): 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;
684
817
 
685
818
  updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
686
819
  updateIn<U>(keyPath: [], updater: (value: this) => U): U;
687
820
  updateIn<NSV>(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this;
688
821
  updateIn(keyPath: [K], updater: (value: V) => V): this;
689
- updateIn<NSV, K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<V, K2> | NSV) => S): this;
690
- updateIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], updater: (value: $ValOf<V, K2>) => S): this;
691
- updateIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<V, K2>, K3> | NSV) => S): this;
692
- updateIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<V, K2>, K3>) => S): this;
693
- updateIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV) => S): this;
694
- updateIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>) => S): this;
695
- updateIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV) => S): this;
696
- updateIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>) => S): 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;
697
893
  }
698
894
 
699
- declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof List);
700
- declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection<number, T> {
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
+ {
701
901
  static (collection?: Iterable<T>): List<T>;
702
902
 
703
903
  static of<T>(...values: T[]): List<T>;
@@ -718,14 +918,21 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
718
918
 
719
919
  update<U>(updater: (value: this) => U): U;
720
920
  update<U>(index: number, updater: (value: T) => U): List<T | U>;
721
- 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>;
722
926
 
723
927
  merge<U>(...collections: Iterable<U>[]): List<T | U>;
724
928
 
725
929
  setSize(size: number): this;
726
930
 
727
931
  mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
728
- mergeDeepIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
932
+ mergeDeepIn(
933
+ keyPath: Iterable<mixed>,
934
+ ...collections: Iterable<mixed>[]
935
+ ): this;
729
936
 
730
937
  withMutations(mutator: (mutable: this) => mixed): this;
731
938
  asMutable(): this;
@@ -755,15 +962,8 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
755
962
  flatten(depth?: number): List<any>;
756
963
  flatten(shallow?: boolean): List<any>;
757
964
 
758
- zip<A>(
759
- a: Iterable<A>,
760
- ..._: []
761
- ): List<[T, A]>;
762
- zip<A, B>(
763
- a: Iterable<A>,
764
- b: Iterable<B>,
765
- ..._: []
766
- ): 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]>;
767
967
  zip<A, B, C>(
768
968
  a: Iterable<A>,
769
969
  b: Iterable<B>,
@@ -786,28 +986,25 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
786
986
  ..._: []
787
987
  ): List<[T, A, B, C, D, E]>;
788
988
 
789
- zipAll<A>(
790
- a: Iterable<A>,
791
- ..._: []
792
- ): List<[T|void, A|void]>;
989
+ zipAll<A>(a: Iterable<A>, ..._: []): List<[T | void, A | void]>;
793
990
  zipAll<A, B>(
794
991
  a: Iterable<A>,
795
992
  b: Iterable<B>,
796
993
  ..._: []
797
- ): List<[T|void, A|void, B|void]>;
994
+ ): List<[T | void, A | void, B | void]>;
798
995
  zipAll<A, B, C>(
799
996
  a: Iterable<A>,
800
997
  b: Iterable<B>,
801
998
  c: Iterable<C>,
802
999
  ..._: []
803
- ): List<[T|void, A|void, B|void, C|void]>;
1000
+ ): List<[T | void, A | void, B | void, C | void]>;
804
1001
  zipAll<A, B, C, D>(
805
1002
  a: Iterable<A>,
806
1003
  b: Iterable<B>,
807
1004
  c: Iterable<C>,
808
1005
  d: Iterable<D>,
809
1006
  ..._: []
810
- ): List<[T|void, A|void, B|void, C|void, D|void]>;
1007
+ ): List<[T | void, A | void, B | void, C | void, D | void]>;
811
1008
  zipAll<A, B, C, D, E>(
812
1009
  a: Iterable<A>,
813
1010
  b: Iterable<B>,
@@ -815,7 +1012,7 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
815
1012
  d: Iterable<D>,
816
1013
  e: Iterable<E>,
817
1014
  ..._: []
818
- ): 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]>;
819
1016
 
820
1017
  zipWith<A, R>(
821
1018
  zipper: (value: T, a: A) => R,
@@ -854,8 +1051,12 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
854
1051
  ): List<R>;
855
1052
  }
856
1053
 
857
- declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof Map);
858
- declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollection<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
+ {
859
1060
  static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): Map<K, V>;
860
1061
 
861
1062
  static isMap: typeof isMap;
@@ -872,7 +1073,11 @@ declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollect
872
1073
 
873
1074
  update<U>(updater: (value: this) => U): U;
874
1075
  update<V_>(key: K, updater: (value: V) => V_): Map<K, V | V_>;
875
- 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_>;
876
1081
 
877
1082
  merge<K_, V_>(
878
1083
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
@@ -890,10 +1095,10 @@ declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollect
890
1095
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
891
1096
  ): Map<K | K_, V | V_>;
892
1097
 
893
- mergeDeepWith<K_, W, X>(
894
- merger: (oldVal: V, newVal: W, key: K) => X,
895
- ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
896
- ): Map<K | K_, V | W | X>;
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_>;
897
1102
 
898
1103
  mergeIn(
899
1104
  keyPath: Iterable<mixed>,
@@ -943,9 +1148,16 @@ declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollect
943
1148
  flatten(shallow?: boolean): Map<any, any>;
944
1149
  }
945
1150
 
946
- declare function isOrderedMap(maybeOrderedMap: mixed): boolean %checks(maybeOrderedMap instanceof OrderedMap);
947
- declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K, V> {
948
- static <K, V>(values?: Iterable<[K, V]> | 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>;
949
1161
 
950
1162
  static isOrderedMap: typeof isOrderedMap;
951
1163
 
@@ -958,7 +1170,11 @@ declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K
958
1170
 
959
1171
  update<U>(updater: (value: this) => U): U;
960
1172
  update<V_>(key: K, updater: (value: V) => V_): OrderedMap<K, V | V_>;
961
- 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_>;
962
1178
 
963
1179
  merge<K_, V_>(
964
1180
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
@@ -976,10 +1192,10 @@ declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K
976
1192
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
977
1193
  ): OrderedMap<K | K_, V | V_>;
978
1194
 
979
- mergeDeepWith<K_, W, X>(
980
- merger: (oldVal: V, newVal: W, key: K) => X,
981
- ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
982
- ): OrderedMap<K | K_, V | W | X>;
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_>;
983
1199
 
984
1200
  mergeIn(
985
1201
  keyPath: Iterable<mixed>,
@@ -1029,12 +1245,15 @@ declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K
1029
1245
  flatten(shallow?: boolean): OrderedMap<any, any>;
1030
1246
  }
1031
1247
 
1032
- declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof Set);
1248
+ declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof
1249
+ Set);
1033
1250
  declare class Set<+T> extends SetCollection<T> {
1034
1251
  static <T>(values?: Iterable<T>): Set<T>;
1035
1252
 
1036
1253
  static of<T>(...values: T[]): Set<T>;
1037
- static fromKeys<T>(values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>): Set<T>;
1254
+ static fromKeys<T>(
1255
+ values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
1256
+ ): Set<T>;
1038
1257
 
1039
1258
  static intersect(sets: Iterable<Iterable<T>>): Set<T>;
1040
1259
  static union(sets: Iterable<Iterable<T>>): Set<T>;
@@ -1081,12 +1300,16 @@ declare class Set<+T> extends SetCollection<T> {
1081
1300
  }
1082
1301
 
1083
1302
  // Overrides except for `isOrderedSet` are for specialized return types
1084
- declare function isOrderedSet(maybeOrderedSet: mixed): boolean %checks(maybeOrderedSet instanceof OrderedSet);
1303
+ declare function isOrderedSet(
1304
+ maybeOrderedSet: mixed
1305
+ ): boolean %checks(maybeOrderedSet instanceof OrderedSet);
1085
1306
  declare class OrderedSet<+T> extends Set<T> {
1086
1307
  static <T>(values?: Iterable<T>): OrderedSet<T>;
1087
1308
 
1088
1309
  static of<T>(...values: T[]): OrderedSet<T>;
1089
- static fromKeys<T>(values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>): OrderedSet<T>;
1310
+ static fromKeys<T>(
1311
+ values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
1312
+ ): OrderedSet<T>;
1090
1313
 
1091
1314
  static isOrderedSet: typeof isOrderedSet;
1092
1315
 
@@ -1117,15 +1340,8 @@ declare class OrderedSet<+T> extends Set<T> {
1117
1340
  flatten(depth?: number): OrderedSet<any>;
1118
1341
  flatten(shallow?: boolean): OrderedSet<any>;
1119
1342
 
1120
- zip<A>(
1121
- a: Iterable<A>,
1122
- ..._: []
1123
- ): OrderedSet<[T, A]>;
1124
- zip<A, B>(
1125
- a: Iterable<A>,
1126
- b: Iterable<B>,
1127
- ..._: []
1128
- ): 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]>;
1129
1345
  zip<A, B, C>(
1130
1346
  a: Iterable<A>,
1131
1347
  b: Iterable<B>,
@@ -1148,28 +1364,25 @@ declare class OrderedSet<+T> extends Set<T> {
1148
1364
  ..._: []
1149
1365
  ): OrderedSet<[T, A, B, C, D, E]>;
1150
1366
 
1151
- zipAll<A>(
1152
- a: Iterable<A>,
1153
- ..._: []
1154
- ): OrderedSet<[T|void, A|void]>;
1367
+ zipAll<A>(a: Iterable<A>, ..._: []): OrderedSet<[T | void, A | void]>;
1155
1368
  zipAll<A, B>(
1156
1369
  a: Iterable<A>,
1157
1370
  b: Iterable<B>,
1158
1371
  ..._: []
1159
- ): OrderedSet<[T|void, A|void, B|void]>;
1372
+ ): OrderedSet<[T | void, A | void, B | void]>;
1160
1373
  zipAll<A, B, C>(
1161
1374
  a: Iterable<A>,
1162
1375
  b: Iterable<B>,
1163
1376
  c: Iterable<C>,
1164
1377
  ..._: []
1165
- ): OrderedSet<[T|void, A|void, B|void, C|void]>;
1378
+ ): OrderedSet<[T | void, A | void, B | void, C | void]>;
1166
1379
  zipAll<A, B, C, D>(
1167
1380
  a: Iterable<A>,
1168
1381
  b: Iterable<B>,
1169
1382
  c: Iterable<C>,
1170
1383
  d: Iterable<D>,
1171
1384
  ..._: []
1172
- ): OrderedSet<[T|void, A|void, B|void, C|void, D|void]>;
1385
+ ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>;
1173
1386
  zipAll<A, B, C, D, E>(
1174
1387
  a: Iterable<A>,
1175
1388
  b: Iterable<B>,
@@ -1177,7 +1390,7 @@ declare class OrderedSet<+T> extends Set<T> {
1177
1390
  d: Iterable<D>,
1178
1391
  e: Iterable<E>,
1179
1392
  ..._: []
1180
- ): 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]>;
1181
1394
 
1182
1395
  zipWith<A, R>(
1183
1396
  zipper: (value: T, a: A) => R,
@@ -1216,7 +1429,9 @@ declare class OrderedSet<+T> extends Set<T> {
1216
1429
  ): OrderedSet<R>;
1217
1430
  }
1218
1431
 
1219
- declare function isStack(maybeStack: mixed): boolean %checks(maybeStack instanceof Stack);
1432
+ declare function isStack(
1433
+ maybeStack: mixed
1434
+ ): boolean %checks(maybeStack instanceof Stack);
1220
1435
  declare class Stack<+T> extends IndexedCollection<T> {
1221
1436
  static <T>(collection?: Iterable<T>): Stack<T>;
1222
1437
 
@@ -1264,15 +1479,8 @@ declare class Stack<+T> extends IndexedCollection<T> {
1264
1479
  flatten(depth?: number): Stack<any>;
1265
1480
  flatten(shallow?: boolean): Stack<any>;
1266
1481
 
1267
- zip<A>(
1268
- a: Iterable<A>,
1269
- ..._: []
1270
- ): Stack<[T, A]>;
1271
- zip<A, B>(
1272
- a: Iterable<A>,
1273
- b: Iterable<B>,
1274
- ..._: []
1275
- ): 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]>;
1276
1484
  zip<A, B, C>(
1277
1485
  a: Iterable<A>,
1278
1486
  b: Iterable<B>,
@@ -1295,28 +1503,25 @@ declare class Stack<+T> extends IndexedCollection<T> {
1295
1503
  ..._: []
1296
1504
  ): Stack<[T, A, B, C, D, E]>;
1297
1505
 
1298
- zipAll<A>(
1299
- a: Iterable<A>,
1300
- ..._: []
1301
- ): Stack<[T|void, A|void]>;
1506
+ zipAll<A>(a: Iterable<A>, ..._: []): Stack<[T | void, A | void]>;
1302
1507
  zipAll<A, B>(
1303
1508
  a: Iterable<A>,
1304
1509
  b: Iterable<B>,
1305
1510
  ..._: []
1306
- ): Stack<[T|void, A|void, B|void]>;
1511
+ ): Stack<[T | void, A | void, B | void]>;
1307
1512
  zipAll<A, B, C>(
1308
1513
  a: Iterable<A>,
1309
1514
  b: Iterable<B>,
1310
1515
  c: Iterable<C>,
1311
1516
  ..._: []
1312
- ): Stack<[T|void, A|void, B|void, C|void]>;
1517
+ ): Stack<[T | void, A | void, B | void, C | void]>;
1313
1518
  zipAll<A, B, C, D>(
1314
1519
  a: Iterable<A>,
1315
1520
  b: Iterable<B>,
1316
1521
  c: Iterable<C>,
1317
1522
  d: Iterable<D>,
1318
1523
  ..._: []
1319
- ): Stack<[T|void, A|void, B|void, C|void, D|void]>;
1524
+ ): Stack<[T | void, A | void, B | void, C | void, D | void]>;
1320
1525
  zipAll<A, B, C, D, E>(
1321
1526
  a: Iterable<A>,
1322
1527
  b: Iterable<B>,
@@ -1324,7 +1529,7 @@ declare class Stack<+T> extends IndexedCollection<T> {
1324
1529
  d: Iterable<D>,
1325
1530
  e: Iterable<E>,
1326
1531
  ..._: []
1327
- ): 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]>;
1328
1533
 
1329
1534
  zipWith<A, R>(
1330
1535
  zipper: (value: T, a: A) => R,
@@ -1363,102 +1568,328 @@ declare class Stack<+T> extends IndexedCollection<T> {
1363
1568
  ): Stack<R>;
1364
1569
  }
1365
1570
 
1366
- 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>;
1367
1576
  declare function Repeat<T>(value: T, times?: number): IndexedSeq<T>;
1368
1577
 
1369
1578
  // The type of a Record factory function.
1370
1579
  type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
1371
1580
 
1372
1581
  // The type of runtime Record instances.
1373
- type RecordOf<Values: Object> = RecordInstance<Values> & Values;
1582
+ type RecordOf<Values: Object> = RecordInstance<Values> & $ReadOnly<Values>;
1374
1583
 
1375
- 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);
1376
1591
  declare class Record {
1377
- static <Values: Object>(spec: Values, name?: string): RecordFactory<Values>;
1378
- 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;
1379
1597
 
1380
1598
  static isRecord: typeof isRecord;
1381
1599
 
1382
1600
  static getDescriptiveName(record: RecordInstance<any>): string;
1383
1601
  }
1384
1602
 
1385
- declare class RecordInstance<T: Object> {
1386
- static (values?: $Shape<T> | Iterable<[$Keys<T>, any]>): RecordOf<T>;
1603
+ declare class RecordInstance<T: Object = Object> {
1604
+ static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>;
1387
1605
  // Note: a constructor can only create an instance of RecordInstance<T>,
1388
1606
  // it's encouraged to not use `new` when creating Records.
1389
- constructor (values?: $Shape<T> | Iterable<[$Keys<T>, any]>): void;
1607
+ constructor(values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
1390
1608
 
1391
1609
  size: number;
1392
1610
 
1393
1611
  has(key: string): boolean;
1394
- get<K: $Keys<T>>(key: K, notSetValue: mixed): $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;
1395
1615
 
1396
1616
  hasIn(keyPath: Iterable<mixed>): boolean;
1397
1617
 
1398
- getIn(keyPath: [], notSetValue?: mixed): this & T;
1618
+ getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly<T>;
1399
1619
  getIn<K: $Keys<T>>(keyPath: [K], notSetValue?: mixed): $ElementType<T, K>;
1400
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>>(keyPath: [K, K2], notSetValue: NSV): $ValOf<$ElementType<T, K>, K2> | NSV;
1401
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>>(keyPath: [K, K2, K3], notSetValue: NSV): $ValOf<$ValOf<$ElementType<T, K>, K2>, K3> | NSV;
1402
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>>(keyPath: [K, K2, K3, K4], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4> | NSV;
1403
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>, K5> | NSV;
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;
1404
1654
 
1405
1655
  equals(other: any): boolean;
1406
1656
  hashCode(): number;
1407
1657
 
1408
- set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & T;
1409
- update<K: $Keys<T>>(key: K, updater: (value: $ElementType<T, K>) => $ElementType<T, K>): this & T;
1410
- merge(...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>): this & T;
1411
- mergeDeep(...collections: Array<$Shape<T> | Iterable<[$Keys<T>, 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>;
1412
1669
 
1413
1670
  mergeWith(
1414
- merger: (oldVal: any, newVal: any, key: $Keys<T>) => any,
1415
- ...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>
1416
- ): 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>;
1417
1674
  mergeDeepWith(
1418
1675
  merger: (oldVal: any, newVal: any, key: any) => any,
1419
- ...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>
1420
- ): this & T;
1676
+ ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1677
+ ): this & $ReadOnly<T>;
1421
1678
 
1422
- delete<K: $Keys<T>>(key: K): this & T;
1423
- remove<K: $Keys<T>>(key: K): this & T;
1424
- clear(): this & T;
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>;
1425
1682
 
1426
1683
  setIn<S>(keyPath: [], value: S): S;
1427
- setIn<K: $Keys<T>, S: $ElementType<T, K>>(keyPath: [K], value: S): this & T;
1428
- setIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, S: $ValOf<$ElementType<T, K>, K2>>(keyPath: [K, K2], value: S): this & T;
1429
- setIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, S: $ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>(keyPath: [K, K2, K3], value: S): this & T;
1430
- setIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], value: S): this & T;
1431
- setIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], value: S): this & T;
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>;
1432
1722
 
1433
1723
  deleteIn(keyPath: []): void;
1434
- deleteIn<K: $Keys<T>>(keyPath: [K]): this & T;
1435
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>>(keyPath: [K, K2]): this & T;
1436
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>>(keyPath: [K, K2, K3]): this & T;
1437
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this & T;
1438
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5]): this & T;
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>;
1439
1752
 
1440
1753
  removeIn(keyPath: []): void;
1441
- removeIn<K: $Keys<T>>(keyPath: [K]): this & T;
1442
- removeIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>>(keyPath: [K, K2]): this & T;
1443
- removeIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>>(keyPath: [K, K2, K3]): this & T;
1444
- removeIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this & T;
1445
- removeIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5]): this & T;
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>;
1446
1884
 
1447
- updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
1448
- updateIn<U>(keyPath: [], updater: (value: this) => U): U;
1449
- updateIn<NSV, K: $Keys<T>, S: $ElementType<T, K>>(keyPath: [K], notSetValue: NSV, updater: (value: $ElementType<T, K>) => S): this & T;
1450
- updateIn<K: $Keys<T>, S: $ElementType<T, K>>(keyPath: [K], updater: (value: $ElementType<T, K>) => S): this & T;
1451
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, S: $ValOf<$ElementType<T, K>, K2>>(keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ElementType<T, K>, K2> | NSV) => S): this & T;
1452
- updateIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, S: $ValOf<$ElementType<T, K>, K2>>(keyPath: [K, K2], updater: (value: $ValOf<$ElementType<T, K>, K2>) => S): this & T;
1453
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, S: $ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>(keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ElementType<T, K>, K2>, K3> | NSV) => S): this & T;
1454
- updateIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, S: $ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>(keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ElementType<T, K>, K2>, K3>) => S): this & T;
1455
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4> | NSV) => S): this & T;
1456
- updateIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>) => S): this & T;
1457
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>, K5> | NSV) => S): this & T;
1458
- updateIn<K: $Keys<T>, K2: $KeyOf<$ElementType<T, K>>, K3: $KeyOf<$ValOf<$ElementType<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<$ElementType<T, K>, K2>, K3>, K4>, K5>) => S): this & T;
1459
-
1460
- mergeIn(keyPath: Iterable<mixed>, ...collections: Array<any>): this & T;
1461
- mergeDeepIn(keyPath: Iterable<mixed>, ...collections: Array<any>): 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>;
1462
1893
 
1463
1894
  toSeq(): KeyedSeq<$Keys<T>, any>;
1464
1895
 
@@ -1466,12 +1897,12 @@ declare class RecordInstance<T: Object> {
1466
1897
  toJSON(): T;
1467
1898
  toObject(): T;
1468
1899
 
1469
- withMutations(mutator: (mutable: this) => mixed): this & T;
1470
- asMutable(): this & T;
1900
+ withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly<T>;
1901
+ asMutable(): this & $ReadOnly<T>;
1471
1902
  wasAltered(): boolean;
1472
- asImmutable(): this & T;
1903
+ asImmutable(): this & $ReadOnly<T>;
1473
1904
 
1474
- @@iterator(): Iterator<[$Keys<T>, any]>;
1905
+ @@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;
1475
1906
  }
1476
1907
 
1477
1908
  declare function fromJS(
@@ -1481,79 +1912,346 @@ declare function fromJS(
1481
1912
  sequence: KeyedCollection<string, mixed> | IndexedCollection<mixed>,
1482
1913
  path?: Array<string | number>
1483
1914
  ) => mixed
1484
- ): mixed;
1915
+ ): Collection<mixed, mixed>;
1485
1916
 
1486
1917
  declare function is(first: mixed, second: mixed): boolean;
1487
1918
  declare function hash(value: mixed): number;
1488
1919
 
1489
- declare function get<C: Object, K: $Keys<C>>(collection: C, key: K, notSetValue: mixed): $ValOf<C, K>;
1490
- declare function get<C, K: $KeyOf<C>, NSV>(collection: C, key: K, notSetValue: NSV): $ValOf<C, K> | NSV;
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;
1491
1930
 
1492
1931
  declare function has(collection: Object, key: mixed): boolean;
1493
1932
  declare function remove<C>(collection: C, key: $KeyOf<C>): C;
1494
- declare function set<C, K: $KeyOf<C>, V: $ValOf<C, K>>(collection: C, key: K, value: V): C;
1495
- declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>, NSV>(collection: C, key: K, notSetValue: NSV, updater: ($ValOf<C, K> | NSV) => V): C;
1496
- declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>>(collection: C, key: K, updater: ($ValOf<C, K>) => V): 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;
1497
1949
 
1498
1950
  declare function getIn<C>(collection: C, keyPath: [], notSetValue?: mixed): C;
1499
- declare function getIn<C, K: $KeyOf<C>, NSV>(collection: C, keyPath: [K], notSetValue: NSV): $ValOf<C, K> | NSV;
1500
- declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, NSV>(collection: C, keyPath: [K, K2], notSetValue: NSV): $ValOf<$ValOf<C, K>, K2> | NSV;
1501
- declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, NSV>(collection: C, keyPath: [K, K2, K3], notSetValue: NSV): $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV;
1502
- declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, NSV>(collection: C, keyPath: [K, K2, K3, K4], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV;
1503
- declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, NSV>(collection: C, keyPath: [K, K2, K3, K4, K5], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV;
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;
1504
1997
 
1505
1998
  declare function hasIn(collection: Object, keyPath: Iterable<mixed>): boolean;
1506
1999
 
1507
2000
  declare function removeIn<C>(collection: C, keyPath: []): void;
1508
2001
  declare function removeIn<C, K: $KeyOf<C>>(collection: C, keyPath: [K]): C;
1509
- declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>>(collection: C, keyPath: [K, K2]): C;
1510
- declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>, K3: $KeyOf<$ValOf<$ValOf<C>, K2>>>(collection: C, keyPath: [K, K2, K3]): C;
1511
- declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>, K3: $KeyOf<$ValOf<$ValOf<C>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>>>(collection: C, keyPath: [K, K2, K3, K4]): C;
1512
- declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>, K3: $KeyOf<$ValOf<$ValOf<C>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>, K4>>>(collection: C, keyPath: [K, K2, K3, K4, K5]): C;
2002
+ declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>>(
2003
+ collection: C,
2004
+ keyPath: [K, K2]
2005
+ ): C;
2006
+ declare function removeIn<
2007
+ C,
2008
+ K: $KeyOf<C>,
2009
+ K2: $KeyOf<$ValOf<C, K>>,
2010
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, 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, K>>,
2019
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2020
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, 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, K>>,
2029
+ K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
2030
+ K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
2031
+ K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>
2032
+ >(
2033
+ collection: C,
2034
+ keyPath: [K, K2, K3, K4, K5]
2035
+ ): C;
1513
2036
 
1514
2037
  declare function setIn<S>(collection: Object, keyPath: [], value: S): S;
1515
- declare function setIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(collection: C, keyPath: [K], value: S): C;
1516
- declare function setIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, S: $ValOf<$ValOf<C, K>, K2>>(collection: C, keyPath: [K, K2], value: S): C;
1517
- declare function setIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>(collection: C, keyPath: [K, K2, K3], value: S): C;
1518
- declare function setIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>(collection: C, keyPath: [K, K2, K3, K4], value: S): C;
1519
- declare function setIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>>(collection: C, keyPath: [K, K2, K3, K4, K5], value: S): C;
1520
-
1521
- declare function updateIn<C, S>(collection: C, keyPath: [], notSetValue: mixed, updater: (value: C) => S): S;
1522
- declare function updateIn<C, S>(collection: C, keyPath: [], updater: (value: C) => S): S;
1523
- declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>, NSV>(collection: C, keyPath: [K], notSetValue: NSV, updater: (value: $ValOf<C, K> | NSV) => S): C;
1524
- declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(collection: C, keyPath: [K], updater: (value: $ValOf<C, K>) => S): C;
1525
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, S: $ValOf<$ValOf<C, K>, K2>, NSV>(collection: C, keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ValOf<C, K>, K2> | NSV) => S): C;
1526
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, S: $ValOf<$ValOf<C, K>, K2>>(collection: C, keyPath: [K, K2], updater: (value: $ValOf<$ValOf<C, K>, K2>) => S): C;
1527
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, NSV>(collection: C, keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV) => S): C;
1528
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>(collection: C, keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>) => S): C;
1529
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, NSV>(collection: C, keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV) => S): C;
1530
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>(collection: C, keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>) => S): C;
1531
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>, NSV>(collection: C, keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV) => S): C;
1532
- declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>>(collection: C, keyPath: [K, K2, K3, K4, K5], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>) => S): C;
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;
1533
2216
 
1534
2217
  declare function merge<C>(
1535
2218
  collection: C,
1536
- ...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2219
+ ...collections: Array<
2220
+ | $IterableOf<C>
2221
+ | $Shape<RecordValues<C>>
2222
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2223
+ >
1537
2224
  ): C;
1538
2225
  declare function mergeWith<C>(
1539
2226
  merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>,
1540
2227
  collection: C,
1541
- ...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2228
+ ...collections: Array<
2229
+ | $IterableOf<C>
2230
+ | $Shape<RecordValues<C>>
2231
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2232
+ >
1542
2233
  ): C;
1543
2234
  declare function mergeDeep<C>(
1544
2235
  collection: C,
1545
- ...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2236
+ ...collections: Array<
2237
+ | $IterableOf<C>
2238
+ | $Shape<RecordValues<C>>
2239
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2240
+ >
1546
2241
  ): C;
1547
2242
  declare function mergeDeepWith<C>(
1548
2243
  merger: (oldVal: any, newVal: any, key: any) => mixed,
1549
2244
  collection: C,
1550
- ...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2245
+ ...collections: Array<
2246
+ | $IterableOf<C>
2247
+ | $Shape<RecordValues<C>>
2248
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2249
+ >
1551
2250
  ): C;
1552
2251
 
1553
2252
  export {
1554
2253
  Collection,
1555
2254
  Seq,
1556
-
1557
2255
  List,
1558
2256
  Map,
1559
2257
  OrderedMap,
@@ -1563,11 +2261,9 @@ export {
1563
2261
  Record,
1564
2262
  Set,
1565
2263
  Stack,
1566
-
1567
2264
  fromJS,
1568
2265
  is,
1569
2266
  hash,
1570
-
1571
2267
  isImmutable,
1572
2268
  isCollection,
1573
2269
  isKeyed,
@@ -1576,7 +2272,6 @@ export {
1576
2272
  isOrdered,
1577
2273
  isRecord,
1578
2274
  isValueObject,
1579
-
1580
2275
  get,
1581
2276
  has,
1582
2277
  remove,
@@ -1591,7 +2286,7 @@ export {
1591
2286
  mergeWith,
1592
2287
  mergeDeep,
1593
2288
  mergeDeepWith,
1594
- }
2289
+ };
1595
2290
 
1596
2291
  export default {
1597
2292
  Collection,
@@ -1634,7 +2329,7 @@ export default {
1634
2329
  mergeWith,
1635
2330
  mergeDeep,
1636
2331
  mergeDeepWith,
1637
- }
2332
+ };
1638
2333
 
1639
2334
  export type {
1640
2335
  KeyedCollection,
@@ -1645,8 +2340,8 @@ export type {
1645
2340
  SetSeq,
1646
2341
  RecordFactory,
1647
2342
  RecordOf,
2343
+ RecordInstance,
1648
2344
  ValueObject,
1649
-
1650
2345
  $KeyOf,
1651
2346
  $ValOf,
1652
- }
2347
+ };