immutable 4.0.0-rc.9 → 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,37 +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
48
  type $IterableOf<C> = $Call<
53
- & (<V: Array<any> | IndexedCollection<any> | SetCollection<any>>(V) => Iterable<$ValOf<V>>)
54
- & (<V: KeyedCollection<any, any> | RecordInstance<any> | PlainObjInput<any, any>>(V) => Iterable<[$KeyOf<V>, $ValOf<V>]>),
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>]>),
55
60
  C
56
61
  >;
57
62
 
58
- declare class _Collection<K, +V> /*implements ValueObject*/ {
63
+ declare class _Collection<K, +V> implements ValueObject {
59
64
  equals(other: mixed): boolean;
60
65
  hashCode(): number;
61
66
  get(key: K, ..._: []): V | void;
@@ -63,23 +68,46 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
63
68
  has(key: K): boolean;
64
69
  includes(value: V): boolean;
65
70
  contains(value: V): boolean;
66
- first(): V | void;
67
- last(): V | void;
71
+ first<NSV>(notSetValue?: NSV): V | NSV;
72
+ last<NSV>(notSetValue?: NSV): V | NSV;
68
73
 
69
74
  hasIn(keyPath: Iterable<mixed>): boolean;
70
75
 
71
76
  getIn(keyPath: [], notSetValue?: mixed): this;
72
77
  getIn<NSV>(keyPath: [K], notSetValue: NSV): V | NSV;
73
- getIn<NSV, K2: $KeyOf<V>>(keyPath: [K, K2], notSetValue: NSV): $ValOf<V, K2> | NSV;
74
- getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(keyPath: [K, K2, K3], notSetValue: NSV): $ValOf<$ValOf<V, K2>, K3> | NSV;
75
- 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;
76
- 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;
77
105
 
78
106
  update<U>(updater: (value: this) => U): U;
79
107
 
80
108
  toJS(): Array<any> | { [key: string]: mixed };
81
109
  toJSON(): Array<V> | { [key: string]: V };
82
- toArray(): Array<V> | Array<[K,V]>;
110
+ toArray(): Array<V> | Array<[K, V]>;
83
111
  toObject(): { [key: string]: V };
84
112
  toMap(): Map<K, V>;
85
113
  toOrderedMap(): OrderedMap<K, V>;
@@ -123,12 +151,24 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
123
151
  butLast(): this;
124
152
  skip(amount: number): this;
125
153
  skipLast(amount: number): this;
126
- skipWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
127
- 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;
128
162
  take(amount: number): this;
129
163
  takeLast(amount: number): this;
130
- takeWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): this;
131
- 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;
132
172
 
133
173
  filterNot(
134
174
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -138,27 +178,37 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
138
178
  reduce<R>(
139
179
  reducer: (reduction: R, value: V, key: K, iter: this) => R,
140
180
  initialReduction: R,
141
- context?: mixed,
142
- ): R;
143
- reduce<R>(
144
- reducer: (reduction: V | R, value: V, key: K, iter: this) => R
181
+ context?: mixed
145
182
  ): R;
183
+ reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;
146
184
 
147
185
  reduceRight<R>(
148
186
  reducer: (reduction: R, value: V, key: K, iter: this) => R,
149
187
  initialReduction: R,
150
- context?: mixed,
188
+ context?: mixed
151
189
  ): R;
152
190
  reduceRight<R>(
153
191
  reducer: (reduction: V | R, value: V, key: K, iter: this) => R
154
192
  ): R;
155
193
 
156
- every(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): boolean;
157
- 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;
158
202
  join(separator?: string): string;
159
203
  isEmpty(): boolean;
160
- count(predicate?: (value: V, key: K, iter: this) => mixed, context?: mixed): number;
161
- 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>;
162
212
 
163
213
  find<NSV>(
164
214
  predicate: (value: V, key: K, iter: this) => mixed,
@@ -172,10 +222,18 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
172
222
  ): V | NSV;
173
223
 
174
224
  findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
175
- 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;
176
228
 
177
- findKey(predicate: (value: V, key: K, iter: this) => mixed, context?: mixed): K | void;
178
- 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;
179
237
 
180
238
  keyOf(searchValue: V): K | void;
181
239
  lastKeyOf(searchValue: V): K | void;
@@ -195,21 +253,46 @@ declare class _Collection<K, +V> /*implements ValueObject*/ {
195
253
  isSuperset(iter: Iterable<V>): boolean;
196
254
  }
197
255
 
198
- declare function isImmutable(maybeImmutable: mixed): boolean %checks(maybeImmutable instanceof Collection);
199
- declare function isCollection(maybeCollection: mixed): boolean %checks(maybeCollection instanceof Collection);
200
- declare function isKeyed(maybeKeyed: mixed): boolean %checks(maybeKeyed instanceof KeyedCollection);
201
- declare function isIndexed(maybeIndexed: mixed): boolean %checks(maybeIndexed instanceof IndexedCollection);
202
- declare function isAssociative(maybeAssociative: mixed): boolean %checks(
203
- maybeAssociative instanceof KeyedCollection ||
204
- maybeAssociative instanceof IndexedCollection
205
- );
206
- declare function isOrdered(maybeOrdered: mixed): boolean %checks(
207
- 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 ||
208
275
  maybeOrdered instanceof OrderedMap ||
209
- maybeOrdered instanceof OrderedSet
210
- );
276
+ maybeOrdered instanceof OrderedSet);
211
277
  declare function isValueObject(maybeValue: mixed): boolean;
212
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
+
213
296
  declare interface ValueObject {
214
297
  equals(other: mixed): boolean;
215
298
  hashCode(): number;
@@ -228,7 +311,9 @@ declare class Collection<K, +V> extends _Collection<K, V> {
228
311
  }
229
312
 
230
313
  declare class KeyedCollection<K, +V> extends Collection<K, V> {
231
- 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>;
232
317
 
233
318
  toJS(): { [key: string]: mixed };
234
319
  toJSON(): { [key: string]: V };
@@ -237,7 +322,9 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
237
322
  toSeq(): KeyedSeq<K, V>;
238
323
  flip(): KeyedCollection<V, K>;
239
324
 
240
- 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>;
241
328
 
242
329
  filter(predicate: typeof Boolean): KeyedCollection<K, $NonMaybeType<V>>;
243
330
  filter(
@@ -269,7 +356,7 @@ declare class KeyedCollection<K, +V> extends Collection<K, V> {
269
356
  flatten(shallow?: boolean): KeyedCollection<any, any>;
270
357
  }
271
358
 
272
- Collection.Keyed = KeyedCollection
359
+ Collection.Keyed = KeyedCollection;
273
360
 
274
361
  declare class IndexedCollection<+T> extends Collection<number, T> {
275
362
  static <T>(iter?: Iterable<T>): IndexedCollection<T>;
@@ -282,16 +369,9 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
282
369
  fromEntrySeq<K, V>(): KeyedSeq<K, V>;
283
370
  interpose(separator: T): this;
284
371
  interleave(...collections: Iterable<T>[]): this;
285
- splice(
286
- index: number,
287
- removeNum: number,
288
- ...values: T[]
289
- ): this;
372
+ splice(index: number, removeNum: number, ...values: T[]): this;
290
373
 
291
- zip<A>(
292
- a: Iterable<A>,
293
- ..._: []
294
- ): IndexedCollection<[T, A]>;
374
+ zip<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T, A]>;
295
375
  zip<A, B>(
296
376
  a: Iterable<A>,
297
377
  b: Iterable<B>,
@@ -319,28 +399,25 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
319
399
  ..._: []
320
400
  ): IndexedCollection<[T, A, B, C, D, E]>;
321
401
 
322
- zipAll<A>(
323
- a: Iterable<A>,
324
- ..._: []
325
- ): IndexedCollection<[T|void, A|void]>;
402
+ zipAll<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T | void, A | void]>;
326
403
  zipAll<A, B>(
327
404
  a: Iterable<A>,
328
405
  b: Iterable<B>,
329
406
  ..._: []
330
- ): IndexedCollection<[T|void, A|void, B|void]>;
407
+ ): IndexedCollection<[T | void, A | void, B | void]>;
331
408
  zipAll<A, B, C>(
332
409
  a: Iterable<A>,
333
410
  b: Iterable<B>,
334
411
  c: Iterable<C>,
335
412
  ..._: []
336
- ): IndexedCollection<[T|void, A|void, B|void, C|void]>;
413
+ ): IndexedCollection<[T | void, A | void, B | void, C | void]>;
337
414
  zipAll<A, B, C, D>(
338
415
  a: Iterable<A>,
339
416
  b: Iterable<B>,
340
417
  c: Iterable<C>,
341
418
  d: Iterable<D>,
342
419
  ..._: []
343
- ): IndexedCollection<[T|void, A|void, B|void, C|void, D|void]>;
420
+ ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>;
344
421
  zipAll<A, B, C, D, E>(
345
422
  a: Iterable<A>,
346
423
  b: Iterable<B>,
@@ -348,7 +425,9 @@ declare class IndexedCollection<+T> extends Collection<number, T> {
348
425
  d: Iterable<D>,
349
426
  e: Iterable<E>,
350
427
  ..._: []
351
- ): 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
+ >;
352
431
 
353
432
  zipWith<A, R>(
354
433
  zipper: (value: T, a: A) => R,
@@ -454,7 +533,8 @@ declare class SetCollection<+T> extends Collection<T, T> {
454
533
  flatten(shallow?: boolean): SetCollection<any>;
455
534
  }
456
535
 
457
- declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof Seq);
536
+ declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof
537
+ Seq);
458
538
  declare class Seq<K, +V> extends _Collection<K, V> {
459
539
  static Keyed: typeof KeyedSeq;
460
540
  static Indexed: typeof IndexedSeq;
@@ -473,12 +553,16 @@ declare class Seq<K, +V> extends _Collection<K, V> {
473
553
  }
474
554
 
475
555
  declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
476
- 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>;
477
559
 
478
560
  // Override specialized return types
479
561
  flip(): KeyedSeq<V, K>;
480
562
 
481
- 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>;
482
566
 
483
567
  filter(predicate: typeof Boolean): KeyedSeq<K, $NonMaybeType<V>>;
484
568
  filter(
@@ -510,7 +594,10 @@ declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
510
594
  flatten(shallow?: boolean): KeyedSeq<any, any>;
511
595
  }
512
596
 
513
- 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
+ {
514
601
  static <T>(values?: Iterable<T>): IndexedSeq<T>;
515
602
 
516
603
  static of<T>(...values: T[]): IndexedSeq<T>;
@@ -538,15 +625,8 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
538
625
  flatten(depth?: number): IndexedSeq<any>;
539
626
  flatten(shallow?: boolean): IndexedSeq<any>;
540
627
 
541
- zip<A>(
542
- a: Iterable<A>,
543
- ..._: []
544
- ): IndexedSeq<[T, A]>;
545
- zip<A, B>(
546
- a: Iterable<A>,
547
- b: Iterable<B>,
548
- ..._: []
549
- ): 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]>;
550
630
  zip<A, B, C>(
551
631
  a: Iterable<A>,
552
632
  b: Iterable<B>,
@@ -569,28 +649,25 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
569
649
  ..._: []
570
650
  ): IndexedSeq<[T, A, B, C, D, E]>;
571
651
 
572
- zipAll<A>(
573
- a: Iterable<A>,
574
- ..._: []
575
- ): IndexedSeq<[T|void, A|void]>;
652
+ zipAll<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T | void, A | void]>;
576
653
  zipAll<A, B>(
577
654
  a: Iterable<A>,
578
655
  b: Iterable<B>,
579
656
  ..._: []
580
- ): IndexedSeq<[T|void, A|void, B|void]>;
657
+ ): IndexedSeq<[T | void, A | void, B | void]>;
581
658
  zipAll<A, B, C>(
582
659
  a: Iterable<A>,
583
660
  b: Iterable<B>,
584
661
  c: Iterable<C>,
585
662
  ..._: []
586
- ): IndexedSeq<[T|void, A|void, B|void, C|void]>;
663
+ ): IndexedSeq<[T | void, A | void, B | void, C | void]>;
587
664
  zipAll<A, B, C, D>(
588
665
  a: Iterable<A>,
589
666
  b: Iterable<B>,
590
667
  c: Iterable<C>,
591
668
  d: Iterable<D>,
592
669
  ..._: []
593
- ): IndexedSeq<[T|void, A|void, B|void, C|void, D|void]>;
670
+ ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>;
594
671
  zipAll<A, B, C, D, E>(
595
672
  a: Iterable<A>,
596
673
  b: Iterable<B>,
@@ -598,7 +675,7 @@ declare class IndexedSeq<+T> extends Seq<number, T> mixins IndexedCollection<T>
598
675
  d: Iterable<D>,
599
676
  e: Iterable<E>,
600
677
  ..._: []
601
- ): 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]>;
602
679
 
603
680
  zipWith<A, R>(
604
681
  zipper: (value: T, a: A) => R,
@@ -670,40 +747,157 @@ declare class UpdatableInCollection<K, +V> {
670
747
  setIn<S>(keyPath: [], value: S): S;
671
748
  setIn(keyPath: [K], value: V): this;
672
749
  setIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], value: S): this;
673
- setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(keyPath: [K, K2, K3], value: S): this;
674
- 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;
675
- 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;
676
773
 
677
774
  deleteIn(keyPath: []): void;
678
775
  deleteIn(keyPath: [K]): this;
679
776
  deleteIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
680
- deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(keyPath: [K, K2, K3]): this;
681
- deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this;
682
- 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;
683
795
 
684
796
  removeIn(keyPath: []): void;
685
797
  removeIn(keyPath: [K]): this;
686
798
  removeIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
687
- removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(keyPath: [K, K2, K3]): this;
688
- removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this;
689
- 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;
690
817
 
691
818
  updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
692
819
  updateIn<U>(keyPath: [], updater: (value: this) => U): U;
693
820
  updateIn<NSV>(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this;
694
821
  updateIn(keyPath: [K], updater: (value: V) => V): this;
695
- updateIn<NSV, K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<V, K2> | NSV) => S): this;
696
- updateIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], updater: (value: $ValOf<V, K2>) => S): this;
697
- 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;
698
- 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;
699
- 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;
700
- 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;
701
- 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;
702
- 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;
703
893
  }
704
894
 
705
- declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof List);
706
- 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
+ {
707
901
  static (collection?: Iterable<T>): List<T>;
708
902
 
709
903
  static of<T>(...values: T[]): List<T>;
@@ -724,14 +918,21 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
724
918
 
725
919
  update<U>(updater: (value: this) => U): U;
726
920
  update<U>(index: number, updater: (value: T) => U): List<T | U>;
727
- 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>;
728
926
 
729
927
  merge<U>(...collections: Iterable<U>[]): List<T | U>;
730
928
 
731
929
  setSize(size: number): this;
732
930
 
733
931
  mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
734
- mergeDeepIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
932
+ mergeDeepIn(
933
+ keyPath: Iterable<mixed>,
934
+ ...collections: Iterable<mixed>[]
935
+ ): this;
735
936
 
736
937
  withMutations(mutator: (mutable: this) => mixed): this;
737
938
  asMutable(): this;
@@ -761,15 +962,8 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
761
962
  flatten(depth?: number): List<any>;
762
963
  flatten(shallow?: boolean): List<any>;
763
964
 
764
- zip<A>(
765
- a: Iterable<A>,
766
- ..._: []
767
- ): List<[T, A]>;
768
- zip<A, B>(
769
- a: Iterable<A>,
770
- b: Iterable<B>,
771
- ..._: []
772
- ): 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]>;
773
967
  zip<A, B, C>(
774
968
  a: Iterable<A>,
775
969
  b: Iterable<B>,
@@ -792,28 +986,25 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
792
986
  ..._: []
793
987
  ): List<[T, A, B, C, D, E]>;
794
988
 
795
- zipAll<A>(
796
- a: Iterable<A>,
797
- ..._: []
798
- ): List<[T|void, A|void]>;
989
+ zipAll<A>(a: Iterable<A>, ..._: []): List<[T | void, A | void]>;
799
990
  zipAll<A, B>(
800
991
  a: Iterable<A>,
801
992
  b: Iterable<B>,
802
993
  ..._: []
803
- ): List<[T|void, A|void, B|void]>;
994
+ ): List<[T | void, A | void, B | void]>;
804
995
  zipAll<A, B, C>(
805
996
  a: Iterable<A>,
806
997
  b: Iterable<B>,
807
998
  c: Iterable<C>,
808
999
  ..._: []
809
- ): List<[T|void, A|void, B|void, C|void]>;
1000
+ ): List<[T | void, A | void, B | void, C | void]>;
810
1001
  zipAll<A, B, C, D>(
811
1002
  a: Iterable<A>,
812
1003
  b: Iterable<B>,
813
1004
  c: Iterable<C>,
814
1005
  d: Iterable<D>,
815
1006
  ..._: []
816
- ): List<[T|void, A|void, B|void, C|void, D|void]>;
1007
+ ): List<[T | void, A | void, B | void, C | void, D | void]>;
817
1008
  zipAll<A, B, C, D, E>(
818
1009
  a: Iterable<A>,
819
1010
  b: Iterable<B>,
@@ -821,7 +1012,7 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
821
1012
  d: Iterable<D>,
822
1013
  e: Iterable<E>,
823
1014
  ..._: []
824
- ): 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]>;
825
1016
 
826
1017
  zipWith<A, R>(
827
1018
  zipper: (value: T, a: A) => R,
@@ -860,8 +1051,12 @@ declare class List<+T> extends IndexedCollection<T> mixins UpdatableInCollection
860
1051
  ): List<R>;
861
1052
  }
862
1053
 
863
- declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof Map);
864
- 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
+ {
865
1060
  static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): Map<K, V>;
866
1061
 
867
1062
  static isMap: typeof isMap;
@@ -878,7 +1073,11 @@ declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollect
878
1073
 
879
1074
  update<U>(updater: (value: this) => U): U;
880
1075
  update<V_>(key: K, updater: (value: V) => V_): Map<K, V | V_>;
881
- 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_>;
882
1081
 
883
1082
  merge<K_, V_>(
884
1083
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
@@ -896,10 +1095,10 @@ declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollect
896
1095
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
897
1096
  ): Map<K | K_, V | V_>;
898
1097
 
899
- mergeDeepWith<K_, W, X>(
900
- merger: (oldVal: V, newVal: W, key: K) => X,
901
- ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
902
- ): 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_>;
903
1102
 
904
1103
  mergeIn(
905
1104
  keyPath: Iterable<mixed>,
@@ -949,9 +1148,16 @@ declare class Map<K, +V> extends KeyedCollection<K, V> mixins UpdatableInCollect
949
1148
  flatten(shallow?: boolean): Map<any, any>;
950
1149
  }
951
1150
 
952
- declare function isOrderedMap(maybeOrderedMap: mixed): boolean %checks(maybeOrderedMap instanceof OrderedMap);
953
- declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K, V> {
954
- 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>;
955
1161
 
956
1162
  static isOrderedMap: typeof isOrderedMap;
957
1163
 
@@ -964,7 +1170,11 @@ declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K
964
1170
 
965
1171
  update<U>(updater: (value: this) => U): U;
966
1172
  update<V_>(key: K, updater: (value: V) => V_): OrderedMap<K, V | V_>;
967
- 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_>;
968
1178
 
969
1179
  merge<K_, V_>(
970
1180
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
@@ -982,10 +1192,10 @@ declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K
982
1192
  ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
983
1193
  ): OrderedMap<K | K_, V | V_>;
984
1194
 
985
- mergeDeepWith<K_, W, X>(
986
- merger: (oldVal: V, newVal: W, key: K) => X,
987
- ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
988
- ): 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_>;
989
1199
 
990
1200
  mergeIn(
991
1201
  keyPath: Iterable<mixed>,
@@ -1035,12 +1245,15 @@ declare class OrderedMap<K, +V> extends Map<K, V> mixins UpdatableInCollection<K
1035
1245
  flatten(shallow?: boolean): OrderedMap<any, any>;
1036
1246
  }
1037
1247
 
1038
- declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof Set);
1248
+ declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof
1249
+ Set);
1039
1250
  declare class Set<+T> extends SetCollection<T> {
1040
1251
  static <T>(values?: Iterable<T>): Set<T>;
1041
1252
 
1042
1253
  static of<T>(...values: T[]): Set<T>;
1043
- 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>;
1044
1257
 
1045
1258
  static intersect(sets: Iterable<Iterable<T>>): Set<T>;
1046
1259
  static union(sets: Iterable<Iterable<T>>): Set<T>;
@@ -1087,12 +1300,16 @@ declare class Set<+T> extends SetCollection<T> {
1087
1300
  }
1088
1301
 
1089
1302
  // Overrides except for `isOrderedSet` are for specialized return types
1090
- declare function isOrderedSet(maybeOrderedSet: mixed): boolean %checks(maybeOrderedSet instanceof OrderedSet);
1303
+ declare function isOrderedSet(
1304
+ maybeOrderedSet: mixed
1305
+ ): boolean %checks(maybeOrderedSet instanceof OrderedSet);
1091
1306
  declare class OrderedSet<+T> extends Set<T> {
1092
1307
  static <T>(values?: Iterable<T>): OrderedSet<T>;
1093
1308
 
1094
1309
  static of<T>(...values: T[]): OrderedSet<T>;
1095
- 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>;
1096
1313
 
1097
1314
  static isOrderedSet: typeof isOrderedSet;
1098
1315
 
@@ -1123,15 +1340,8 @@ declare class OrderedSet<+T> extends Set<T> {
1123
1340
  flatten(depth?: number): OrderedSet<any>;
1124
1341
  flatten(shallow?: boolean): OrderedSet<any>;
1125
1342
 
1126
- zip<A>(
1127
- a: Iterable<A>,
1128
- ..._: []
1129
- ): OrderedSet<[T, A]>;
1130
- zip<A, B>(
1131
- a: Iterable<A>,
1132
- b: Iterable<B>,
1133
- ..._: []
1134
- ): 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]>;
1135
1345
  zip<A, B, C>(
1136
1346
  a: Iterable<A>,
1137
1347
  b: Iterable<B>,
@@ -1154,28 +1364,25 @@ declare class OrderedSet<+T> extends Set<T> {
1154
1364
  ..._: []
1155
1365
  ): OrderedSet<[T, A, B, C, D, E]>;
1156
1366
 
1157
- zipAll<A>(
1158
- a: Iterable<A>,
1159
- ..._: []
1160
- ): OrderedSet<[T|void, A|void]>;
1367
+ zipAll<A>(a: Iterable<A>, ..._: []): OrderedSet<[T | void, A | void]>;
1161
1368
  zipAll<A, B>(
1162
1369
  a: Iterable<A>,
1163
1370
  b: Iterable<B>,
1164
1371
  ..._: []
1165
- ): OrderedSet<[T|void, A|void, B|void]>;
1372
+ ): OrderedSet<[T | void, A | void, B | void]>;
1166
1373
  zipAll<A, B, C>(
1167
1374
  a: Iterable<A>,
1168
1375
  b: Iterable<B>,
1169
1376
  c: Iterable<C>,
1170
1377
  ..._: []
1171
- ): OrderedSet<[T|void, A|void, B|void, C|void]>;
1378
+ ): OrderedSet<[T | void, A | void, B | void, C | void]>;
1172
1379
  zipAll<A, B, C, D>(
1173
1380
  a: Iterable<A>,
1174
1381
  b: Iterable<B>,
1175
1382
  c: Iterable<C>,
1176
1383
  d: Iterable<D>,
1177
1384
  ..._: []
1178
- ): OrderedSet<[T|void, A|void, B|void, C|void, D|void]>;
1385
+ ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>;
1179
1386
  zipAll<A, B, C, D, E>(
1180
1387
  a: Iterable<A>,
1181
1388
  b: Iterable<B>,
@@ -1183,7 +1390,7 @@ declare class OrderedSet<+T> extends Set<T> {
1183
1390
  d: Iterable<D>,
1184
1391
  e: Iterable<E>,
1185
1392
  ..._: []
1186
- ): 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]>;
1187
1394
 
1188
1395
  zipWith<A, R>(
1189
1396
  zipper: (value: T, a: A) => R,
@@ -1222,7 +1429,9 @@ declare class OrderedSet<+T> extends Set<T> {
1222
1429
  ): OrderedSet<R>;
1223
1430
  }
1224
1431
 
1225
- declare function isStack(maybeStack: mixed): boolean %checks(maybeStack instanceof Stack);
1432
+ declare function isStack(
1433
+ maybeStack: mixed
1434
+ ): boolean %checks(maybeStack instanceof Stack);
1226
1435
  declare class Stack<+T> extends IndexedCollection<T> {
1227
1436
  static <T>(collection?: Iterable<T>): Stack<T>;
1228
1437
 
@@ -1270,15 +1479,8 @@ declare class Stack<+T> extends IndexedCollection<T> {
1270
1479
  flatten(depth?: number): Stack<any>;
1271
1480
  flatten(shallow?: boolean): Stack<any>;
1272
1481
 
1273
- zip<A>(
1274
- a: Iterable<A>,
1275
- ..._: []
1276
- ): Stack<[T, A]>;
1277
- zip<A, B>(
1278
- a: Iterable<A>,
1279
- b: Iterable<B>,
1280
- ..._: []
1281
- ): 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]>;
1282
1484
  zip<A, B, C>(
1283
1485
  a: Iterable<A>,
1284
1486
  b: Iterable<B>,
@@ -1301,28 +1503,25 @@ declare class Stack<+T> extends IndexedCollection<T> {
1301
1503
  ..._: []
1302
1504
  ): Stack<[T, A, B, C, D, E]>;
1303
1505
 
1304
- zipAll<A>(
1305
- a: Iterable<A>,
1306
- ..._: []
1307
- ): Stack<[T|void, A|void]>;
1506
+ zipAll<A>(a: Iterable<A>, ..._: []): Stack<[T | void, A | void]>;
1308
1507
  zipAll<A, B>(
1309
1508
  a: Iterable<A>,
1310
1509
  b: Iterable<B>,
1311
1510
  ..._: []
1312
- ): Stack<[T|void, A|void, B|void]>;
1511
+ ): Stack<[T | void, A | void, B | void]>;
1313
1512
  zipAll<A, B, C>(
1314
1513
  a: Iterable<A>,
1315
1514
  b: Iterable<B>,
1316
1515
  c: Iterable<C>,
1317
1516
  ..._: []
1318
- ): Stack<[T|void, A|void, B|void, C|void]>;
1517
+ ): Stack<[T | void, A | void, B | void, C | void]>;
1319
1518
  zipAll<A, B, C, D>(
1320
1519
  a: Iterable<A>,
1321
1520
  b: Iterable<B>,
1322
1521
  c: Iterable<C>,
1323
1522
  d: Iterable<D>,
1324
1523
  ..._: []
1325
- ): Stack<[T|void, A|void, B|void, C|void, D|void]>;
1524
+ ): Stack<[T | void, A | void, B | void, C | void, D | void]>;
1326
1525
  zipAll<A, B, C, D, E>(
1327
1526
  a: Iterable<A>,
1328
1527
  b: Iterable<B>,
@@ -1330,7 +1529,7 @@ declare class Stack<+T> extends IndexedCollection<T> {
1330
1529
  d: Iterable<D>,
1331
1530
  e: Iterable<E>,
1332
1531
  ..._: []
1333
- ): 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]>;
1334
1533
 
1335
1534
  zipWith<A, R>(
1336
1535
  zipper: (value: T, a: A) => R,
@@ -1369,106 +1568,328 @@ declare class Stack<+T> extends IndexedCollection<T> {
1369
1568
  ): Stack<R>;
1370
1569
  }
1371
1570
 
1372
- 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>;
1373
1576
  declare function Repeat<T>(value: T, times?: number): IndexedSeq<T>;
1374
1577
 
1375
1578
  // The type of a Record factory function.
1376
1579
  type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
1377
1580
 
1378
1581
  // The type of runtime Record instances.
1379
- type RecordOf<Values: Object> = RecordInstance<Values> & Values;
1582
+ type RecordOf<Values: Object> = RecordInstance<Values> & $ReadOnly<Values>;
1380
1583
 
1381
1584
  // The values of a Record instance.
1382
1585
  type _RecordValues<T, R: RecordInstance<T> | T> = R;
1383
1586
  type RecordValues<R> = _RecordValues<*, R>;
1384
1587
 
1385
- declare function isRecord(maybeRecord: any): boolean %checks(maybeRecord instanceof RecordInstance);
1588
+ declare function isRecord(
1589
+ maybeRecord: any
1590
+ ): boolean %checks(maybeRecord instanceof RecordInstance);
1386
1591
  declare class Record {
1387
- static <Values: Object>(spec: Values, name?: string): RecordFactory<Values>;
1388
- 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;
1389
1597
 
1390
1598
  static isRecord: typeof isRecord;
1391
1599
 
1392
1600
  static getDescriptiveName(record: RecordInstance<any>): string;
1393
1601
  }
1394
1602
 
1395
- declare class RecordInstance<T: Object> {
1603
+ declare class RecordInstance<T: Object = Object> {
1396
1604
  static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>;
1397
1605
  // Note: a constructor can only create an instance of RecordInstance<T>,
1398
1606
  // it's encouraged to not use `new` when creating Records.
1399
- constructor (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
1607
+ constructor(values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
1400
1608
 
1401
1609
  size: number;
1402
1610
 
1403
1611
  has(key: string): boolean;
1404
- 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;
1405
1615
 
1406
1616
  hasIn(keyPath: Iterable<mixed>): boolean;
1407
1617
 
1408
- getIn(keyPath: [], notSetValue?: mixed): this & T;
1618
+ getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly<T>;
1409
1619
  getIn<K: $Keys<T>>(keyPath: [K], notSetValue?: mixed): $ElementType<T, K>;
1410
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(keyPath: [K, K2], notSetValue: NSV): $ValOf<$ValOf<T, K>, K2> | NSV;
1411
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>>(keyPath: [K, K2, K3], notSetValue: NSV): $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV;
1412
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>>(keyPath: [K, K2, K3, K4], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV;
1413
- getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>>(keyPath: [K, K2, K3, K4, K5], notSetValue: NSV): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<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;
1414
1654
 
1415
1655
  equals(other: any): boolean;
1416
1656
  hashCode(): number;
1417
1657
 
1418
- set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & T;
1419
- update<K: $Keys<T>>(key: K, updater: (value: $ElementType<T, K>) => $ElementType<T, K>): this & T;
1420
- merge(...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>): this & T;
1421
- mergeDeep(...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>): 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>;
1422
1669
 
1423
1670
  mergeWith(
1424
1671
  merger: (oldVal: $ValOf<T>, newVal: $ValOf<T>, key: $Keys<T>) => $ValOf<T>,
1425
1672
  ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1426
- ): this & T;
1673
+ ): this & $ReadOnly<T>;
1427
1674
  mergeDeepWith(
1428
1675
  merger: (oldVal: any, newVal: any, key: any) => any,
1429
1676
  ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
1430
- ): this & T;
1677
+ ): this & $ReadOnly<T>;
1431
1678
 
1432
- delete<K: $Keys<T>>(key: K): this & T;
1433
- remove<K: $Keys<T>>(key: K): this & T;
1434
- 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>;
1435
1682
 
1436
1683
  setIn<S>(keyPath: [], value: S): S;
1437
- setIn<K: $Keys<T>, S: $ValOf<T, K>>(keyPath: [K], value: S): this & T;
1438
- setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(keyPath: [K, K2], value: S): this & T;
1439
- setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>(keyPath: [K, K2, K3], value: S): this & T;
1440
- setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], value: S): this & T;
1441
- setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<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>;
1442
1722
 
1443
1723
  deleteIn(keyPath: []): void;
1444
- deleteIn<K: $Keys<T>>(keyPath: [K]): this & T;
1445
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(keyPath: [K, K2]): this & T;
1446
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>>(keyPath: [K, K2, K3]): this & T;
1447
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this & T;
1448
- deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<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>;
1449
1752
 
1450
1753
  removeIn(keyPath: []): void;
1451
- removeIn<K: $Keys<T>>(keyPath: [K]): this & T;
1452
- removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(keyPath: [K, K2]): this & T;
1453
- removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>>(keyPath: [K, K2, K3]): this & T;
1454
- removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>>(keyPath: [K, K2, K3, K4]): this & T;
1455
- removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<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>;
1456
1884
 
1457
- updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
1458
- updateIn<U>(keyPath: [], updater: (value: this) => U): U;
1459
- updateIn<NSV, K: $Keys<T>, S: $ValOf<T, K>>(keyPath: [K], notSetValue: NSV, updater: (value: $ValOf<T, K>) => S): this & T;
1460
- updateIn<K: $Keys<T>, S: $ValOf<T, K>>(keyPath: [K], updater: (value: $ValOf<T, K>) => S): this & T;
1461
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ValOf<T, K>, K2> | NSV) => S): this & T;
1462
- updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(keyPath: [K, K2], updater: (value: $ValOf<$ValOf<T, K>, K2>) => S): this & T;
1463
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>(keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV) => S): this & T;
1464
- updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>(keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>) => S): this & T;
1465
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV) => S): this & T;
1466
- updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>(keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>) => S): this & T;
1467
- updateIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV) => S): this & T;
1468
- updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>>(keyPath: [K, K2, K3, K4, K5], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>) => S): this & T;
1469
-
1470
- mergeIn(keyPath: Iterable<mixed>, ...collections: Array<any>): this & T;
1471
- 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>;
1472
1893
 
1473
1894
  toSeq(): KeyedSeq<$Keys<T>, any>;
1474
1895
 
@@ -1476,10 +1897,10 @@ declare class RecordInstance<T: Object> {
1476
1897
  toJSON(): T;
1477
1898
  toObject(): T;
1478
1899
 
1479
- withMutations(mutator: (mutable: this) => mixed): this & T;
1480
- asMutable(): this & T;
1900
+ withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly<T>;
1901
+ asMutable(): this & $ReadOnly<T>;
1481
1902
  wasAltered(): boolean;
1482
- asImmutable(): this & T;
1903
+ asImmutable(): this & $ReadOnly<T>;
1483
1904
 
1484
1905
  @@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;
1485
1906
  }
@@ -1491,79 +1912,346 @@ declare function fromJS(
1491
1912
  sequence: KeyedCollection<string, mixed> | IndexedCollection<mixed>,
1492
1913
  path?: Array<string | number>
1493
1914
  ) => mixed
1494
- ): mixed;
1915
+ ): Collection<mixed, mixed>;
1495
1916
 
1496
1917
  declare function is(first: mixed, second: mixed): boolean;
1497
1918
  declare function hash(value: mixed): number;
1498
1919
 
1499
- declare function get<C: Object, K: $Keys<C>>(collection: C, key: K, notSetValue: mixed): $ValOf<C, K>;
1500
- 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;
1501
1930
 
1502
1931
  declare function has(collection: Object, key: mixed): boolean;
1503
1932
  declare function remove<C>(collection: C, key: $KeyOf<C>): C;
1504
- declare function set<C, K: $KeyOf<C>, V: $ValOf<C, K>>(collection: C, key: K, value: V): C;
1505
- 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;
1506
- 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;
1507
1949
 
1508
1950
  declare function getIn<C>(collection: C, keyPath: [], notSetValue?: mixed): C;
1509
- declare function getIn<C, K: $KeyOf<C>, NSV>(collection: C, keyPath: [K], notSetValue: NSV): $ValOf<C, K> | NSV;
1510
- 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;
1511
- 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;
1512
- 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;
1513
- 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;
1514
1997
 
1515
1998
  declare function hasIn(collection: Object, keyPath: Iterable<mixed>): boolean;
1516
1999
 
1517
2000
  declare function removeIn<C>(collection: C, keyPath: []): void;
1518
2001
  declare function removeIn<C, K: $KeyOf<C>>(collection: C, keyPath: [K]): C;
1519
- declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>>(collection: C, keyPath: [K, K2]): C;
1520
- declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>, K3: $KeyOf<$ValOf<$ValOf<C>, K2>>>(collection: C, keyPath: [K, K2, K3]): C;
1521
- 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;
1522
- 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>>>(
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;
1523
2036
 
1524
2037
  declare function setIn<S>(collection: Object, keyPath: [], value: S): S;
1525
- declare function setIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(collection: C, keyPath: [K], value: S): C;
1526
- 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;
1527
- 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;
1528
- 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;
1529
- 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;
1530
-
1531
- declare function updateIn<C, S>(collection: C, keyPath: [], notSetValue: mixed, updater: (value: C) => S): S;
1532
- declare function updateIn<C, S>(collection: C, keyPath: [], updater: (value: C) => S): S;
1533
- 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;
1534
- declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(collection: C, keyPath: [K], updater: (value: $ValOf<C, K>) => S): C;
1535
- 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;
1536
- 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;
1537
- 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;
1538
- 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;
1539
- 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;
1540
- 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;
1541
- 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;
1542
- 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;
1543
2216
 
1544
2217
  declare function merge<C>(
1545
2218
  collection: C,
1546
- ...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2219
+ ...collections: Array<
2220
+ | $IterableOf<C>
2221
+ | $Shape<RecordValues<C>>
2222
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2223
+ >
1547
2224
  ): C;
1548
2225
  declare function mergeWith<C>(
1549
2226
  merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>,
1550
2227
  collection: C,
1551
- ...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2228
+ ...collections: Array<
2229
+ | $IterableOf<C>
2230
+ | $Shape<RecordValues<C>>
2231
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2232
+ >
1552
2233
  ): C;
1553
2234
  declare function mergeDeep<C>(
1554
2235
  collection: C,
1555
- ...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2236
+ ...collections: Array<
2237
+ | $IterableOf<C>
2238
+ | $Shape<RecordValues<C>>
2239
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2240
+ >
1556
2241
  ): C;
1557
2242
  declare function mergeDeepWith<C>(
1558
2243
  merger: (oldVal: any, newVal: any, key: any) => mixed,
1559
2244
  collection: C,
1560
- ...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
2245
+ ...collections: Array<
2246
+ | $IterableOf<C>
2247
+ | $Shape<RecordValues<C>>
2248
+ | PlainObjInput<$KeyOf<C>, $ValOf<C>>
2249
+ >
1561
2250
  ): C;
1562
2251
 
1563
2252
  export {
1564
2253
  Collection,
1565
2254
  Seq,
1566
-
1567
2255
  List,
1568
2256
  Map,
1569
2257
  OrderedMap,
@@ -1573,11 +2261,9 @@ export {
1573
2261
  Record,
1574
2262
  Set,
1575
2263
  Stack,
1576
-
1577
2264
  fromJS,
1578
2265
  is,
1579
2266
  hash,
1580
-
1581
2267
  isImmutable,
1582
2268
  isCollection,
1583
2269
  isKeyed,
@@ -1586,7 +2272,6 @@ export {
1586
2272
  isOrdered,
1587
2273
  isRecord,
1588
2274
  isValueObject,
1589
-
1590
2275
  get,
1591
2276
  has,
1592
2277
  remove,
@@ -1601,7 +2286,7 @@ export {
1601
2286
  mergeWith,
1602
2287
  mergeDeep,
1603
2288
  mergeDeepWith,
1604
- }
2289
+ };
1605
2290
 
1606
2291
  export default {
1607
2292
  Collection,
@@ -1644,7 +2329,7 @@ export default {
1644
2329
  mergeWith,
1645
2330
  mergeDeep,
1646
2331
  mergeDeepWith,
1647
- }
2332
+ };
1648
2333
 
1649
2334
  export type {
1650
2335
  KeyedCollection,
@@ -1655,8 +2340,8 @@ export type {
1655
2340
  SetSeq,
1656
2341
  RecordFactory,
1657
2342
  RecordOf,
2343
+ RecordInstance,
1658
2344
  ValueObject,
1659
-
1660
2345
  $KeyOf,
1661
2346
  $ValOf,
1662
- }
2347
+ };