/** * This file provides type definitions for use with the Flow type checker. * * An important caveat when using these definitions is that the types for * `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs. * When referring to those types, you can get the proper definitions by * importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc. * For example, * * import { Seq } from 'immutable' * import type { IndexedCollection, IndexedSeq } from 'immutable' * * const someSeq: IndexedSeq = Seq.Indexed.of(1, 2, 3) * * function takesASeq>(iter: TS): TS { * return iter.butLast() * } * * takesASeq(someSeq) * * @flow strict */ // Helper type that represents plain objects allowed as arguments to // some constructors and functions. type PlainObjInput = { +[key: K]: V, __proto__: null }; type K = $Keys; // Helper types to extract the "keys" and "values" use by the *In() methods. type $KeyOf = $Call< ((?_Collection) => K) & ((?$ReadOnlyArray) => number) & ((?RecordInstance | T) => $Keys) & ((T) => $Keys), C >; type $ValOf> = $Call< ((?_Collection) => V) & ((?$ReadOnlyArray) => T) & (>(?RecordInstance | T, K) => $ElementType) & ((T) => $Values), C, K >; type $IterableOf = $Call< ( | IndexedCollection | SetCollection>( V ) => Iterable<$ValOf>) & (< V: | KeyedCollection | RecordInstance | PlainObjInput >( V ) => Iterable<[$KeyOf, $ValOf]>), C >; const PairSorting: $ReadOnly<{ LeftThenRight: number, RightThenLeft: number }> = { LeftThenRight: -1, RightThenLeft: +1, }; type Comparator = (left: T, right: T) => number; declare class _Collection implements ValueObject { equals(other: mixed): boolean; hashCode(): number; get(key: K, ..._: []): V | void; get(key: K, notSetValue: NSV): V | NSV; has(key: K): boolean; includes(value: V): boolean; contains(value: V): boolean; first(notSetValue?: NSV): V | NSV; last(notSetValue?: NSV): V | NSV; hasIn(keyPath: Iterable): boolean; getIn(keyPath: [], notSetValue?: mixed): this; getIn(keyPath: [K], notSetValue: NSV): V | NSV; getIn>( keyPath: [K, K2], notSetValue: NSV ): $ValOf | NSV; getIn, K3: $KeyOf<$ValOf>>( keyPath: [K, K2, K3], notSetValue: NSV ): $ValOf<$ValOf, K3> | NSV; getIn< NSV, K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>> >( keyPath: [K, K2, K3, K4], notSetValue: NSV ): $ValOf<$ValOf<$ValOf, K3>, K4> | NSV; getIn< NSV, K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV; update(updater: (value: this) => U): U; toJS(): Array | { [key: string]: mixed }; toJSON(): Array | { [key: string]: V }; toArray(): Array | Array<[K, V]>; toObject(): { [key: string]: V }; toMap(): Map; toOrderedMap(): OrderedMap; toSet(): Set; toOrderedSet(): OrderedSet; toList(): List; toStack(): Stack; toSeq(): Seq; toKeyedSeq(): KeyedSeq; toIndexedSeq(): IndexedSeq; toSetSeq(): SetSeq; keys(): Iterator; values(): Iterator; entries(): Iterator<[K, V]>; keySeq(): IndexedSeq; valueSeq(): IndexedSeq; entrySeq(): IndexedSeq<[K, V]>; reverse(): this; sort(comparator?: Comparator): this; sortBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator ): this; groupBy( grouper: (value: V, key: K, iter: this) => G, context?: mixed ): KeyedSeq; forEach( sideEffect: (value: V, key: K, iter: this) => any, context?: mixed ): number; slice(begin?: number, end?: number): this; rest(): this; butLast(): this; skip(amount: number): this; skipLast(amount: number): this; skipWhile( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; skipUntil( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; take(amount: number): this; takeLast(amount: number): this; takeWhile( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; takeUntil( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; filterNot( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): this; reduce( reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: mixed ): R; reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; reduceRight( reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: mixed ): R; reduceRight( reducer: (reduction: V | R, value: V, key: K, iter: this) => R ): R; every( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): boolean; some( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): boolean; join(separator?: string): string; isEmpty(): boolean; count( predicate?: (value: V, key: K, iter: this) => mixed, context?: mixed ): number; countBy( grouper: (value: V, key: K, iter: this) => G, context?: mixed ): Map; find( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed, notSetValue?: NSV ): V | NSV; findLast( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed, notSetValue?: NSV ): V | NSV; findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void; findLastEntry( predicate: (value: V, key: K, iter: this) => mixed ): [K, V] | void; findKey( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): K | void; findLastKey( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): K | void; keyOf(searchValue: V): K | void; lastKeyOf(searchValue: V): K | void; max(comparator?: Comparator): V; maxBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator ): V; min(comparator?: Comparator): V; minBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: Comparator ): V; isSubset(iter: Iterable): boolean; isSuperset(iter: Iterable): boolean; } declare function isImmutable( maybeImmutable: mixed ): boolean %checks(maybeImmutable instanceof Collection); declare function isCollection( maybeCollection: mixed ): boolean %checks(maybeCollection instanceof Collection); declare function isKeyed( maybeKeyed: mixed ): boolean %checks(maybeKeyed instanceof KeyedCollection); declare function isIndexed( maybeIndexed: mixed ): boolean %checks(maybeIndexed instanceof IndexedCollection); declare function isAssociative( maybeAssociative: mixed ): boolean %checks(maybeAssociative instanceof KeyedCollection || maybeAssociative instanceof IndexedCollection); declare function isOrdered( maybeOrdered: mixed ): boolean %checks(maybeOrdered instanceof IndexedCollection || maybeOrdered instanceof OrderedMap || maybeOrdered instanceof OrderedSet); declare function isValueObject(maybeValue: mixed): boolean; declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq); declare function isList(maybeList: any): boolean %checks(maybeList instanceof List); declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map); declare function isOrderedMap( maybeOrderedMap: any ): boolean %checks(maybeOrderedMap instanceof OrderedMap); declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof Stack); declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set); declare function isOrderedSet( maybeOrderedSet: any ): boolean %checks(maybeOrderedSet instanceof OrderedSet); declare function isRecord( maybeRecord: any ): boolean %checks(maybeRecord instanceof Record); declare interface ValueObject { equals(other: mixed): boolean; hashCode(): number; } declare class Collection extends _Collection { static Keyed: typeof KeyedCollection; static Indexed: typeof IndexedCollection; static Set: typeof SetCollection; static isCollection: typeof isCollection; static isKeyed: typeof isKeyed; static isIndexed: typeof isIndexed; static isAssociative: typeof isAssociative; static isOrdered: typeof isOrdered; } declare class KeyedCollection extends Collection { static ( values?: Iterable<[K, V]> | PlainObjInput ): KeyedCollection; toJS(): { [key: string]: mixed }; toJSON(): { [key: string]: V }; toArray(): Array<[K, V]>; @@iterator(): Iterator<[K, V]>; toSeq(): KeyedSeq; flip(): KeyedCollection; concat( ...iters: Array | PlainObjInput> ): KeyedCollection; filter(predicate: typeof Boolean): KeyedCollection>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): KeyedCollection; partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): KeyedCollection; mapKeys( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): KeyedCollection; mapEntries( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): KeyedCollection; flatMap( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): KeyedCollection; flatten(depth?: number): KeyedCollection; flatten(shallow?: boolean): KeyedCollection; } Collection.Keyed = KeyedCollection; declare class IndexedCollection<+T> extends Collection { static (iter?: Iterable): IndexedCollection; toJS(): Array; toJSON(): Array; toArray(): Array; @@iterator(): Iterator; toSeq(): IndexedSeq; fromEntrySeq(): KeyedSeq; interpose(separator: T): this; interleave(...collections: Iterable[]): this; splice(index: number, removeNum: number, ...values: T[]): this; zip(a: Iterable, ..._: []): IndexedCollection<[T, A]>; zip( a: Iterable, b: Iterable, ..._: [] ): IndexedCollection<[T, A, B]>; zip( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): IndexedCollection<[T, A, B, C]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): IndexedCollection<[T, A, B, C, D]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): IndexedCollection<[T, A, B, C, D, E]>; zipAll(a: Iterable, ..._: []): IndexedCollection<[T | void, A | void]>; zipAll( a: Iterable, b: Iterable, ..._: [] ): IndexedCollection<[T | void, A | void, B | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): IndexedCollection<[T | void, A | void, B | void, C | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): IndexedCollection< [T | void, A | void, B | void, C | void, D | void, E | void] >; zipWith( zipper: (value: T, a: A) => R, a: Iterable, ..._: [] ): IndexedCollection; zipWith( zipper: (value: T, a: A, b: B) => R, a: Iterable, b: Iterable, ..._: [] ): IndexedCollection; zipWith( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable, b: Iterable, c: Iterable, ..._: [] ): IndexedCollection; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): IndexedCollection; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): IndexedCollection; indexOf(searchValue: T): number; lastIndexOf(searchValue: T): number; findIndex( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): number; findLastIndex( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): number; concat(...iters: Array | C>): IndexedCollection; filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): IndexedCollection; partition( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): IndexedCollection; flatMap( mapper: (value: T, index: number, iter: this) => Iterable, context?: mixed ): IndexedCollection; flatten(depth?: number): IndexedCollection; flatten(shallow?: boolean): IndexedCollection; } declare class SetCollection<+T> extends Collection { static (iter?: Iterable): SetCollection; toJS(): Array; toJSON(): Array; toArray(): Array; @@iterator(): Iterator; toSeq(): SetSeq; concat(...collections: Iterable[]): SetCollection; // `filter`, `map` and `flatMap` cannot be defined further up the hierarchy, // because the implementation for `KeyedCollection` allows the value type to // change without constraining the key type. That does not work for // `SetCollection` - the value and key types *must* match. filter(predicate: typeof Boolean): SetCollection<$NonMaybeType>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): SetCollection; partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): SetCollection; flatMap( mapper: (value: T, value: T, iter: this) => Iterable, context?: mixed ): SetCollection; flatten(depth?: number): SetCollection; flatten(shallow?: boolean): SetCollection; } declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof Seq); declare class Seq extends _Collection { static Keyed: typeof KeyedSeq; static Indexed: typeof IndexedSeq; static Set: typeof SetSeq; static (values: KeyedSeq): KeyedSeq; static (values: SetSeq): SetSeq; static (values: Iterable): IndexedSeq; static (values?: PlainObjInput): KeyedSeq; static isSeq: typeof isSeq; size: number | void; cacheResult(): this; toSeq(): this; } declare class KeyedSeq extends Seq mixins KeyedCollection { static ( values?: Iterable<[K, V]> | PlainObjInput ): KeyedSeq; // Override specialized return types flip(): KeyedSeq; concat( ...iters: Array | PlainObjInput> ): KeyedSeq; filter(predicate: typeof Boolean): KeyedSeq>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): KeyedSeq; partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): KeyedSeq; mapKeys( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): KeyedSeq; mapEntries( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): KeyedSeq; flatMap( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): KeyedSeq; flatten(depth?: number): KeyedSeq; flatten(shallow?: boolean): KeyedSeq; } declare class IndexedSeq<+T> extends Seq mixins IndexedCollection { static (values?: Iterable): IndexedSeq; static of(...values: T[]): IndexedSeq; // Override specialized return types concat(...iters: Array | C>): IndexedSeq; filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): IndexedSeq; partition( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): IndexedSeq; flatMap( mapper: (value: T, index: number, iter: this) => Iterable, context?: mixed ): IndexedSeq; flatten(depth?: number): IndexedSeq; flatten(shallow?: boolean): IndexedSeq; zip(a: Iterable, ..._: []): IndexedSeq<[T, A]>; zip(a: Iterable, b: Iterable, ..._: []): IndexedSeq<[T, A, B]>; zip( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): IndexedSeq<[T, A, B, C]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): IndexedSeq<[T, A, B, C, D]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): IndexedSeq<[T, A, B, C, D, E]>; zipAll(a: Iterable, ..._: []): IndexedSeq<[T | void, A | void]>; zipAll( a: Iterable, b: Iterable, ..._: [] ): IndexedSeq<[T | void, A | void, B | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): IndexedSeq<[T | void, A | void, B | void, C | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>; zipWith( zipper: (value: T, a: A) => R, a: Iterable, ..._: [] ): IndexedSeq; zipWith( zipper: (value: T, a: A, b: B) => R, a: Iterable, b: Iterable, ..._: [] ): IndexedSeq; zipWith( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable, b: Iterable, c: Iterable, ..._: [] ): IndexedSeq; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): IndexedSeq; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): IndexedSeq; } declare class SetSeq<+T> extends Seq mixins SetCollection { static (values?: Iterable): SetSeq; static of(...values: T[]): SetSeq; // Override specialized return types concat(...collections: Iterable[]): SetSeq; filter(predicate: typeof Boolean): SetSeq<$NonMaybeType>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): SetSeq; partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): SetSeq; flatMap( mapper: (value: T, value: T, iter: this) => Iterable, context?: mixed ): SetSeq; flatten(depth?: number): SetSeq; flatten(shallow?: boolean): SetSeq; } declare class UpdatableInCollection { setIn(keyPath: [], value: S): S; setIn(keyPath: [K], value: V): this; setIn, S: $ValOf>(keyPath: [K, K2], value: S): this; setIn, K3: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K3>>( keyPath: [K, K2, K3], value: S ): this; setIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, S: $ValOf<$ValOf<$ValOf, K3>, K4> >( keyPath: [K, K2, K3, K4], value: S ): this; setIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], value: S ): this; deleteIn(keyPath: []): void; deleteIn(keyPath: [K]): this; deleteIn>(keyPath: [K, K2]): this; deleteIn, K3: $KeyOf<$ValOf>>( keyPath: [K, K2, K3] ): this; deleteIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>> >( keyPath: [K, K2, K3, K4] ): this; deleteIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this; removeIn(keyPath: []): void; removeIn(keyPath: [K]): this; removeIn>(keyPath: [K, K2]): this; removeIn, K3: $KeyOf<$ValOf>>( keyPath: [K, K2, K3] ): this; removeIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>> >( keyPath: [K, K2, K3, K4] ): this; removeIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this; updateIn(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U; updateIn(keyPath: [], updater: (value: this) => U): U; updateIn(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this; updateIn(keyPath: [K], updater: (value: V) => V): this; updateIn, S: $ValOf>( keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf | NSV) => S ): this; updateIn, S: $ValOf>( keyPath: [K, K2], updater: (value: $ValOf) => S ): this; updateIn< NSV, K2: $KeyOf, K3: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K3> >( keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf, K3> | NSV) => S ): this; updateIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K3> >( keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf, K3>) => S ): this; updateIn< NSV, K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, S: $ValOf<$ValOf<$ValOf, K3>, K4> >( keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4> | NSV) => S ): this; updateIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, S: $ValOf<$ValOf<$ValOf, K3>, K4> >( keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4>) => S ): this; updateIn< NSV, K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV ) => S ): this; updateIn< K2: $KeyOf, K3: $KeyOf<$ValOf>, K4: $KeyOf<$ValOf<$ValOf, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>) => S ): this; } declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof List); declare class List<+T> extends IndexedCollection mixins UpdatableInCollection { static (collection?: Iterable): List; static of(...values: T[]): List; static isList: typeof isList; size: number; set(index: number, value: U): List; delete(index: number): this; remove(index: number): this; insert(index: number, value: U): List; clear(): this; push(...values: U[]): List; pop(): this; unshift(...values: U[]): List; shift(): this; update(updater: (value: this) => U): U; update(index: number, updater: (value: T) => U): List; update( index: number, notSetValue: U, updater: (value: T) => U ): List; merge(...collections: Iterable[]): List; setSize(size: number): this; mergeIn(keyPath: Iterable, ...collections: Iterable[]): this; mergeDeepIn( keyPath: Iterable, ...collections: Iterable[] ): this; withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this; // Override specialized return types concat(...iters: Array | C>): List; filter(predicate: typeof Boolean): List<$NonMaybeType>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): List; partition( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): List; flatMap( mapper: (value: T, index: number, iter: this) => Iterable, context?: mixed ): List; flatten(depth?: number): List; flatten(shallow?: boolean): List; zip(a: Iterable, ..._: []): List<[T, A]>; zip(a: Iterable, b: Iterable, ..._: []): List<[T, A, B]>; zip( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): List<[T, A, B, C]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): List<[T, A, B, C, D]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): List<[T, A, B, C, D, E]>; zipAll(a: Iterable, ..._: []): List<[T | void, A | void]>; zipAll( a: Iterable, b: Iterable, ..._: [] ): List<[T | void, A | void, B | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): List<[T | void, A | void, B | void, C | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): List<[T | void, A | void, B | void, C | void, D | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>; zipWith( zipper: (value: T, a: A) => R, a: Iterable, ..._: [] ): List; zipWith( zipper: (value: T, a: A, b: B) => R, a: Iterable, b: Iterable, ..._: [] ): List; zipWith( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable, b: Iterable, c: Iterable, ..._: [] ): List; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): List; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): List; } declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof Map); declare class Map extends KeyedCollection mixins UpdatableInCollection { static (values?: Iterable<[K, V]> | PlainObjInput): Map; static isMap: typeof isMap; size: number; set(key: K_, value: V_): Map; delete(key: K): this; remove(key: K): this; clear(): this; deleteAll(keys: Iterable): Map; removeAll(keys: Iterable): Map; update(updater: (value: this) => U): U; update(key: K, updater: (value: V) => V_): Map; update( key: K, notSetValue: V_, updater: (value: V) => V_ ): Map; merge( ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): Map; concat( ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): Map; mergeWith( merger: (oldVal: V, newVal: W, key: K) => X, ...collections: (Iterable<[K_, W]> | PlainObjInput)[] ): Map; mergeDeep( ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): Map; mergeDeepWith( merger: (oldVal: any, newVal: any, key: any) => mixed, ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): Map; mergeIn( keyPath: Iterable, ...collections: (Iterable | PlainObjInput)[] ): this; mergeDeepIn( keyPath: Iterable, ...collections: (Iterable | PlainObjInput)[] ): this; withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this; // Override specialized return types flip(): Map; filter(predicate: typeof Boolean): Map>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): Map; partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): Map; mapKeys( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): Map; mapEntries( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): Map; flatMap( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): Map; flatten(depth?: number): Map; flatten(shallow?: boolean): Map; } declare function isOrderedMap( maybeOrderedMap: mixed ): boolean %checks(maybeOrderedMap instanceof OrderedMap); declare class OrderedMap extends Map mixins UpdatableInCollection { static ( values?: Iterable<[K, V]> | PlainObjInput ): OrderedMap; static isOrderedMap: typeof isOrderedMap; size: number; set(key: K_, value: V_): OrderedMap; delete(key: K): this; remove(key: K): this; clear(): this; update(updater: (value: this) => U): U; update(key: K, updater: (value: V) => V_): OrderedMap; update( key: K, notSetValue: V_, updater: (value: V) => V_ ): OrderedMap; merge( ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): OrderedMap; concat( ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): OrderedMap; mergeWith( merger: (oldVal: V, newVal: W, key: K) => X, ...collections: (Iterable<[K_, W]> | PlainObjInput)[] ): OrderedMap; mergeDeep( ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): OrderedMap; mergeDeepWith( merger: (oldVal: any, newVal: any, key: any) => mixed, ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] ): OrderedMap; mergeIn( keyPath: Iterable, ...collections: (Iterable | PlainObjInput)[] ): this; mergeDeepIn( keyPath: Iterable, ...collections: (Iterable | PlainObjInput)[] ): this; withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this; // Override specialized return types flip(): OrderedMap; filter(predicate: typeof Boolean): OrderedMap>; filter( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): OrderedMap; partition( predicate: (value: V, key: K, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: V, key: K, iter: this) => M, context?: mixed ): OrderedMap; mapKeys( mapper: (key: K, value: V, iter: this) => M, context?: mixed ): OrderedMap; mapEntries( mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: mixed ): OrderedMap; flatMap( mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, context?: mixed ): OrderedMap; flatten(depth?: number): OrderedMap; flatten(shallow?: boolean): OrderedMap; } declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof Set); declare class Set<+T> extends SetCollection { static (values?: Iterable): Set; static of(...values: T[]): Set; static fromKeys( values: Iterable<[T, mixed]> | PlainObjInput ): Set; static intersect(sets: Iterable>): Set; static union(sets: Iterable>): Set; static isSet: typeof isSet; size: number; add(value: U): Set; delete(value: T): this; remove(value: T): this; clear(): this; union(...collections: Iterable[]): Set; merge(...collections: Iterable[]): Set; concat(...collections: Iterable[]): Set; intersect(...collections: Iterable[]): Set; subtract(...collections: Iterable[]): this; withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this; // Override specialized return types filter(predicate: typeof Boolean): Set<$NonMaybeType>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): Set; partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): Set; flatMap( mapper: (value: T, value: T, iter: this) => Iterable, context?: mixed ): Set; flatten(depth?: number): Set; flatten(shallow?: boolean): Set; } // Overrides except for `isOrderedSet` are for specialized return types declare function isOrderedSet( maybeOrderedSet: mixed ): boolean %checks(maybeOrderedSet instanceof OrderedSet); declare class OrderedSet<+T> extends Set { static (values?: Iterable): OrderedSet; static of(...values: T[]): OrderedSet; static fromKeys( values: Iterable<[T, mixed]> | PlainObjInput ): OrderedSet; static isOrderedSet: typeof isOrderedSet; size: number; add(value: U): OrderedSet; union(...collections: Iterable[]): OrderedSet; merge(...collections: Iterable[]): OrderedSet; concat(...collections: Iterable[]): OrderedSet; intersect(...collections: Iterable[]): OrderedSet; filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType>; filter( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): OrderedSet; partition( predicate: (value: T, value: T, iter: this) => mixed, context?: mixed ): [this, this]; map( mapper: (value: T, value: T, iter: this) => M, context?: mixed ): OrderedSet; flatMap( mapper: (value: T, value: T, iter: this) => Iterable, context?: mixed ): OrderedSet; flatten(depth?: number): OrderedSet; flatten(shallow?: boolean): OrderedSet; zip(a: Iterable, ..._: []): OrderedSet<[T, A]>; zip(a: Iterable, b: Iterable, ..._: []): OrderedSet<[T, A, B]>; zip( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): OrderedSet<[T, A, B, C]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): OrderedSet<[T, A, B, C, D]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): OrderedSet<[T, A, B, C, D, E]>; zipAll(a: Iterable, ..._: []): OrderedSet<[T | void, A | void]>; zipAll( a: Iterable, b: Iterable, ..._: [] ): OrderedSet<[T | void, A | void, B | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): OrderedSet<[T | void, A | void, B | void, C | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>; zipWith( zipper: (value: T, a: A) => R, a: Iterable, ..._: [] ): OrderedSet; zipWith( zipper: (value: T, a: A, b: B) => R, a: Iterable, b: Iterable, ..._: [] ): OrderedSet; zipWith( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable, b: Iterable, c: Iterable, ..._: [] ): OrderedSet; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): OrderedSet; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): OrderedSet; } declare function isStack( maybeStack: mixed ): boolean %checks(maybeStack instanceof Stack); declare class Stack<+T> extends IndexedCollection { static (collection?: Iterable): Stack; static isStack(maybeStack: mixed): boolean; static of(...values: T[]): Stack; static isStack: typeof isStack; size: number; peek(): T; clear(): this; unshift(...values: U[]): Stack; unshiftAll(iter: Iterable): Stack; shift(): this; push(...values: U[]): Stack; pushAll(iter: Iterable): Stack; pop(): this; withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; wasAltered(): boolean; asImmutable(): this; // Override specialized return types concat(...iters: Array | C>): Stack; filter(predicate: typeof Boolean): Stack<$NonMaybeType>; filter( predicate: (value: T, index: number, iter: this) => mixed, context?: mixed ): Stack; map( mapper: (value: T, index: number, iter: this) => M, context?: mixed ): Stack; flatMap( mapper: (value: T, index: number, iter: this) => Iterable, context?: mixed ): Stack; flatten(depth?: number): Stack; flatten(shallow?: boolean): Stack; zip(a: Iterable, ..._: []): Stack<[T, A]>; zip(a: Iterable, b: Iterable, ..._: []): Stack<[T, A, B]>; zip( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): Stack<[T, A, B, C]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): Stack<[T, A, B, C, D]>; zip( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): Stack<[T, A, B, C, D, E]>; zipAll(a: Iterable, ..._: []): Stack<[T | void, A | void]>; zipAll( a: Iterable, b: Iterable, ..._: [] ): Stack<[T | void, A | void, B | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, ..._: [] ): Stack<[T | void, A | void, B | void, C | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): Stack<[T | void, A | void, B | void, C | void, D | void]>; zipAll( a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>; zipWith( zipper: (value: T, a: A) => R, a: Iterable, ..._: [] ): Stack; zipWith( zipper: (value: T, a: A, b: B) => R, a: Iterable, b: Iterable, ..._: [] ): Stack; zipWith( zipper: (value: T, a: A, b: B, c: C) => R, a: Iterable, b: Iterable, c: Iterable, ..._: [] ): Stack; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, ..._: [] ): Stack; zipWith( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, a: Iterable, b: Iterable, c: Iterable, d: Iterable, e: Iterable, ..._: [] ): Stack; } declare function Range( start?: number, end?: number, step?: number ): IndexedSeq; declare function Repeat(value: T, times?: number): IndexedSeq; // The type of a Record factory function. type RecordFactory = Class>; // The type of runtime Record instances. type RecordOf = RecordInstance & $ReadOnly; // The values of a Record instance. type _RecordValues | T> = R; type RecordValues = _RecordValues<*, R>; declare function isRecord( maybeRecord: any ): boolean %checks(maybeRecord instanceof RecordInstance); declare class Record { static (spec: Values, name?: string): typeof RecordInstance; constructor( spec: Values, name?: string ): typeof RecordInstance; static isRecord: typeof isRecord; static getDescriptiveName(record: RecordInstance): string; } declare class RecordInstance { static (values?: Iterable<[$Keys, $ValOf]> | $Shape): RecordOf; // Note: a constructor can only create an instance of RecordInstance, // it's encouraged to not use `new` when creating Records. constructor(values?: Iterable<[$Keys, $ValOf]> | $Shape): void; size: number; has(key: string): boolean; get>(key: K, ..._: []): $ElementType; get, NSV>(key: K, notSetValue: NSV): $ElementType | NSV; hasIn(keyPath: Iterable): boolean; getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly; getIn>(keyPath: [K], notSetValue?: mixed): $ElementType; getIn, K2: $KeyOf<$ValOf>>( keyPath: [K, K2], notSetValue: NSV ): $ValOf<$ValOf, K2> | NSV; getIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>> >( keyPath: [K, K2, K3], notSetValue: NSV ): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; getIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>> >( keyPath: [K, K2, K3, K4], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; getIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; equals(other: any): boolean; hashCode(): number; set>(key: K, value: $ElementType): this & $ReadOnly; update>( key: K, updater: (value: $ElementType) => $ElementType ): this & $ReadOnly; merge( ...collections: Array, $ValOf]> | $Shape> ): this & $ReadOnly; mergeDeep( ...collections: Array, $ValOf]> | $Shape> ): this & $ReadOnly; mergeWith( merger: (oldVal: $ValOf, newVal: $ValOf, key: $Keys) => $ValOf, ...collections: Array, $ValOf]> | $Shape> ): this & $ReadOnly; mergeDeepWith( merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array, $ValOf]> | $Shape> ): this & $ReadOnly; delete>(key: K): this & $ReadOnly; remove>(key: K): this & $ReadOnly; clear(): this & $ReadOnly; setIn(keyPath: [], value: S): S; setIn, S: $ValOf>( keyPath: [K], value: S ): this & $ReadOnly; setIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( keyPath: [K, K2], value: S ): this & $ReadOnly; setIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, S: $ValOf<$ValOf<$ValOf, K2>, K3> >( keyPath: [K, K2, K3], value: S ): this & $ReadOnly; setIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], value: S ): this & $ReadOnly; setIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], value: S ): this & $ReadOnly; deleteIn(keyPath: []): void; deleteIn>(keyPath: [K]): this & $ReadOnly; deleteIn, K2: $KeyOf<$ValOf>>( keyPath: [K, K2] ): this & $ReadOnly; deleteIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>> >( keyPath: [K, K2, K3] ): this & $ReadOnly; deleteIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>> >( keyPath: [K, K2, K3, K4] ): this & $ReadOnly; deleteIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this & $ReadOnly; removeIn(keyPath: []): void; removeIn>(keyPath: [K]): this & $ReadOnly; removeIn, K2: $KeyOf<$ValOf>>( keyPath: [K, K2] ): this & $ReadOnly; removeIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>> >( keyPath: [K, K2, K3] ): this & $ReadOnly; removeIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>> >( keyPath: [K, K2, K3, K4] ): this & $ReadOnly; removeIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>> >( keyPath: [K, K2, K3, K4, K5] ): this & $ReadOnly; updateIn( keyPath: [], notSetValue: mixed, updater: (value: this & T) => U ): U; updateIn(keyPath: [], updater: (value: this & T) => U): U; updateIn, S: $ValOf>( keyPath: [K], notSetValue: NSV, updater: (value: $ValOf) => S ): this & $ReadOnly; updateIn, S: $ValOf>( keyPath: [K], updater: (value: $ValOf) => S ): this & $ReadOnly; updateIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2> >( keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ValOf, K2> | NSV) => S ): this & $ReadOnly; updateIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( keyPath: [K, K2], updater: (value: $ValOf<$ValOf, K2>) => S ): this & $ReadOnly; updateIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, S: $ValOf<$ValOf<$ValOf, K2>, K3> >( keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S ): this & $ReadOnly; updateIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, S: $ValOf<$ValOf<$ValOf, K2>, K3> >( keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S ): this & $ReadOnly; updateIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV ) => S ): this & $ReadOnly; updateIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> >( keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S ): this & $ReadOnly; updateIn< NSV, K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV ) => S ): this & $ReadOnly; updateIn< K: $Keys, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> >( keyPath: [K, K2, K3, K4, K5], updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> ) => S ): this & $ReadOnly; mergeIn( keyPath: Iterable, ...collections: Array ): this & $ReadOnly; mergeDeepIn( keyPath: Iterable, ...collections: Array ): this & $ReadOnly; toSeq(): KeyedSeq<$Keys, any>; toJS(): { [key: $Keys]: mixed }; toJSON(): T; toObject(): T; withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly; asMutable(): this & $ReadOnly; wasAltered(): boolean; asImmutable(): this & $ReadOnly; @@iterator(): Iterator<[$Keys, $ValOf]>; } declare function fromJS( jsValue: mixed, reviver?: ( key: string | number, sequence: KeyedCollection | IndexedCollection, path?: Array ) => mixed ): Collection; declare function is(first: mixed, second: mixed): boolean; declare function hash(value: mixed): number; declare function get>( collection: C, key: K, notSetValue: mixed ): $ValOf; declare function get, NSV>( collection: C, key: K, notSetValue: NSV ): $ValOf | NSV; declare function has(collection: Object, key: mixed): boolean; declare function remove(collection: C, key: $KeyOf): C; declare function set, V: $ValOf>( collection: C, key: K, value: V ): C; declare function update, V: $ValOf, NSV>( collection: C, key: K, notSetValue: NSV, updater: ($ValOf | NSV) => V ): C; declare function update, V: $ValOf>( collection: C, key: K, updater: ($ValOf) => V ): C; declare function getIn(collection: C, keyPath: [], notSetValue?: mixed): C; declare function getIn, NSV>( collection: C, keyPath: [K], notSetValue: NSV ): $ValOf | NSV; declare function getIn, K2: $KeyOf<$ValOf>, NSV>( collection: C, keyPath: [K, K2], notSetValue: NSV ): $ValOf<$ValOf, K2> | NSV; declare function getIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, NSV >( collection: C, keyPath: [K, K2, K3], notSetValue: NSV ): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; declare function getIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, NSV >( collection: C, keyPath: [K, K2, K3, K4], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; declare function getIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, NSV >( collection: C, keyPath: [K, K2, K3, K4, K5], notSetValue: NSV ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; declare function hasIn(collection: Object, keyPath: Iterable): boolean; declare function removeIn(collection: C, keyPath: []): void; declare function removeIn>(collection: C, keyPath: [K]): C; declare function removeIn, K2: $KeyOf<$ValOf>>( collection: C, keyPath: [K, K2] ): C; declare function removeIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>> >( collection: C, keyPath: [K, K2, K3] ): C; declare function removeIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>> >( collection: C, keyPath: [K, K2, K3, K4] ): C; declare function removeIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>> >( collection: C, keyPath: [K, K2, K3, K4, K5] ): C; declare function setIn(collection: Object, keyPath: [], value: S): S; declare function setIn, S: $ValOf>( collection: C, keyPath: [K], value: S ): C; declare function setIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2> >( collection: C, keyPath: [K, K2], value: S ): C; declare function setIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, S: $ValOf<$ValOf<$ValOf, K2>, K3> >( collection: C, keyPath: [K, K2, K3], value: S ): C; declare function setIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> >( collection: C, keyPath: [K, K2, K3, K4], value: S ): C; declare function setIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> >( collection: C, keyPath: [K, K2, K3, K4, K5], value: S ): C; declare function updateIn( collection: C, keyPath: [], notSetValue: mixed, updater: (value: C) => S ): S; declare function updateIn( collection: C, keyPath: [], updater: (value: C) => S ): S; declare function updateIn, S: $ValOf, NSV>( collection: C, keyPath: [K], notSetValue: NSV, updater: (value: $ValOf | NSV) => S ): C; declare function updateIn, S: $ValOf>( collection: C, keyPath: [K], updater: (value: $ValOf) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>, NSV >( collection: C, keyPath: [K, K2], notSetValue: NSV, updater: (value: $ValOf<$ValOf, K2> | NSV) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2> >( collection: C, keyPath: [K, K2], updater: (value: $ValOf<$ValOf, K2>) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, S: $ValOf<$ValOf<$ValOf, K2>, K3>, NSV >( collection: C, keyPath: [K, K2, K3], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, S: $ValOf<$ValOf<$ValOf, K2>, K3> >( collection: C, keyPath: [K, K2, K3], updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, NSV >( collection: C, keyPath: [K, K2, K3, K4], notSetValue: NSV, updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> >( collection: C, keyPath: [K, K2, K3, K4], updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, NSV >( collection: C, keyPath: [K, K2, K3, K4, K5], notSetValue: NSV, updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV ) => S ): C; declare function updateIn< C, K: $KeyOf, K2: $KeyOf<$ValOf>, K3: $KeyOf<$ValOf<$ValOf, K2>>, K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> >( collection: C, keyPath: [K, K2, K3, K4, K5], updater: ( value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> ) => S ): C; declare function merge( collection: C, ...collections: Array< | $IterableOf | $Shape> | PlainObjInput<$KeyOf, $ValOf> > ): C; declare function mergeWith( merger: (oldVal: $ValOf, newVal: $ValOf, key: $KeyOf) => $ValOf, collection: C, ...collections: Array< | $IterableOf | $Shape> | PlainObjInput<$KeyOf, $ValOf> > ): C; declare function mergeDeep( collection: C, ...collections: Array< | $IterableOf | $Shape> | PlainObjInput<$KeyOf, $ValOf> > ): C; declare function mergeDeepWith( merger: (oldVal: any, newVal: any, key: any) => mixed, collection: C, ...collections: Array< | $IterableOf | $Shape> | PlainObjInput<$KeyOf, $ValOf> > ): C; export { Collection, Seq, List, Map, OrderedMap, OrderedSet, Range, Repeat, Record, Set, Stack, fromJS, is, hash, isImmutable, isCollection, isKeyed, isIndexed, isAssociative, isOrdered, isRecord, isValueObject, get, has, remove, set, update, getIn, hasIn, removeIn, setIn, updateIn, merge, mergeWith, mergeDeep, mergeDeepWith, }; export default { Collection, Seq, List, Map, OrderedMap, OrderedSet, PairSorting, Range, Repeat, Record, Set, Stack, fromJS, is, hash, isImmutable, isCollection, isKeyed, isIndexed, isAssociative, isOrdered, isRecord, isValueObject, get, has, remove, set, update, getIn, hasIn, removeIn, setIn, updateIn, merge, mergeWith, mergeDeep, mergeDeepWith, }; export type { Comparator, KeyedCollection, IndexedCollection, SetCollection, KeyedSeq, IndexedSeq, SetSeq, RecordFactory, RecordOf, RecordInstance, ValueObject, $KeyOf, $ValOf, };