immutable.js.flow 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347
  1. /**
  2. * This file provides type definitions for use with the Flow type checker.
  3. *
  4. * An important caveat when using these definitions is that the types for
  5. * `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs.
  6. * When referring to those types, you can get the proper definitions by
  7. * importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc.
  8. * For example,
  9. *
  10. * import { Seq } from 'immutable'
  11. * import type { IndexedCollection, IndexedSeq } from 'immutable'
  12. *
  13. * const someSeq: IndexedSeq<number> = Seq.Indexed.of(1, 2, 3)
  14. *
  15. * function takesASeq<T, TS: IndexedCollection<T>>(iter: TS): TS {
  16. * return iter.butLast()
  17. * }
  18. *
  19. * takesASeq(someSeq)
  20. *
  21. * @flow strict
  22. */
  23. // Helper type that represents plain objects allowed as arguments to
  24. // some constructors and functions.
  25. type PlainObjInput<K, V> = { +[key: K]: V, __proto__: null };
  26. type K<T> = $Keys<T>;
  27. // Helper types to extract the "keys" and "values" use by the *In() methods.
  28. type $KeyOf<C> = $Call<
  29. (<K>(?_Collection<K, mixed>) => K) &
  30. (<T>(?$ReadOnlyArray<T>) => number) &
  31. (<T>(?RecordInstance<T> | T) => $Keys<T>) &
  32. (<T: Object>(T) => $Keys<T>),
  33. C
  34. >;
  35. type $ValOf<C, K = $KeyOf<C>> = $Call<
  36. (<V>(?_Collection<any, V>) => V) &
  37. (<T>(?$ReadOnlyArray<T>) => T) &
  38. (<T, K: $Keys<T>>(?RecordInstance<T> | T, K) => $ElementType<T, K>) &
  39. (<T: Object>(T) => $Values<T>),
  40. C,
  41. K
  42. >;
  43. type $IterableOf<C> = $Call<
  44. (<V: Array<any> | IndexedCollection<any> | SetCollection<any>>(
  45. V
  46. ) => Iterable<$ValOf<V>>) &
  47. (<
  48. V:
  49. | KeyedCollection<any, any>
  50. | RecordInstance<any>
  51. | PlainObjInput<any, any>
  52. >(
  53. V
  54. ) => Iterable<[$KeyOf<V>, $ValOf<V>]>),
  55. C
  56. >;
  57. declare class _Collection<K, +V> implements ValueObject {
  58. equals(other: mixed): boolean;
  59. hashCode(): number;
  60. get(key: K, ..._: []): V | void;
  61. get<NSV>(key: K, notSetValue: NSV): V | NSV;
  62. has(key: K): boolean;
  63. includes(value: V): boolean;
  64. contains(value: V): boolean;
  65. first<NSV>(notSetValue?: NSV): V | NSV;
  66. last<NSV>(notSetValue?: NSV): V | NSV;
  67. hasIn(keyPath: Iterable<mixed>): boolean;
  68. getIn(keyPath: [], notSetValue?: mixed): this;
  69. getIn<NSV>(keyPath: [K], notSetValue: NSV): V | NSV;
  70. getIn<NSV, K2: $KeyOf<V>>(
  71. keyPath: [K, K2],
  72. notSetValue: NSV
  73. ): $ValOf<V, K2> | NSV;
  74. getIn<NSV, K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
  75. keyPath: [K, K2, K3],
  76. notSetValue: NSV
  77. ): $ValOf<$ValOf<V, K2>, K3> | NSV;
  78. getIn<
  79. NSV,
  80. K2: $KeyOf<V>,
  81. K3: $KeyOf<$ValOf<V, K2>>,
  82. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
  83. >(
  84. keyPath: [K, K2, K3, K4],
  85. notSetValue: NSV
  86. ): $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV;
  87. getIn<
  88. NSV,
  89. K2: $KeyOf<V>,
  90. K3: $KeyOf<$ValOf<V, K2>>,
  91. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  92. K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
  93. >(
  94. keyPath: [K, K2, K3, K4, K5],
  95. notSetValue: NSV
  96. ): $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV;
  97. update<U>(updater: (value: this) => U): U;
  98. toJS(): Array<any> | { [key: string]: mixed };
  99. toJSON(): Array<V> | { [key: string]: V };
  100. toArray(): Array<V> | Array<[K, V]>;
  101. toObject(): { [key: string]: V };
  102. toMap(): Map<K, V>;
  103. toOrderedMap(): OrderedMap<K, V>;
  104. toSet(): Set<V>;
  105. toOrderedSet(): OrderedSet<V>;
  106. toList(): List<V>;
  107. toStack(): Stack<V>;
  108. toSeq(): Seq<K, V>;
  109. toKeyedSeq(): KeyedSeq<K, V>;
  110. toIndexedSeq(): IndexedSeq<V>;
  111. toSetSeq(): SetSeq<V>;
  112. keys(): Iterator<K>;
  113. values(): Iterator<V>;
  114. entries(): Iterator<[K, V]>;
  115. keySeq(): IndexedSeq<K>;
  116. valueSeq(): IndexedSeq<V>;
  117. entrySeq(): IndexedSeq<[K, V]>;
  118. reverse(): this;
  119. sort(comparator?: (valueA: V, valueB: V) => number): this;
  120. sortBy<C>(
  121. comparatorValueMapper: (value: V, key: K, iter: this) => C,
  122. comparator?: (valueA: C, valueB: C) => number
  123. ): this;
  124. groupBy<G>(
  125. grouper: (value: V, key: K, iter: this) => G,
  126. context?: mixed
  127. ): KeyedSeq<G, this>;
  128. forEach(
  129. sideEffect: (value: V, key: K, iter: this) => any,
  130. context?: mixed
  131. ): number;
  132. slice(begin?: number, end?: number): this;
  133. rest(): this;
  134. butLast(): this;
  135. skip(amount: number): this;
  136. skipLast(amount: number): this;
  137. skipWhile(
  138. predicate: (value: V, key: K, iter: this) => mixed,
  139. context?: mixed
  140. ): this;
  141. skipUntil(
  142. predicate: (value: V, key: K, iter: this) => mixed,
  143. context?: mixed
  144. ): this;
  145. take(amount: number): this;
  146. takeLast(amount: number): this;
  147. takeWhile(
  148. predicate: (value: V, key: K, iter: this) => mixed,
  149. context?: mixed
  150. ): this;
  151. takeUntil(
  152. predicate: (value: V, key: K, iter: this) => mixed,
  153. context?: mixed
  154. ): this;
  155. filterNot(
  156. predicate: (value: V, key: K, iter: this) => mixed,
  157. context?: mixed
  158. ): this;
  159. reduce<R>(
  160. reducer: (reduction: R, value: V, key: K, iter: this) => R,
  161. initialReduction: R,
  162. context?: mixed
  163. ): R;
  164. reduce<R>(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R;
  165. reduceRight<R>(
  166. reducer: (reduction: R, value: V, key: K, iter: this) => R,
  167. initialReduction: R,
  168. context?: mixed
  169. ): R;
  170. reduceRight<R>(
  171. reducer: (reduction: V | R, value: V, key: K, iter: this) => R
  172. ): R;
  173. every(
  174. predicate: (value: V, key: K, iter: this) => mixed,
  175. context?: mixed
  176. ): boolean;
  177. some(
  178. predicate: (value: V, key: K, iter: this) => mixed,
  179. context?: mixed
  180. ): boolean;
  181. join(separator?: string): string;
  182. isEmpty(): boolean;
  183. count(
  184. predicate?: (value: V, key: K, iter: this) => mixed,
  185. context?: mixed
  186. ): number;
  187. countBy<G>(
  188. grouper: (value: V, key: K, iter: this) => G,
  189. context?: mixed
  190. ): Map<G, number>;
  191. find<NSV>(
  192. predicate: (value: V, key: K, iter: this) => mixed,
  193. context?: mixed,
  194. notSetValue?: NSV
  195. ): V | NSV;
  196. findLast<NSV>(
  197. predicate: (value: V, key: K, iter: this) => mixed,
  198. context?: mixed,
  199. notSetValue?: NSV
  200. ): V | NSV;
  201. findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
  202. findLastEntry(
  203. predicate: (value: V, key: K, iter: this) => mixed
  204. ): [K, V] | void;
  205. findKey(
  206. predicate: (value: V, key: K, iter: this) => mixed,
  207. context?: mixed
  208. ): K | void;
  209. findLastKey(
  210. predicate: (value: V, key: K, iter: this) => mixed,
  211. context?: mixed
  212. ): K | void;
  213. keyOf(searchValue: V): K | void;
  214. lastKeyOf(searchValue: V): K | void;
  215. max(comparator?: (valueA: V, valueB: V) => number): V;
  216. maxBy<C>(
  217. comparatorValueMapper: (value: V, key: K, iter: this) => C,
  218. comparator?: (valueA: C, valueB: C) => number
  219. ): V;
  220. min(comparator?: (valueA: V, valueB: V) => number): V;
  221. minBy<C>(
  222. comparatorValueMapper: (value: V, key: K, iter: this) => C,
  223. comparator?: (valueA: C, valueB: C) => number
  224. ): V;
  225. isSubset(iter: Iterable<V>): boolean;
  226. isSuperset(iter: Iterable<V>): boolean;
  227. }
  228. declare function isImmutable(
  229. maybeImmutable: mixed
  230. ): boolean %checks(maybeImmutable instanceof Collection);
  231. declare function isCollection(
  232. maybeCollection: mixed
  233. ): boolean %checks(maybeCollection instanceof Collection);
  234. declare function isKeyed(
  235. maybeKeyed: mixed
  236. ): boolean %checks(maybeKeyed instanceof KeyedCollection);
  237. declare function isIndexed(
  238. maybeIndexed: mixed
  239. ): boolean %checks(maybeIndexed instanceof IndexedCollection);
  240. declare function isAssociative(
  241. maybeAssociative: mixed
  242. ): boolean %checks(maybeAssociative instanceof KeyedCollection ||
  243. maybeAssociative instanceof IndexedCollection);
  244. declare function isOrdered(
  245. maybeOrdered: mixed
  246. ): boolean %checks(maybeOrdered instanceof IndexedCollection ||
  247. maybeOrdered instanceof OrderedMap ||
  248. maybeOrdered instanceof OrderedSet);
  249. declare function isValueObject(maybeValue: mixed): boolean;
  250. declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq);
  251. declare function isList(maybeList: any): boolean %checks(maybeList instanceof
  252. List);
  253. declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map);
  254. declare function isOrderedMap(
  255. maybeOrderedMap: any
  256. ): boolean %checks(maybeOrderedMap instanceof OrderedMap);
  257. declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof
  258. Stack);
  259. declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set);
  260. declare function isOrderedSet(
  261. maybeOrderedSet: any
  262. ): boolean %checks(maybeOrderedSet instanceof OrderedSet);
  263. declare function isRecord(
  264. maybeRecord: any
  265. ): boolean %checks(maybeRecord instanceof Record);
  266. declare interface ValueObject {
  267. equals(other: mixed): boolean;
  268. hashCode(): number;
  269. }
  270. declare class Collection<K, +V> extends _Collection<K, V> {
  271. static Keyed: typeof KeyedCollection;
  272. static Indexed: typeof IndexedCollection;
  273. static Set: typeof SetCollection;
  274. static isCollection: typeof isCollection;
  275. static isKeyed: typeof isKeyed;
  276. static isIndexed: typeof isIndexed;
  277. static isAssociative: typeof isAssociative;
  278. static isOrdered: typeof isOrdered;
  279. }
  280. declare class KeyedCollection<K, +V> extends Collection<K, V> {
  281. static <K, V>(
  282. values?: Iterable<[K, V]> | PlainObjInput<K, V>
  283. ): KeyedCollection<K, V>;
  284. toJS(): { [key: string]: mixed };
  285. toJSON(): { [key: string]: V };
  286. toArray(): Array<[K, V]>;
  287. @@iterator(): Iterator<[K, V]>;
  288. toSeq(): KeyedSeq<K, V>;
  289. flip(): KeyedCollection<V, K>;
  290. concat<KC, VC>(
  291. ...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>>
  292. ): KeyedCollection<K | KC, V | VC>;
  293. filter(predicate: typeof Boolean): KeyedCollection<K, $NonMaybeType<V>>;
  294. filter(
  295. predicate: (value: V, key: K, iter: this) => mixed,
  296. context?: mixed
  297. ): KeyedCollection<K, V>;
  298. map<M>(
  299. mapper: (value: V, key: K, iter: this) => M,
  300. context?: mixed
  301. ): KeyedCollection<K, M>;
  302. mapKeys<M>(
  303. mapper: (key: K, value: V, iter: this) => M,
  304. context?: mixed
  305. ): KeyedCollection<M, V>;
  306. mapEntries<KM, VM>(
  307. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  308. context?: mixed
  309. ): KeyedCollection<KM, VM>;
  310. flatMap<KM, VM>(
  311. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  312. context?: mixed
  313. ): KeyedCollection<KM, VM>;
  314. flatten(depth?: number): KeyedCollection<any, any>;
  315. flatten(shallow?: boolean): KeyedCollection<any, any>;
  316. }
  317. Collection.Keyed = KeyedCollection;
  318. declare class IndexedCollection<+T> extends Collection<number, T> {
  319. static <T>(iter?: Iterable<T>): IndexedCollection<T>;
  320. toJS(): Array<mixed>;
  321. toJSON(): Array<T>;
  322. toArray(): Array<T>;
  323. @@iterator(): Iterator<T>;
  324. toSeq(): IndexedSeq<T>;
  325. fromEntrySeq<K, V>(): KeyedSeq<K, V>;
  326. interpose(separator: T): this;
  327. interleave(...collections: Iterable<T>[]): this;
  328. splice(index: number, removeNum: number, ...values: T[]): this;
  329. zip<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T, A]>;
  330. zip<A, B>(
  331. a: Iterable<A>,
  332. b: Iterable<B>,
  333. ..._: []
  334. ): IndexedCollection<[T, A, B]>;
  335. zip<A, B, C>(
  336. a: Iterable<A>,
  337. b: Iterable<B>,
  338. c: Iterable<C>,
  339. ..._: []
  340. ): IndexedCollection<[T, A, B, C]>;
  341. zip<A, B, C, D>(
  342. a: Iterable<A>,
  343. b: Iterable<B>,
  344. c: Iterable<C>,
  345. d: Iterable<D>,
  346. ..._: []
  347. ): IndexedCollection<[T, A, B, C, D]>;
  348. zip<A, B, C, D, E>(
  349. a: Iterable<A>,
  350. b: Iterable<B>,
  351. c: Iterable<C>,
  352. d: Iterable<D>,
  353. e: Iterable<E>,
  354. ..._: []
  355. ): IndexedCollection<[T, A, B, C, D, E]>;
  356. zipAll<A>(a: Iterable<A>, ..._: []): IndexedCollection<[T | void, A | void]>;
  357. zipAll<A, B>(
  358. a: Iterable<A>,
  359. b: Iterable<B>,
  360. ..._: []
  361. ): IndexedCollection<[T | void, A | void, B | void]>;
  362. zipAll<A, B, C>(
  363. a: Iterable<A>,
  364. b: Iterable<B>,
  365. c: Iterable<C>,
  366. ..._: []
  367. ): IndexedCollection<[T | void, A | void, B | void, C | void]>;
  368. zipAll<A, B, C, D>(
  369. a: Iterable<A>,
  370. b: Iterable<B>,
  371. c: Iterable<C>,
  372. d: Iterable<D>,
  373. ..._: []
  374. ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>;
  375. zipAll<A, B, C, D, E>(
  376. a: Iterable<A>,
  377. b: Iterable<B>,
  378. c: Iterable<C>,
  379. d: Iterable<D>,
  380. e: Iterable<E>,
  381. ..._: []
  382. ): IndexedCollection<
  383. [T | void, A | void, B | void, C | void, D | void, E | void]
  384. >;
  385. zipWith<A, R>(
  386. zipper: (value: T, a: A) => R,
  387. a: Iterable<A>,
  388. ..._: []
  389. ): IndexedCollection<R>;
  390. zipWith<A, B, R>(
  391. zipper: (value: T, a: A, b: B) => R,
  392. a: Iterable<A>,
  393. b: Iterable<B>,
  394. ..._: []
  395. ): IndexedCollection<R>;
  396. zipWith<A, B, C, R>(
  397. zipper: (value: T, a: A, b: B, c: C) => R,
  398. a: Iterable<A>,
  399. b: Iterable<B>,
  400. c: Iterable<C>,
  401. ..._: []
  402. ): IndexedCollection<R>;
  403. zipWith<A, B, C, D, R>(
  404. zipper: (value: T, a: A, b: B, c: C, d: D) => R,
  405. a: Iterable<A>,
  406. b: Iterable<B>,
  407. c: Iterable<C>,
  408. d: Iterable<D>,
  409. ..._: []
  410. ): IndexedCollection<R>;
  411. zipWith<A, B, C, D, E, R>(
  412. zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
  413. a: Iterable<A>,
  414. b: Iterable<B>,
  415. c: Iterable<C>,
  416. d: Iterable<D>,
  417. e: Iterable<E>,
  418. ..._: []
  419. ): IndexedCollection<R>;
  420. indexOf(searchValue: T): number;
  421. lastIndexOf(searchValue: T): number;
  422. findIndex(
  423. predicate: (value: T, index: number, iter: this) => mixed,
  424. context?: mixed
  425. ): number;
  426. findLastIndex(
  427. predicate: (value: T, index: number, iter: this) => mixed,
  428. context?: mixed
  429. ): number;
  430. concat<C>(...iters: Array<Iterable<C> | C>): IndexedCollection<T | C>;
  431. filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType<T>>;
  432. filter(
  433. predicate: (value: T, index: number, iter: this) => mixed,
  434. context?: mixed
  435. ): IndexedCollection<T>;
  436. map<M>(
  437. mapper: (value: T, index: number, iter: this) => M,
  438. context?: mixed
  439. ): IndexedCollection<M>;
  440. flatMap<M>(
  441. mapper: (value: T, index: number, iter: this) => Iterable<M>,
  442. context?: mixed
  443. ): IndexedCollection<M>;
  444. flatten(depth?: number): IndexedCollection<any>;
  445. flatten(shallow?: boolean): IndexedCollection<any>;
  446. }
  447. declare class SetCollection<+T> extends Collection<T, T> {
  448. static <T>(iter?: Iterable<T>): SetCollection<T>;
  449. toJS(): Array<mixed>;
  450. toJSON(): Array<T>;
  451. toArray(): Array<T>;
  452. @@iterator(): Iterator<T>;
  453. toSeq(): SetSeq<T>;
  454. concat<U>(...collections: Iterable<U>[]): SetCollection<T | U>;
  455. // `filter`, `map` and `flatMap` cannot be defined further up the hierarchy,
  456. // because the implementation for `KeyedCollection` allows the value type to
  457. // change without constraining the key type. That does not work for
  458. // `SetCollection` - the value and key types *must* match.
  459. filter(predicate: typeof Boolean): SetCollection<$NonMaybeType<T>>;
  460. filter(
  461. predicate: (value: T, value: T, iter: this) => mixed,
  462. context?: mixed
  463. ): SetCollection<T>;
  464. map<M>(
  465. mapper: (value: T, value: T, iter: this) => M,
  466. context?: mixed
  467. ): SetCollection<M>;
  468. flatMap<M>(
  469. mapper: (value: T, value: T, iter: this) => Iterable<M>,
  470. context?: mixed
  471. ): SetCollection<M>;
  472. flatten(depth?: number): SetCollection<any>;
  473. flatten(shallow?: boolean): SetCollection<any>;
  474. }
  475. declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof
  476. Seq);
  477. declare class Seq<K, +V> extends _Collection<K, V> {
  478. static Keyed: typeof KeyedSeq;
  479. static Indexed: typeof IndexedSeq;
  480. static Set: typeof SetSeq;
  481. static <K, V>(values: KeyedSeq<K, V>): KeyedSeq<K, V>;
  482. static <T>(values: SetSeq<T>): SetSeq<K, V>;
  483. static <T>(values: Iterable<T>): IndexedSeq<T>;
  484. static <K, V>(values?: PlainObjInput<K, V>): KeyedSeq<K, V>;
  485. static isSeq: typeof isSeq;
  486. size: number | void;
  487. cacheResult(): this;
  488. toSeq(): this;
  489. }
  490. declare class KeyedSeq<K, +V> extends Seq<K, V> mixins KeyedCollection<K, V> {
  491. static <K, V>(
  492. values?: Iterable<[K, V]> | PlainObjInput<K, V>
  493. ): KeyedSeq<K, V>;
  494. // Override specialized return types
  495. flip(): KeyedSeq<V, K>;
  496. concat<KC, VC>(
  497. ...iters: Array<Iterable<[KC, VC]> | PlainObjInput<KC, VC>>
  498. ): KeyedSeq<K | KC, V | VC>;
  499. filter(predicate: typeof Boolean): KeyedSeq<K, $NonMaybeType<V>>;
  500. filter(
  501. predicate: (value: V, key: K, iter: this) => mixed,
  502. context?: mixed
  503. ): KeyedSeq<K, V>;
  504. map<M>(
  505. mapper: (value: V, key: K, iter: this) => M,
  506. context?: mixed
  507. ): KeyedSeq<K, M>;
  508. mapKeys<M>(
  509. mapper: (key: K, value: V, iter: this) => M,
  510. context?: mixed
  511. ): KeyedSeq<M, V>;
  512. mapEntries<KM, VM>(
  513. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  514. context?: mixed
  515. ): KeyedSeq<KM, VM>;
  516. flatMap<KM, VM>(
  517. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  518. context?: mixed
  519. ): KeyedSeq<KM, VM>;
  520. flatten(depth?: number): KeyedSeq<any, any>;
  521. flatten(shallow?: boolean): KeyedSeq<any, any>;
  522. }
  523. declare class IndexedSeq<+T>
  524. extends Seq<number, T>
  525. mixins IndexedCollection<T>
  526. {
  527. static <T>(values?: Iterable<T>): IndexedSeq<T>;
  528. static of<T>(...values: T[]): IndexedSeq<T>;
  529. // Override specialized return types
  530. concat<C>(...iters: Array<Iterable<C> | C>): IndexedSeq<T | C>;
  531. filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType<T>>;
  532. filter(
  533. predicate: (value: T, index: number, iter: this) => mixed,
  534. context?: mixed
  535. ): IndexedSeq<T>;
  536. map<M>(
  537. mapper: (value: T, index: number, iter: this) => M,
  538. context?: mixed
  539. ): IndexedSeq<M>;
  540. flatMap<M>(
  541. mapper: (value: T, index: number, iter: this) => Iterable<M>,
  542. context?: mixed
  543. ): IndexedSeq<M>;
  544. flatten(depth?: number): IndexedSeq<any>;
  545. flatten(shallow?: boolean): IndexedSeq<any>;
  546. zip<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T, A]>;
  547. zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): IndexedSeq<[T, A, B]>;
  548. zip<A, B, C>(
  549. a: Iterable<A>,
  550. b: Iterable<B>,
  551. c: Iterable<C>,
  552. ..._: []
  553. ): IndexedSeq<[T, A, B, C]>;
  554. zip<A, B, C, D>(
  555. a: Iterable<A>,
  556. b: Iterable<B>,
  557. c: Iterable<C>,
  558. d: Iterable<D>,
  559. ..._: []
  560. ): IndexedSeq<[T, A, B, C, D]>;
  561. zip<A, B, C, D, E>(
  562. a: Iterable<A>,
  563. b: Iterable<B>,
  564. c: Iterable<C>,
  565. d: Iterable<D>,
  566. e: Iterable<E>,
  567. ..._: []
  568. ): IndexedSeq<[T, A, B, C, D, E]>;
  569. zipAll<A>(a: Iterable<A>, ..._: []): IndexedSeq<[T | void, A | void]>;
  570. zipAll<A, B>(
  571. a: Iterable<A>,
  572. b: Iterable<B>,
  573. ..._: []
  574. ): IndexedSeq<[T | void, A | void, B | void]>;
  575. zipAll<A, B, C>(
  576. a: Iterable<A>,
  577. b: Iterable<B>,
  578. c: Iterable<C>,
  579. ..._: []
  580. ): IndexedSeq<[T | void, A | void, B | void, C | void]>;
  581. zipAll<A, B, C, D>(
  582. a: Iterable<A>,
  583. b: Iterable<B>,
  584. c: Iterable<C>,
  585. d: Iterable<D>,
  586. ..._: []
  587. ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>;
  588. zipAll<A, B, C, D, E>(
  589. a: Iterable<A>,
  590. b: Iterable<B>,
  591. c: Iterable<C>,
  592. d: Iterable<D>,
  593. e: Iterable<E>,
  594. ..._: []
  595. ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>;
  596. zipWith<A, R>(
  597. zipper: (value: T, a: A) => R,
  598. a: Iterable<A>,
  599. ..._: []
  600. ): IndexedSeq<R>;
  601. zipWith<A, B, R>(
  602. zipper: (value: T, a: A, b: B) => R,
  603. a: Iterable<A>,
  604. b: Iterable<B>,
  605. ..._: []
  606. ): IndexedSeq<R>;
  607. zipWith<A, B, C, R>(
  608. zipper: (value: T, a: A, b: B, c: C) => R,
  609. a: Iterable<A>,
  610. b: Iterable<B>,
  611. c: Iterable<C>,
  612. ..._: []
  613. ): IndexedSeq<R>;
  614. zipWith<A, B, C, D, R>(
  615. zipper: (value: T, a: A, b: B, c: C, d: D) => R,
  616. a: Iterable<A>,
  617. b: Iterable<B>,
  618. c: Iterable<C>,
  619. d: Iterable<D>,
  620. ..._: []
  621. ): IndexedSeq<R>;
  622. zipWith<A, B, C, D, E, R>(
  623. zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
  624. a: Iterable<A>,
  625. b: Iterable<B>,
  626. c: Iterable<C>,
  627. d: Iterable<D>,
  628. e: Iterable<E>,
  629. ..._: []
  630. ): IndexedSeq<R>;
  631. }
  632. declare class SetSeq<+T> extends Seq<T, T> mixins SetCollection<T> {
  633. static <T>(values?: Iterable<T>): SetSeq<T>;
  634. static of<T>(...values: T[]): SetSeq<T>;
  635. // Override specialized return types
  636. concat<U>(...collections: Iterable<U>[]): SetSeq<T | U>;
  637. filter(predicate: typeof Boolean): SetSeq<$NonMaybeType<T>>;
  638. filter(
  639. predicate: (value: T, value: T, iter: this) => mixed,
  640. context?: mixed
  641. ): SetSeq<T>;
  642. map<M>(
  643. mapper: (value: T, value: T, iter: this) => M,
  644. context?: mixed
  645. ): SetSeq<M>;
  646. flatMap<M>(
  647. mapper: (value: T, value: T, iter: this) => Iterable<M>,
  648. context?: mixed
  649. ): SetSeq<M>;
  650. flatten(depth?: number): SetSeq<any>;
  651. flatten(shallow?: boolean): SetSeq<any>;
  652. }
  653. declare class UpdatableInCollection<K, +V> {
  654. setIn<S>(keyPath: [], value: S): S;
  655. setIn(keyPath: [K], value: V): this;
  656. setIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(keyPath: [K, K2], value: S): this;
  657. setIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>, S: $ValOf<$ValOf<V, K2>, K3>>(
  658. keyPath: [K, K2, K3],
  659. value: S
  660. ): this;
  661. setIn<
  662. K2: $KeyOf<V>,
  663. K3: $KeyOf<$ValOf<V, K2>>,
  664. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  665. S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
  666. >(
  667. keyPath: [K, K2, K3, K4],
  668. value: S
  669. ): this;
  670. setIn<
  671. K2: $KeyOf<V>,
  672. K3: $KeyOf<$ValOf<V, K2>>,
  673. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  674. K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
  675. S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
  676. >(
  677. keyPath: [K, K2, K3, K4, K5],
  678. value: S
  679. ): this;
  680. deleteIn(keyPath: []): void;
  681. deleteIn(keyPath: [K]): this;
  682. deleteIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
  683. deleteIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
  684. keyPath: [K, K2, K3]
  685. ): this;
  686. deleteIn<
  687. K2: $KeyOf<V>,
  688. K3: $KeyOf<$ValOf<V, K2>>,
  689. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
  690. >(
  691. keyPath: [K, K2, K3, K4]
  692. ): this;
  693. deleteIn<
  694. K2: $KeyOf<V>,
  695. K3: $KeyOf<$ValOf<V, K2>>,
  696. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  697. K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
  698. >(
  699. keyPath: [K, K2, K3, K4, K5]
  700. ): this;
  701. removeIn(keyPath: []): void;
  702. removeIn(keyPath: [K]): this;
  703. removeIn<K2: $KeyOf<V>>(keyPath: [K, K2]): this;
  704. removeIn<K2: $KeyOf<V>, K3: $KeyOf<$ValOf<V, K2>>>(
  705. keyPath: [K, K2, K3]
  706. ): this;
  707. removeIn<
  708. K2: $KeyOf<V>,
  709. K3: $KeyOf<$ValOf<V, K2>>,
  710. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>
  711. >(
  712. keyPath: [K, K2, K3, K4]
  713. ): this;
  714. removeIn<
  715. K2: $KeyOf<V>,
  716. K3: $KeyOf<$ValOf<V, K2>>,
  717. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  718. K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>
  719. >(
  720. keyPath: [K, K2, K3, K4, K5]
  721. ): this;
  722. updateIn<U>(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U;
  723. updateIn<U>(keyPath: [], updater: (value: this) => U): U;
  724. updateIn<NSV>(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this;
  725. updateIn(keyPath: [K], updater: (value: V) => V): this;
  726. updateIn<NSV, K2: $KeyOf<V>, S: $ValOf<V, K2>>(
  727. keyPath: [K, K2],
  728. notSetValue: NSV,
  729. updater: (value: $ValOf<V, K2> | NSV) => S
  730. ): this;
  731. updateIn<K2: $KeyOf<V>, S: $ValOf<V, K2>>(
  732. keyPath: [K, K2],
  733. updater: (value: $ValOf<V, K2>) => S
  734. ): this;
  735. updateIn<
  736. NSV,
  737. K2: $KeyOf<V>,
  738. K3: $KeyOf<$ValOf<V, K2>>,
  739. S: $ValOf<$ValOf<V, K2>, K3>
  740. >(
  741. keyPath: [K, K2, K3],
  742. notSetValue: NSV,
  743. updater: (value: $ValOf<$ValOf<V, K2>, K3> | NSV) => S
  744. ): this;
  745. updateIn<
  746. K2: $KeyOf<V>,
  747. K3: $KeyOf<$ValOf<V, K2>>,
  748. S: $ValOf<$ValOf<V, K2>, K3>
  749. >(
  750. keyPath: [K, K2, K3],
  751. updater: (value: $ValOf<$ValOf<V, K2>, K3>) => S
  752. ): this;
  753. updateIn<
  754. NSV,
  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. notSetValue: NSV,
  762. updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4> | NSV) => S
  763. ): this;
  764. updateIn<
  765. K2: $KeyOf<V>,
  766. K3: $KeyOf<$ValOf<V, K2>>,
  767. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  768. S: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>
  769. >(
  770. keyPath: [K, K2, K3, K4],
  771. updater: (value: $ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>) => S
  772. ): this;
  773. updateIn<
  774. NSV,
  775. K2: $KeyOf<V>,
  776. K3: $KeyOf<$ValOf<V, K2>>,
  777. K4: $KeyOf<$ValOf<$ValOf<V, K2>, K3>>,
  778. K5: $KeyOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>>,
  779. S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
  780. >(
  781. keyPath: [K, K2, K3, K4, K5],
  782. notSetValue: NSV,
  783. updater: (
  784. value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5> | NSV
  785. ) => S
  786. ): this;
  787. updateIn<
  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. S: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>
  793. >(
  794. keyPath: [K, K2, K3, K4, K5],
  795. updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<V, K2>, K3>, K4>, K5>) => S
  796. ): this;
  797. }
  798. declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof
  799. List);
  800. declare class List<+T>
  801. extends IndexedCollection<T>
  802. mixins UpdatableInCollection<number, T>
  803. {
  804. static (collection?: Iterable<T>): List<T>;
  805. static of<T>(...values: T[]): List<T>;
  806. static isList: typeof isList;
  807. size: number;
  808. set<U>(index: number, value: U): List<T | U>;
  809. delete(index: number): this;
  810. remove(index: number): this;
  811. insert<U>(index: number, value: U): List<T | U>;
  812. clear(): this;
  813. push<U>(...values: U[]): List<T | U>;
  814. pop(): this;
  815. unshift<U>(...values: U[]): List<T | U>;
  816. shift(): this;
  817. update<U>(updater: (value: this) => U): U;
  818. update<U>(index: number, updater: (value: T) => U): List<T | U>;
  819. update<U>(
  820. index: number,
  821. notSetValue: U,
  822. updater: (value: T) => U
  823. ): List<T | U>;
  824. merge<U>(...collections: Iterable<U>[]): List<T | U>;
  825. setSize(size: number): this;
  826. mergeIn(keyPath: Iterable<mixed>, ...collections: Iterable<mixed>[]): this;
  827. mergeDeepIn(
  828. keyPath: Iterable<mixed>,
  829. ...collections: Iterable<mixed>[]
  830. ): this;
  831. withMutations(mutator: (mutable: this) => mixed): this;
  832. asMutable(): this;
  833. wasAltered(): boolean;
  834. asImmutable(): this;
  835. // Override specialized return types
  836. concat<C>(...iters: Array<Iterable<C> | C>): List<T | C>;
  837. filter(predicate: typeof Boolean): List<$NonMaybeType<T>>;
  838. filter(
  839. predicate: (value: T, index: number, iter: this) => mixed,
  840. context?: mixed
  841. ): List<T>;
  842. map<M>(
  843. mapper: (value: T, index: number, iter: this) => M,
  844. context?: mixed
  845. ): List<M>;
  846. flatMap<M>(
  847. mapper: (value: T, index: number, iter: this) => Iterable<M>,
  848. context?: mixed
  849. ): List<M>;
  850. flatten(depth?: number): List<any>;
  851. flatten(shallow?: boolean): List<any>;
  852. zip<A>(a: Iterable<A>, ..._: []): List<[T, A]>;
  853. zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): List<[T, A, B]>;
  854. zip<A, B, C>(
  855. a: Iterable<A>,
  856. b: Iterable<B>,
  857. c: Iterable<C>,
  858. ..._: []
  859. ): List<[T, A, B, C]>;
  860. zip<A, B, C, D>(
  861. a: Iterable<A>,
  862. b: Iterable<B>,
  863. c: Iterable<C>,
  864. d: Iterable<D>,
  865. ..._: []
  866. ): List<[T, A, B, C, D]>;
  867. zip<A, B, C, D, E>(
  868. a: Iterable<A>,
  869. b: Iterable<B>,
  870. c: Iterable<C>,
  871. d: Iterable<D>,
  872. e: Iterable<E>,
  873. ..._: []
  874. ): List<[T, A, B, C, D, E]>;
  875. zipAll<A>(a: Iterable<A>, ..._: []): List<[T | void, A | void]>;
  876. zipAll<A, B>(
  877. a: Iterable<A>,
  878. b: Iterable<B>,
  879. ..._: []
  880. ): List<[T | void, A | void, B | void]>;
  881. zipAll<A, B, C>(
  882. a: Iterable<A>,
  883. b: Iterable<B>,
  884. c: Iterable<C>,
  885. ..._: []
  886. ): List<[T | void, A | void, B | void, C | void]>;
  887. zipAll<A, B, C, D>(
  888. a: Iterable<A>,
  889. b: Iterable<B>,
  890. c: Iterable<C>,
  891. d: Iterable<D>,
  892. ..._: []
  893. ): List<[T | void, A | void, B | void, C | void, D | void]>;
  894. zipAll<A, B, C, D, E>(
  895. a: Iterable<A>,
  896. b: Iterable<B>,
  897. c: Iterable<C>,
  898. d: Iterable<D>,
  899. e: Iterable<E>,
  900. ..._: []
  901. ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>;
  902. zipWith<A, R>(
  903. zipper: (value: T, a: A) => R,
  904. a: Iterable<A>,
  905. ..._: []
  906. ): List<R>;
  907. zipWith<A, B, R>(
  908. zipper: (value: T, a: A, b: B) => R,
  909. a: Iterable<A>,
  910. b: Iterable<B>,
  911. ..._: []
  912. ): List<R>;
  913. zipWith<A, B, C, R>(
  914. zipper: (value: T, a: A, b: B, c: C) => R,
  915. a: Iterable<A>,
  916. b: Iterable<B>,
  917. c: Iterable<C>,
  918. ..._: []
  919. ): List<R>;
  920. zipWith<A, B, C, D, R>(
  921. zipper: (value: T, a: A, b: B, c: C, d: D) => R,
  922. a: Iterable<A>,
  923. b: Iterable<B>,
  924. c: Iterable<C>,
  925. d: Iterable<D>,
  926. ..._: []
  927. ): List<R>;
  928. zipWith<A, B, C, D, E, R>(
  929. zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
  930. a: Iterable<A>,
  931. b: Iterable<B>,
  932. c: Iterable<C>,
  933. d: Iterable<D>,
  934. e: Iterable<E>,
  935. ..._: []
  936. ): List<R>;
  937. }
  938. declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof
  939. Map);
  940. declare class Map<K, +V>
  941. extends KeyedCollection<K, V>
  942. mixins UpdatableInCollection<K, V>
  943. {
  944. static <K, V>(values?: Iterable<[K, V]> | PlainObjInput<K, V>): Map<K, V>;
  945. static isMap: typeof isMap;
  946. size: number;
  947. set<K_, V_>(key: K_, value: V_): Map<K | K_, V | V_>;
  948. delete(key: K): this;
  949. remove(key: K): this;
  950. clear(): this;
  951. deleteAll(keys: Iterable<K>): Map<K, V>;
  952. removeAll(keys: Iterable<K>): Map<K, V>;
  953. update<U>(updater: (value: this) => U): U;
  954. update<V_>(key: K, updater: (value: V) => V_): Map<K, V | V_>;
  955. update<V_>(
  956. key: K,
  957. notSetValue: V_,
  958. updater: (value: V) => V_
  959. ): Map<K, V | V_>;
  960. merge<K_, V_>(
  961. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  962. ): Map<K | K_, V | V_>;
  963. concat<K_, V_>(
  964. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  965. ): Map<K | K_, V | V_>;
  966. mergeWith<K_, W, X>(
  967. merger: (oldVal: V, newVal: W, key: K) => X,
  968. ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
  969. ): Map<K | K_, V | W | X>;
  970. mergeDeep<K_, V_>(
  971. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  972. ): Map<K | K_, V | V_>;
  973. mergeDeepWith<K_, V_>(
  974. merger: (oldVal: any, newVal: any, key: any) => mixed,
  975. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  976. ): Map<K | K_, V | V_>;
  977. mergeIn(
  978. keyPath: Iterable<mixed>,
  979. ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
  980. ): this;
  981. mergeDeepIn(
  982. keyPath: Iterable<mixed>,
  983. ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
  984. ): this;
  985. withMutations(mutator: (mutable: this) => mixed): this;
  986. asMutable(): this;
  987. wasAltered(): boolean;
  988. asImmutable(): this;
  989. // Override specialized return types
  990. flip(): Map<V, K>;
  991. filter(predicate: typeof Boolean): Map<K, $NonMaybeType<V>>;
  992. filter(
  993. predicate: (value: V, key: K, iter: this) => mixed,
  994. context?: mixed
  995. ): Map<K, V>;
  996. map<M>(
  997. mapper: (value: V, key: K, iter: this) => M,
  998. context?: mixed
  999. ): Map<K, M>;
  1000. mapKeys<M>(
  1001. mapper: (key: K, value: V, iter: this) => M,
  1002. context?: mixed
  1003. ): Map<M, V>;
  1004. mapEntries<KM, VM>(
  1005. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  1006. context?: mixed
  1007. ): Map<KM, VM>;
  1008. flatMap<KM, VM>(
  1009. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  1010. context?: mixed
  1011. ): Map<KM, VM>;
  1012. flatten(depth?: number): Map<any, any>;
  1013. flatten(shallow?: boolean): Map<any, any>;
  1014. }
  1015. declare function isOrderedMap(
  1016. maybeOrderedMap: mixed
  1017. ): boolean %checks(maybeOrderedMap instanceof OrderedMap);
  1018. declare class OrderedMap<K, +V>
  1019. extends Map<K, V>
  1020. mixins UpdatableInCollection<K, V>
  1021. {
  1022. static <K, V>(
  1023. values?: Iterable<[K, V]> | PlainObjInput<K, V>
  1024. ): OrderedMap<K, V>;
  1025. static isOrderedMap: typeof isOrderedMap;
  1026. size: number;
  1027. set<K_, V_>(key: K_, value: V_): OrderedMap<K | K_, V | V_>;
  1028. delete(key: K): this;
  1029. remove(key: K): this;
  1030. clear(): this;
  1031. update<U>(updater: (value: this) => U): U;
  1032. update<V_>(key: K, updater: (value: V) => V_): OrderedMap<K, V | V_>;
  1033. update<V_>(
  1034. key: K,
  1035. notSetValue: V_,
  1036. updater: (value: V) => V_
  1037. ): OrderedMap<K, V | V_>;
  1038. merge<K_, V_>(
  1039. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  1040. ): OrderedMap<K | K_, V | V_>;
  1041. concat<K_, V_>(
  1042. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  1043. ): OrderedMap<K | K_, V | V_>;
  1044. mergeWith<K_, W, X>(
  1045. merger: (oldVal: V, newVal: W, key: K) => X,
  1046. ...collections: (Iterable<[K_, W]> | PlainObjInput<K_, W>)[]
  1047. ): OrderedMap<K | K_, V | W | X>;
  1048. mergeDeep<K_, V_>(
  1049. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  1050. ): OrderedMap<K | K_, V | V_>;
  1051. mergeDeepWith<K_, V_>(
  1052. merger: (oldVal: any, newVal: any, key: any) => mixed,
  1053. ...collections: (Iterable<[K_, V_]> | PlainObjInput<K_, V_>)[]
  1054. ): OrderedMap<K | K_, V | V_>;
  1055. mergeIn(
  1056. keyPath: Iterable<mixed>,
  1057. ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
  1058. ): this;
  1059. mergeDeepIn(
  1060. keyPath: Iterable<mixed>,
  1061. ...collections: (Iterable<mixed> | PlainObjInput<mixed, mixed>)[]
  1062. ): this;
  1063. withMutations(mutator: (mutable: this) => mixed): this;
  1064. asMutable(): this;
  1065. wasAltered(): boolean;
  1066. asImmutable(): this;
  1067. // Override specialized return types
  1068. flip(): OrderedMap<V, K>;
  1069. filter(predicate: typeof Boolean): OrderedMap<K, $NonMaybeType<V>>;
  1070. filter(
  1071. predicate: (value: V, key: K, iter: this) => mixed,
  1072. context?: mixed
  1073. ): OrderedMap<K, V>;
  1074. map<M>(
  1075. mapper: (value: V, key: K, iter: this) => M,
  1076. context?: mixed
  1077. ): OrderedMap<K, M>;
  1078. mapKeys<M>(
  1079. mapper: (key: K, value: V, iter: this) => M,
  1080. context?: mixed
  1081. ): OrderedMap<M, V>;
  1082. mapEntries<KM, VM>(
  1083. mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
  1084. context?: mixed
  1085. ): OrderedMap<KM, VM>;
  1086. flatMap<KM, VM>(
  1087. mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
  1088. context?: mixed
  1089. ): OrderedMap<KM, VM>;
  1090. flatten(depth?: number): OrderedMap<any, any>;
  1091. flatten(shallow?: boolean): OrderedMap<any, any>;
  1092. }
  1093. declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof
  1094. Set);
  1095. declare class Set<+T> extends SetCollection<T> {
  1096. static <T>(values?: Iterable<T>): Set<T>;
  1097. static of<T>(...values: T[]): Set<T>;
  1098. static fromKeys<T>(
  1099. values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
  1100. ): Set<T>;
  1101. static intersect(sets: Iterable<Iterable<T>>): Set<T>;
  1102. static union(sets: Iterable<Iterable<T>>): Set<T>;
  1103. static isSet: typeof isSet;
  1104. size: number;
  1105. add<U>(value: U): Set<T | U>;
  1106. delete(value: T): this;
  1107. remove(value: T): this;
  1108. clear(): this;
  1109. union<U>(...collections: Iterable<U>[]): Set<T | U>;
  1110. merge<U>(...collections: Iterable<U>[]): Set<T | U>;
  1111. concat<U>(...collections: Iterable<U>[]): Set<T | U>;
  1112. intersect<U>(...collections: Iterable<U>[]): Set<T & U>;
  1113. subtract(...collections: Iterable<mixed>[]): this;
  1114. withMutations(mutator: (mutable: this) => mixed): this;
  1115. asMutable(): this;
  1116. wasAltered(): boolean;
  1117. asImmutable(): this;
  1118. // Override specialized return types
  1119. filter(predicate: typeof Boolean): Set<$NonMaybeType<T>>;
  1120. filter(
  1121. predicate: (value: T, value: T, iter: this) => mixed,
  1122. context?: mixed
  1123. ): Set<T>;
  1124. map<M>(
  1125. mapper: (value: T, value: T, iter: this) => M,
  1126. context?: mixed
  1127. ): Set<M>;
  1128. flatMap<M>(
  1129. mapper: (value: T, value: T, iter: this) => Iterable<M>,
  1130. context?: mixed
  1131. ): Set<M>;
  1132. flatten(depth?: number): Set<any>;
  1133. flatten(shallow?: boolean): Set<any>;
  1134. }
  1135. // Overrides except for `isOrderedSet` are for specialized return types
  1136. declare function isOrderedSet(
  1137. maybeOrderedSet: mixed
  1138. ): boolean %checks(maybeOrderedSet instanceof OrderedSet);
  1139. declare class OrderedSet<+T> extends Set<T> {
  1140. static <T>(values?: Iterable<T>): OrderedSet<T>;
  1141. static of<T>(...values: T[]): OrderedSet<T>;
  1142. static fromKeys<T>(
  1143. values: Iterable<[T, mixed]> | PlainObjInput<T, mixed>
  1144. ): OrderedSet<T>;
  1145. static isOrderedSet: typeof isOrderedSet;
  1146. size: number;
  1147. add<U>(value: U): OrderedSet<T | U>;
  1148. union<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
  1149. merge<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
  1150. concat<U>(...collections: Iterable<U>[]): OrderedSet<T | U>;
  1151. intersect<U>(...collections: Iterable<U>[]): OrderedSet<T & U>;
  1152. filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType<T>>;
  1153. filter(
  1154. predicate: (value: T, value: T, iter: this) => mixed,
  1155. context?: mixed
  1156. ): OrderedSet<T>;
  1157. map<M>(
  1158. mapper: (value: T, value: T, iter: this) => M,
  1159. context?: mixed
  1160. ): OrderedSet<M>;
  1161. flatMap<M>(
  1162. mapper: (value: T, value: T, iter: this) => Iterable<M>,
  1163. context?: mixed
  1164. ): OrderedSet<M>;
  1165. flatten(depth?: number): OrderedSet<any>;
  1166. flatten(shallow?: boolean): OrderedSet<any>;
  1167. zip<A>(a: Iterable<A>, ..._: []): OrderedSet<[T, A]>;
  1168. zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): OrderedSet<[T, A, B]>;
  1169. zip<A, B, C>(
  1170. a: Iterable<A>,
  1171. b: Iterable<B>,
  1172. c: Iterable<C>,
  1173. ..._: []
  1174. ): OrderedSet<[T, A, B, C]>;
  1175. zip<A, B, C, D>(
  1176. a: Iterable<A>,
  1177. b: Iterable<B>,
  1178. c: Iterable<C>,
  1179. d: Iterable<D>,
  1180. ..._: []
  1181. ): OrderedSet<[T, A, B, C, D]>;
  1182. zip<A, B, C, D, E>(
  1183. a: Iterable<A>,
  1184. b: Iterable<B>,
  1185. c: Iterable<C>,
  1186. d: Iterable<D>,
  1187. e: Iterable<E>,
  1188. ..._: []
  1189. ): OrderedSet<[T, A, B, C, D, E]>;
  1190. zipAll<A>(a: Iterable<A>, ..._: []): OrderedSet<[T | void, A | void]>;
  1191. zipAll<A, B>(
  1192. a: Iterable<A>,
  1193. b: Iterable<B>,
  1194. ..._: []
  1195. ): OrderedSet<[T | void, A | void, B | void]>;
  1196. zipAll<A, B, C>(
  1197. a: Iterable<A>,
  1198. b: Iterable<B>,
  1199. c: Iterable<C>,
  1200. ..._: []
  1201. ): OrderedSet<[T | void, A | void, B | void, C | void]>;
  1202. zipAll<A, B, C, D>(
  1203. a: Iterable<A>,
  1204. b: Iterable<B>,
  1205. c: Iterable<C>,
  1206. d: Iterable<D>,
  1207. ..._: []
  1208. ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>;
  1209. zipAll<A, B, C, D, E>(
  1210. a: Iterable<A>,
  1211. b: Iterable<B>,
  1212. c: Iterable<C>,
  1213. d: Iterable<D>,
  1214. e: Iterable<E>,
  1215. ..._: []
  1216. ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>;
  1217. zipWith<A, R>(
  1218. zipper: (value: T, a: A) => R,
  1219. a: Iterable<A>,
  1220. ..._: []
  1221. ): OrderedSet<R>;
  1222. zipWith<A, B, R>(
  1223. zipper: (value: T, a: A, b: B) => R,
  1224. a: Iterable<A>,
  1225. b: Iterable<B>,
  1226. ..._: []
  1227. ): OrderedSet<R>;
  1228. zipWith<A, B, C, R>(
  1229. zipper: (value: T, a: A, b: B, c: C) => R,
  1230. a: Iterable<A>,
  1231. b: Iterable<B>,
  1232. c: Iterable<C>,
  1233. ..._: []
  1234. ): OrderedSet<R>;
  1235. zipWith<A, B, C, D, R>(
  1236. zipper: (value: T, a: A, b: B, c: C, d: D) => R,
  1237. a: Iterable<A>,
  1238. b: Iterable<B>,
  1239. c: Iterable<C>,
  1240. d: Iterable<D>,
  1241. ..._: []
  1242. ): OrderedSet<R>;
  1243. zipWith<A, B, C, D, E, R>(
  1244. zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
  1245. a: Iterable<A>,
  1246. b: Iterable<B>,
  1247. c: Iterable<C>,
  1248. d: Iterable<D>,
  1249. e: Iterable<E>,
  1250. ..._: []
  1251. ): OrderedSet<R>;
  1252. }
  1253. declare function isStack(
  1254. maybeStack: mixed
  1255. ): boolean %checks(maybeStack instanceof Stack);
  1256. declare class Stack<+T> extends IndexedCollection<T> {
  1257. static <T>(collection?: Iterable<T>): Stack<T>;
  1258. static isStack(maybeStack: mixed): boolean;
  1259. static of<T>(...values: T[]): Stack<T>;
  1260. static isStack: typeof isStack;
  1261. size: number;
  1262. peek(): T;
  1263. clear(): this;
  1264. unshift<U>(...values: U[]): Stack<T | U>;
  1265. unshiftAll<U>(iter: Iterable<U>): Stack<T | U>;
  1266. shift(): this;
  1267. push<U>(...values: U[]): Stack<T | U>;
  1268. pushAll<U>(iter: Iterable<U>): Stack<T | U>;
  1269. pop(): this;
  1270. withMutations(mutator: (mutable: this) => mixed): this;
  1271. asMutable(): this;
  1272. wasAltered(): boolean;
  1273. asImmutable(): this;
  1274. // Override specialized return types
  1275. concat<C>(...iters: Array<Iterable<C> | C>): Stack<T | C>;
  1276. filter(predicate: typeof Boolean): Stack<$NonMaybeType<T>>;
  1277. filter(
  1278. predicate: (value: T, index: number, iter: this) => mixed,
  1279. context?: mixed
  1280. ): Stack<T>;
  1281. map<M>(
  1282. mapper: (value: T, index: number, iter: this) => M,
  1283. context?: mixed
  1284. ): Stack<M>;
  1285. flatMap<M>(
  1286. mapper: (value: T, index: number, iter: this) => Iterable<M>,
  1287. context?: mixed
  1288. ): Stack<M>;
  1289. flatten(depth?: number): Stack<any>;
  1290. flatten(shallow?: boolean): Stack<any>;
  1291. zip<A>(a: Iterable<A>, ..._: []): Stack<[T, A]>;
  1292. zip<A, B>(a: Iterable<A>, b: Iterable<B>, ..._: []): Stack<[T, A, B]>;
  1293. zip<A, B, C>(
  1294. a: Iterable<A>,
  1295. b: Iterable<B>,
  1296. c: Iterable<C>,
  1297. ..._: []
  1298. ): Stack<[T, A, B, C]>;
  1299. zip<A, B, C, D>(
  1300. a: Iterable<A>,
  1301. b: Iterable<B>,
  1302. c: Iterable<C>,
  1303. d: Iterable<D>,
  1304. ..._: []
  1305. ): Stack<[T, A, B, C, D]>;
  1306. zip<A, B, C, D, E>(
  1307. a: Iterable<A>,
  1308. b: Iterable<B>,
  1309. c: Iterable<C>,
  1310. d: Iterable<D>,
  1311. e: Iterable<E>,
  1312. ..._: []
  1313. ): Stack<[T, A, B, C, D, E]>;
  1314. zipAll<A>(a: Iterable<A>, ..._: []): Stack<[T | void, A | void]>;
  1315. zipAll<A, B>(
  1316. a: Iterable<A>,
  1317. b: Iterable<B>,
  1318. ..._: []
  1319. ): Stack<[T | void, A | void, B | void]>;
  1320. zipAll<A, B, C>(
  1321. a: Iterable<A>,
  1322. b: Iterable<B>,
  1323. c: Iterable<C>,
  1324. ..._: []
  1325. ): Stack<[T | void, A | void, B | void, C | void]>;
  1326. zipAll<A, B, C, D>(
  1327. a: Iterable<A>,
  1328. b: Iterable<B>,
  1329. c: Iterable<C>,
  1330. d: Iterable<D>,
  1331. ..._: []
  1332. ): Stack<[T | void, A | void, B | void, C | void, D | void]>;
  1333. zipAll<A, B, C, D, E>(
  1334. a: Iterable<A>,
  1335. b: Iterable<B>,
  1336. c: Iterable<C>,
  1337. d: Iterable<D>,
  1338. e: Iterable<E>,
  1339. ..._: []
  1340. ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>;
  1341. zipWith<A, R>(
  1342. zipper: (value: T, a: A) => R,
  1343. a: Iterable<A>,
  1344. ..._: []
  1345. ): Stack<R>;
  1346. zipWith<A, B, R>(
  1347. zipper: (value: T, a: A, b: B) => R,
  1348. a: Iterable<A>,
  1349. b: Iterable<B>,
  1350. ..._: []
  1351. ): Stack<R>;
  1352. zipWith<A, B, C, R>(
  1353. zipper: (value: T, a: A, b: B, c: C) => R,
  1354. a: Iterable<A>,
  1355. b: Iterable<B>,
  1356. c: Iterable<C>,
  1357. ..._: []
  1358. ): Stack<R>;
  1359. zipWith<A, B, C, D, R>(
  1360. zipper: (value: T, a: A, b: B, c: C, d: D) => R,
  1361. a: Iterable<A>,
  1362. b: Iterable<B>,
  1363. c: Iterable<C>,
  1364. d: Iterable<D>,
  1365. ..._: []
  1366. ): Stack<R>;
  1367. zipWith<A, B, C, D, E, R>(
  1368. zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R,
  1369. a: Iterable<A>,
  1370. b: Iterable<B>,
  1371. c: Iterable<C>,
  1372. d: Iterable<D>,
  1373. e: Iterable<E>,
  1374. ..._: []
  1375. ): Stack<R>;
  1376. }
  1377. declare function Range(
  1378. start?: number,
  1379. end?: number,
  1380. step?: number
  1381. ): IndexedSeq<number>;
  1382. declare function Repeat<T>(value: T, times?: number): IndexedSeq<T>;
  1383. // The type of a Record factory function.
  1384. type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
  1385. // The type of runtime Record instances.
  1386. type RecordOf<Values: Object> = RecordInstance<Values> & $ReadOnly<Values>;
  1387. // The values of a Record instance.
  1388. type _RecordValues<T, R: RecordInstance<T> | T> = R;
  1389. type RecordValues<R> = _RecordValues<*, R>;
  1390. declare function isRecord(
  1391. maybeRecord: any
  1392. ): boolean %checks(maybeRecord instanceof RecordInstance);
  1393. declare class Record {
  1394. static <Values: Object>(spec: Values, name?: string): typeof RecordInstance;
  1395. constructor<Values: Object>(
  1396. spec: Values,
  1397. name?: string
  1398. ): typeof RecordInstance;
  1399. static isRecord: typeof isRecord;
  1400. static getDescriptiveName(record: RecordInstance<any>): string;
  1401. }
  1402. declare class RecordInstance<T: Object = Object> {
  1403. static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>;
  1404. // Note: a constructor can only create an instance of RecordInstance<T>,
  1405. // it's encouraged to not use `new` when creating Records.
  1406. constructor(values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
  1407. size: number;
  1408. has(key: string): boolean;
  1409. get<K: $Keys<T>>(key: K, ..._: []): $ElementType<T, K>;
  1410. get<K: $Keys<T>, NSV>(key: K, notSetValue: NSV): $ElementType<T, K> | NSV;
  1411. hasIn(keyPath: Iterable<mixed>): boolean;
  1412. getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly<T>;
  1413. getIn<K: $Keys<T>>(keyPath: [K], notSetValue?: mixed): $ElementType<T, K>;
  1414. getIn<NSV, K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
  1415. keyPath: [K, K2],
  1416. notSetValue: NSV
  1417. ): $ValOf<$ValOf<T, K>, K2> | NSV;
  1418. getIn<
  1419. NSV,
  1420. K: $Keys<T>,
  1421. K2: $KeyOf<$ValOf<T, K>>,
  1422. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
  1423. >(
  1424. keyPath: [K, K2, K3],
  1425. notSetValue: NSV
  1426. ): $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV;
  1427. getIn<
  1428. NSV,
  1429. K: $Keys<T>,
  1430. K2: $KeyOf<$ValOf<T, K>>,
  1431. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1432. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
  1433. >(
  1434. keyPath: [K, K2, K3, K4],
  1435. notSetValue: NSV
  1436. ): $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV;
  1437. getIn<
  1438. NSV,
  1439. K: $Keys<T>,
  1440. K2: $KeyOf<$ValOf<T, K>>,
  1441. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1442. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1443. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
  1444. >(
  1445. keyPath: [K, K2, K3, K4, K5],
  1446. notSetValue: NSV
  1447. ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV;
  1448. equals(other: any): boolean;
  1449. hashCode(): number;
  1450. set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & $ReadOnly<T>;
  1451. update<K: $Keys<T>>(
  1452. key: K,
  1453. updater: (value: $ElementType<T, K>) => $ElementType<T, K>
  1454. ): this & $ReadOnly<T>;
  1455. merge(
  1456. ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
  1457. ): this & $ReadOnly<T>;
  1458. mergeDeep(
  1459. ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
  1460. ): this & $ReadOnly<T>;
  1461. mergeWith(
  1462. merger: (oldVal: $ValOf<T>, newVal: $ValOf<T>, key: $Keys<T>) => $ValOf<T>,
  1463. ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
  1464. ): this & $ReadOnly<T>;
  1465. mergeDeepWith(
  1466. merger: (oldVal: any, newVal: any, key: any) => any,
  1467. ...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
  1468. ): this & $ReadOnly<T>;
  1469. delete<K: $Keys<T>>(key: K): this & $ReadOnly<T>;
  1470. remove<K: $Keys<T>>(key: K): this & $ReadOnly<T>;
  1471. clear(): this & $ReadOnly<T>;
  1472. setIn<S>(keyPath: [], value: S): S;
  1473. setIn<K: $Keys<T>, S: $ValOf<T, K>>(
  1474. keyPath: [K],
  1475. value: S
  1476. ): this & $ReadOnly<T>;
  1477. setIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(
  1478. keyPath: [K, K2],
  1479. value: S
  1480. ): this & $ReadOnly<T>;
  1481. setIn<
  1482. K: $Keys<T>,
  1483. K2: $KeyOf<$ValOf<T, K>>,
  1484. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1485. S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
  1486. >(
  1487. keyPath: [K, K2, K3],
  1488. value: S
  1489. ): this & $ReadOnly<T>;
  1490. setIn<
  1491. K: $Keys<T>,
  1492. K2: $KeyOf<$ValOf<T, K>>,
  1493. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1494. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1495. S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
  1496. >(
  1497. keyPath: [K, K2, K3, K4],
  1498. value: S
  1499. ): this & $ReadOnly<T>;
  1500. setIn<
  1501. K: $Keys<T>,
  1502. K2: $KeyOf<$ValOf<T, K>>,
  1503. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1504. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1505. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
  1506. S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
  1507. >(
  1508. keyPath: [K, K2, K3, K4, K5],
  1509. value: S
  1510. ): this & $ReadOnly<T>;
  1511. deleteIn(keyPath: []): void;
  1512. deleteIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>;
  1513. deleteIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
  1514. keyPath: [K, K2]
  1515. ): this & $ReadOnly<T>;
  1516. deleteIn<
  1517. K: $Keys<T>,
  1518. K2: $KeyOf<$ValOf<T, K>>,
  1519. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
  1520. >(
  1521. keyPath: [K, K2, K3]
  1522. ): this & $ReadOnly<T>;
  1523. deleteIn<
  1524. K: $Keys<T>,
  1525. K2: $KeyOf<$ValOf<T, K>>,
  1526. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1527. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
  1528. >(
  1529. keyPath: [K, K2, K3, K4]
  1530. ): this & $ReadOnly<T>;
  1531. deleteIn<
  1532. K: $Keys<T>,
  1533. K2: $KeyOf<$ValOf<T, K>>,
  1534. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1535. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1536. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
  1537. >(
  1538. keyPath: [K, K2, K3, K4, K5]
  1539. ): this & $ReadOnly<T>;
  1540. removeIn(keyPath: []): void;
  1541. removeIn<K: $Keys<T>>(keyPath: [K]): this & $ReadOnly<T>;
  1542. removeIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>>(
  1543. keyPath: [K, K2]
  1544. ): this & $ReadOnly<T>;
  1545. removeIn<
  1546. K: $Keys<T>,
  1547. K2: $KeyOf<$ValOf<T, K>>,
  1548. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>
  1549. >(
  1550. keyPath: [K, K2, K3]
  1551. ): this & $ReadOnly<T>;
  1552. removeIn<
  1553. K: $Keys<T>,
  1554. K2: $KeyOf<$ValOf<T, K>>,
  1555. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1556. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>
  1557. >(
  1558. keyPath: [K, K2, K3, K4]
  1559. ): this & $ReadOnly<T>;
  1560. removeIn<
  1561. K: $Keys<T>,
  1562. K2: $KeyOf<$ValOf<T, K>>,
  1563. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1564. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1565. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>
  1566. >(
  1567. keyPath: [K, K2, K3, K4, K5]
  1568. ): this & $ReadOnly<T>;
  1569. updateIn<U>(
  1570. keyPath: [],
  1571. notSetValue: mixed,
  1572. updater: (value: this & T) => U
  1573. ): U;
  1574. updateIn<U>(keyPath: [], updater: (value: this & T) => U): U;
  1575. updateIn<NSV, K: $Keys<T>, S: $ValOf<T, K>>(
  1576. keyPath: [K],
  1577. notSetValue: NSV,
  1578. updater: (value: $ValOf<T, K>) => S
  1579. ): this & $ReadOnly<T>;
  1580. updateIn<K: $Keys<T>, S: $ValOf<T, K>>(
  1581. keyPath: [K],
  1582. updater: (value: $ValOf<T, K>) => S
  1583. ): this & $ReadOnly<T>;
  1584. updateIn<
  1585. NSV,
  1586. K: $Keys<T>,
  1587. K2: $KeyOf<$ValOf<T, K>>,
  1588. S: $ValOf<$ValOf<T, K>, K2>
  1589. >(
  1590. keyPath: [K, K2],
  1591. notSetValue: NSV,
  1592. updater: (value: $ValOf<$ValOf<T, K>, K2> | NSV) => S
  1593. ): this & $ReadOnly<T>;
  1594. updateIn<K: $Keys<T>, K2: $KeyOf<$ValOf<T, K>>, S: $ValOf<$ValOf<T, K>, K2>>(
  1595. keyPath: [K, K2],
  1596. updater: (value: $ValOf<$ValOf<T, K>, K2>) => S
  1597. ): this & $ReadOnly<T>;
  1598. updateIn<
  1599. NSV,
  1600. K: $Keys<T>,
  1601. K2: $KeyOf<$ValOf<T, K>>,
  1602. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1603. S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
  1604. >(
  1605. keyPath: [K, K2, K3],
  1606. notSetValue: NSV,
  1607. updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3> | NSV) => S
  1608. ): this & $ReadOnly<T>;
  1609. updateIn<
  1610. K: $Keys<T>,
  1611. K2: $KeyOf<$ValOf<T, K>>,
  1612. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1613. S: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>
  1614. >(
  1615. keyPath: [K, K2, K3],
  1616. updater: (value: $ValOf<$ValOf<$ValOf<T, K>, K2>, K3>) => S
  1617. ): this & $ReadOnly<T>;
  1618. updateIn<
  1619. NSV,
  1620. K: $Keys<T>,
  1621. K2: $KeyOf<$ValOf<T, K>>,
  1622. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1623. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1624. S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
  1625. >(
  1626. keyPath: [K, K2, K3, K4],
  1627. notSetValue: NSV,
  1628. updater: (
  1629. value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4> | NSV
  1630. ) => S
  1631. ): this & $ReadOnly<T>;
  1632. updateIn<
  1633. K: $Keys<T>,
  1634. K2: $KeyOf<$ValOf<T, K>>,
  1635. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1636. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1637. S: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>
  1638. >(
  1639. keyPath: [K, K2, K3, K4],
  1640. updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>) => S
  1641. ): this & $ReadOnly<T>;
  1642. updateIn<
  1643. NSV,
  1644. K: $Keys<T>,
  1645. K2: $KeyOf<$ValOf<T, K>>,
  1646. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1647. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1648. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
  1649. S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
  1650. >(
  1651. keyPath: [K, K2, K3, K4, K5],
  1652. notSetValue: NSV,
  1653. updater: (
  1654. value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5> | NSV
  1655. ) => S
  1656. ): this & $ReadOnly<T>;
  1657. updateIn<
  1658. K: $Keys<T>,
  1659. K2: $KeyOf<$ValOf<T, K>>,
  1660. K3: $KeyOf<$ValOf<$ValOf<T, K>, K2>>,
  1661. K4: $KeyOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>>,
  1662. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>>,
  1663. S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
  1664. >(
  1665. keyPath: [K, K2, K3, K4, K5],
  1666. updater: (
  1667. value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<T, K>, K2>, K3>, K4>, K5>
  1668. ) => S
  1669. ): this & $ReadOnly<T>;
  1670. mergeIn(
  1671. keyPath: Iterable<mixed>,
  1672. ...collections: Array<any>
  1673. ): this & $ReadOnly<T>;
  1674. mergeDeepIn(
  1675. keyPath: Iterable<mixed>,
  1676. ...collections: Array<any>
  1677. ): this & $ReadOnly<T>;
  1678. toSeq(): KeyedSeq<$Keys<T>, any>;
  1679. toJS(): { [key: $Keys<T>]: mixed };
  1680. toJSON(): T;
  1681. toObject(): T;
  1682. withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly<T>;
  1683. asMutable(): this & $ReadOnly<T>;
  1684. wasAltered(): boolean;
  1685. asImmutable(): this & $ReadOnly<T>;
  1686. @@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;
  1687. }
  1688. declare function fromJS(
  1689. jsValue: mixed,
  1690. reviver?: (
  1691. key: string | number,
  1692. sequence: KeyedCollection<string, mixed> | IndexedCollection<mixed>,
  1693. path?: Array<string | number>
  1694. ) => mixed
  1695. ): Collection<mixed, mixed>;
  1696. declare function is(first: mixed, second: mixed): boolean;
  1697. declare function hash(value: mixed): number;
  1698. declare function get<C: Object, K: $Keys<C>>(
  1699. collection: C,
  1700. key: K,
  1701. notSetValue: mixed
  1702. ): $ValOf<C, K>;
  1703. declare function get<C, K: $KeyOf<C>, NSV>(
  1704. collection: C,
  1705. key: K,
  1706. notSetValue: NSV
  1707. ): $ValOf<C, K> | NSV;
  1708. declare function has(collection: Object, key: mixed): boolean;
  1709. declare function remove<C>(collection: C, key: $KeyOf<C>): C;
  1710. declare function set<C, K: $KeyOf<C>, V: $ValOf<C, K>>(
  1711. collection: C,
  1712. key: K,
  1713. value: V
  1714. ): C;
  1715. declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>, NSV>(
  1716. collection: C,
  1717. key: K,
  1718. notSetValue: NSV,
  1719. updater: ($ValOf<C, K> | NSV) => V
  1720. ): C;
  1721. declare function update<C, K: $KeyOf<C>, V: $ValOf<C, K>>(
  1722. collection: C,
  1723. key: K,
  1724. updater: ($ValOf<C, K>) => V
  1725. ): C;
  1726. declare function getIn<C>(collection: C, keyPath: [], notSetValue?: mixed): C;
  1727. declare function getIn<C, K: $KeyOf<C>, NSV>(
  1728. collection: C,
  1729. keyPath: [K],
  1730. notSetValue: NSV
  1731. ): $ValOf<C, K> | NSV;
  1732. declare function getIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, NSV>(
  1733. collection: C,
  1734. keyPath: [K, K2],
  1735. notSetValue: NSV
  1736. ): $ValOf<$ValOf<C, K>, K2> | NSV;
  1737. declare function getIn<
  1738. C,
  1739. K: $KeyOf<C>,
  1740. K2: $KeyOf<$ValOf<C, K>>,
  1741. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1742. NSV
  1743. >(
  1744. collection: C,
  1745. keyPath: [K, K2, K3],
  1746. notSetValue: NSV
  1747. ): $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV;
  1748. declare function getIn<
  1749. C,
  1750. K: $KeyOf<C>,
  1751. K2: $KeyOf<$ValOf<C, K>>,
  1752. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1753. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1754. NSV
  1755. >(
  1756. collection: C,
  1757. keyPath: [K, K2, K3, K4],
  1758. notSetValue: NSV
  1759. ): $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV;
  1760. declare function getIn<
  1761. C,
  1762. K: $KeyOf<C>,
  1763. K2: $KeyOf<$ValOf<C, K>>,
  1764. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1765. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1766. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
  1767. NSV
  1768. >(
  1769. collection: C,
  1770. keyPath: [K, K2, K3, K4, K5],
  1771. notSetValue: NSV
  1772. ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV;
  1773. declare function hasIn(collection: Object, keyPath: Iterable<mixed>): boolean;
  1774. declare function removeIn<C>(collection: C, keyPath: []): void;
  1775. declare function removeIn<C, K: $KeyOf<C>>(collection: C, keyPath: [K]): C;
  1776. declare function removeIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C>>>(
  1777. collection: C,
  1778. keyPath: [K, K2]
  1779. ): C;
  1780. declare function removeIn<
  1781. C,
  1782. K: $KeyOf<C>,
  1783. K2: $KeyOf<$ValOf<C>>,
  1784. K3: $KeyOf<$ValOf<$ValOf<C>, K2>>
  1785. >(
  1786. collection: C,
  1787. keyPath: [K, K2, K3]
  1788. ): C;
  1789. declare function removeIn<
  1790. C,
  1791. K: $KeyOf<C>,
  1792. K2: $KeyOf<$ValOf<C>>,
  1793. K3: $KeyOf<$ValOf<$ValOf<C>, K2>>,
  1794. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>>
  1795. >(
  1796. collection: C,
  1797. keyPath: [K, K2, K3, K4]
  1798. ): C;
  1799. declare function removeIn<
  1800. C,
  1801. K: $KeyOf<C>,
  1802. K2: $KeyOf<$ValOf<C>>,
  1803. K3: $KeyOf<$ValOf<$ValOf<C>, K2>>,
  1804. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>>,
  1805. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C>, K2>, K3>, K4>>
  1806. >(
  1807. collection: C,
  1808. keyPath: [K, K2, K3, K4, K5]
  1809. ): C;
  1810. declare function setIn<S>(collection: Object, keyPath: [], value: S): S;
  1811. declare function setIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(
  1812. collection: C,
  1813. keyPath: [K],
  1814. value: S
  1815. ): C;
  1816. declare function setIn<
  1817. C,
  1818. K: $KeyOf<C>,
  1819. K2: $KeyOf<$ValOf<C, K>>,
  1820. S: $ValOf<$ValOf<C, K>, K2>
  1821. >(
  1822. collection: C,
  1823. keyPath: [K, K2],
  1824. value: S
  1825. ): C;
  1826. declare function setIn<
  1827. C,
  1828. K: $KeyOf<C>,
  1829. K2: $KeyOf<$ValOf<C, K>>,
  1830. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1831. S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>
  1832. >(
  1833. collection: C,
  1834. keyPath: [K, K2, K3],
  1835. value: S
  1836. ): C;
  1837. declare function setIn<
  1838. C,
  1839. K: $KeyOf<C>,
  1840. K2: $KeyOf<$ValOf<C, K>>,
  1841. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1842. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1843. S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>
  1844. >(
  1845. collection: C,
  1846. keyPath: [K, K2, K3, K4],
  1847. value: S
  1848. ): C;
  1849. declare function setIn<
  1850. C,
  1851. K: $KeyOf<C>,
  1852. K2: $KeyOf<$ValOf<C, K>>,
  1853. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1854. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1855. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
  1856. S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
  1857. >(
  1858. collection: C,
  1859. keyPath: [K, K2, K3, K4, K5],
  1860. value: S
  1861. ): C;
  1862. declare function updateIn<C, S>(
  1863. collection: C,
  1864. keyPath: [],
  1865. notSetValue: mixed,
  1866. updater: (value: C) => S
  1867. ): S;
  1868. declare function updateIn<C, S>(
  1869. collection: C,
  1870. keyPath: [],
  1871. updater: (value: C) => S
  1872. ): S;
  1873. declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>, NSV>(
  1874. collection: C,
  1875. keyPath: [K],
  1876. notSetValue: NSV,
  1877. updater: (value: $ValOf<C, K> | NSV) => S
  1878. ): C;
  1879. declare function updateIn<C, K: $KeyOf<C>, S: $ValOf<C, K>>(
  1880. collection: C,
  1881. keyPath: [K],
  1882. updater: (value: $ValOf<C, K>) => S
  1883. ): C;
  1884. declare function updateIn<
  1885. C,
  1886. K: $KeyOf<C>,
  1887. K2: $KeyOf<$ValOf<C, K>>,
  1888. S: $ValOf<$ValOf<C, K>, K2>,
  1889. NSV
  1890. >(
  1891. collection: C,
  1892. keyPath: [K, K2],
  1893. notSetValue: NSV,
  1894. updater: (value: $ValOf<$ValOf<C, K>, K2> | NSV) => S
  1895. ): C;
  1896. declare function updateIn<
  1897. C,
  1898. K: $KeyOf<C>,
  1899. K2: $KeyOf<$ValOf<C, K>>,
  1900. S: $ValOf<$ValOf<C, K>, K2>
  1901. >(
  1902. collection: C,
  1903. keyPath: [K, K2],
  1904. updater: (value: $ValOf<$ValOf<C, K>, K2>) => S
  1905. ): C;
  1906. declare function updateIn<
  1907. C,
  1908. K: $KeyOf<C>,
  1909. K2: $KeyOf<$ValOf<C, K>>,
  1910. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1911. S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>,
  1912. NSV
  1913. >(
  1914. collection: C,
  1915. keyPath: [K, K2, K3],
  1916. notSetValue: NSV,
  1917. updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3> | NSV) => S
  1918. ): C;
  1919. declare function updateIn<
  1920. C,
  1921. K: $KeyOf<C>,
  1922. K2: $KeyOf<$ValOf<C, K>>,
  1923. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1924. S: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>
  1925. >(
  1926. collection: C,
  1927. keyPath: [K, K2, K3],
  1928. updater: (value: $ValOf<$ValOf<$ValOf<C, K>, K2>, K3>) => S
  1929. ): C;
  1930. declare function updateIn<
  1931. C,
  1932. K: $KeyOf<C>,
  1933. K2: $KeyOf<$ValOf<C, K>>,
  1934. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1935. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1936. S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>,
  1937. NSV
  1938. >(
  1939. collection: C,
  1940. keyPath: [K, K2, K3, K4],
  1941. notSetValue: NSV,
  1942. updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4> | NSV) => S
  1943. ): C;
  1944. declare function updateIn<
  1945. C,
  1946. K: $KeyOf<C>,
  1947. K2: $KeyOf<$ValOf<C, K>>,
  1948. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1949. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1950. S: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>
  1951. >(
  1952. collection: C,
  1953. keyPath: [K, K2, K3, K4],
  1954. updater: (value: $ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>) => S
  1955. ): C;
  1956. declare function updateIn<
  1957. C,
  1958. K: $KeyOf<C>,
  1959. K2: $KeyOf<$ValOf<C, K>>,
  1960. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1961. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1962. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
  1963. S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>,
  1964. NSV
  1965. >(
  1966. collection: C,
  1967. keyPath: [K, K2, K3, K4, K5],
  1968. notSetValue: NSV,
  1969. updater: (
  1970. value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5> | NSV
  1971. ) => S
  1972. ): C;
  1973. declare function updateIn<
  1974. C,
  1975. K: $KeyOf<C>,
  1976. K2: $KeyOf<$ValOf<C, K>>,
  1977. K3: $KeyOf<$ValOf<$ValOf<C, K>, K2>>,
  1978. K4: $KeyOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>>,
  1979. K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>>,
  1980. S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
  1981. >(
  1982. collection: C,
  1983. keyPath: [K, K2, K3, K4, K5],
  1984. updater: (
  1985. value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf<C, K>, K2>, K3>, K4>, K5>
  1986. ) => S
  1987. ): C;
  1988. declare function merge<C>(
  1989. collection: C,
  1990. ...collections: Array<
  1991. | $IterableOf<C>
  1992. | $Shape<RecordValues<C>>
  1993. | PlainObjInput<$KeyOf<C>, $ValOf<C>>
  1994. >
  1995. ): C;
  1996. declare function mergeWith<C>(
  1997. merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>,
  1998. collection: C,
  1999. ...collections: Array<
  2000. | $IterableOf<C>
  2001. | $Shape<RecordValues<C>>
  2002. | PlainObjInput<$KeyOf<C>, $ValOf<C>>
  2003. >
  2004. ): C;
  2005. declare function mergeDeep<C>(
  2006. collection: C,
  2007. ...collections: Array<
  2008. | $IterableOf<C>
  2009. | $Shape<RecordValues<C>>
  2010. | PlainObjInput<$KeyOf<C>, $ValOf<C>>
  2011. >
  2012. ): C;
  2013. declare function mergeDeepWith<C>(
  2014. merger: (oldVal: any, newVal: any, key: any) => mixed,
  2015. collection: C,
  2016. ...collections: Array<
  2017. | $IterableOf<C>
  2018. | $Shape<RecordValues<C>>
  2019. | PlainObjInput<$KeyOf<C>, $ValOf<C>>
  2020. >
  2021. ): C;
  2022. export {
  2023. Collection,
  2024. Seq,
  2025. List,
  2026. Map,
  2027. OrderedMap,
  2028. OrderedSet,
  2029. Range,
  2030. Repeat,
  2031. Record,
  2032. Set,
  2033. Stack,
  2034. fromJS,
  2035. is,
  2036. hash,
  2037. isImmutable,
  2038. isCollection,
  2039. isKeyed,
  2040. isIndexed,
  2041. isAssociative,
  2042. isOrdered,
  2043. isRecord,
  2044. isValueObject,
  2045. get,
  2046. has,
  2047. remove,
  2048. set,
  2049. update,
  2050. getIn,
  2051. hasIn,
  2052. removeIn,
  2053. setIn,
  2054. updateIn,
  2055. merge,
  2056. mergeWith,
  2057. mergeDeep,
  2058. mergeDeepWith,
  2059. };
  2060. export default {
  2061. Collection,
  2062. Seq,
  2063. List,
  2064. Map,
  2065. OrderedMap,
  2066. OrderedSet,
  2067. Range,
  2068. Repeat,
  2069. Record,
  2070. Set,
  2071. Stack,
  2072. fromJS,
  2073. is,
  2074. hash,
  2075. isImmutable,
  2076. isCollection,
  2077. isKeyed,
  2078. isIndexed,
  2079. isAssociative,
  2080. isOrdered,
  2081. isRecord,
  2082. isValueObject,
  2083. get,
  2084. has,
  2085. remove,
  2086. set,
  2087. update,
  2088. getIn,
  2089. hasIn,
  2090. removeIn,
  2091. setIn,
  2092. updateIn,
  2093. merge,
  2094. mergeWith,
  2095. mergeDeep,
  2096. mergeDeepWith,
  2097. };
  2098. export type {
  2099. KeyedCollection,
  2100. IndexedCollection,
  2101. SetCollection,
  2102. KeyedSeq,
  2103. IndexedSeq,
  2104. SetSeq,
  2105. RecordFactory,
  2106. RecordOf,
  2107. RecordInstance,
  2108. ValueObject,
  2109. $KeyOf,
  2110. $ValOf,
  2111. };