UNPKG

145 kBTypeScriptView Raw
1// Type definitions for ramda 0.26
2// Project: https://github.com/donnut/typescript-ramda, https://ramdajs.com
3// Definitions by: Erwin Poeze <https://github.com/donnut>
4// Tycho Grouwstra <https://github.com/tycho01>
5// Matt DeKrey <https://github.com/mdekrey>
6// Matt Dziuban <https://github.com/mrdziuban>
7// Stephen King <https://github.com/sbking>
8// Alejandro Fernandez Haro <https://github.com/afharo>
9// Vítor Castro <https://github.com/teves-castro>
10// Jordan Quagliatini <https://github.com/1M0reBug>
11// Simon Højberg <https://github.com/hojberg>
12// Samson Keung <https://github.com/samsonkeung>
13// Angelo Ocana <https://github.com/angeloocana>
14// Rayner Pupo <https://github.com/raynerd>
15// Miika Hänninen <https://github.com/googol>
16// Nikita Moshensky <https://github.com/moshensky>
17// Ethan Resnick <https://github.com/ethanresnick>
18// Jack Leigh <https://github.com/leighman>
19// Tomas Szabo <https://github.com/deftomat>
20// Bonggyun Lee <https://github.com/deptno>
21// Maciek Blim <https://github.com/blimusiek>
22// Marcin Biernat <https://github.com/biern>
23// Rayhaneh Banyassady <https://github.com/rayhaneh>
24// Ryan McCuaig <https://github.com/rgm>
25// Drew Wyatt <https://github.com/drewwyatt>
26// John Ottenlips <https://github.com/jottenlips>
27// Nitesh Phadatare <https://github.com/minitesh>
28// Krantisinh Deshmukh <https://github.com/krantisinh>
29// Pierre-Antoine Mills <https://github.com/pirix-gh>
30// Brekk Bockrath <https://github.com/brekk>
31// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
32// TypeScript Version: 3.3
33
34/// <reference path="./es/add.d.ts" />
35/// <reference path="./es/addIndex.d.ts" />
36/// <reference path="./es/adjust.d.ts" />
37/// <reference path="./es/all.d.ts" />
38/// <reference path="./es/allPass.d.ts" />
39/// <reference path="./es/always.d.ts" />
40/// <reference path="./es/and.d.ts" />
41/// <reference path="./es/any.d.ts" />
42/// <reference path="./es/anyPass.d.ts" />
43/// <reference path="./es/ap.d.ts" />
44/// <reference path="./es/aperture.d.ts" />
45/// <reference path="./es/append.d.ts" />
46/// <reference path="./es/apply.d.ts" />
47/// <reference path="./es/applySpec.d.ts" />
48/// <reference path="./es/applyTo.d.ts" />
49/// <reference path="./es/ascend.d.ts" />
50/// <reference path="./es/assoc.d.ts" />
51/// <reference path="./es/assocPath.d.ts" />
52/// <reference path="./es/binary.d.ts" />
53/// <reference path="./es/bind.d.ts" />
54/// <reference path="./es/both.d.ts" />
55/// <reference path="./es/call.d.ts" />
56/// <reference path="./es/chain.d.ts" />
57/// <reference path="./es/clamp.d.ts" />
58/// <reference path="./es/clone.d.ts" />
59/// <reference path="./es/comparator.d.ts" />
60/// <reference path="./es/complement.d.ts" />
61/// <reference path="./es/compose.d.ts" />
62/// <reference path="./es/composeK.d.ts" />
63/// <reference path="./es/composeP.d.ts" />
64/// <reference path="./es/composeWith.d.ts" />
65/// <reference path="./es/concat.d.ts" />
66/// <reference path="./es/cond.d.ts" />
67/// <reference path="./es/construct.d.ts" />
68/// <reference path="./es/constructN.d.ts" />
69/// <reference path="./es/contains.d.ts" />
70/// <reference path="./es/converge.d.ts" />
71/// <reference path="./es/countBy.d.ts" />
72/// <reference path="./es/curry.d.ts" />
73/// <reference path="./es/curryN.d.ts" />
74/// <reference path="./es/dec.d.ts" />
75/// <reference path="./es/defaultTo.d.ts" />
76/// <reference path="./es/descend.d.ts" />
77/// <reference path="./es/difference.d.ts" />
78/// <reference path="./es/differenceWith.d.ts" />
79/// <reference path="./es/dissoc.d.ts" />
80/// <reference path="./es/dissocPath.d.ts" />
81/// <reference path="./es/divide.d.ts" />
82/// <reference path="./es/drop.d.ts" />
83/// <reference path="./es/dropLast.d.ts" />
84/// <reference path="./es/dropLastWhile.d.ts" />
85/// <reference path="./es/dropRepeats.d.ts" />
86/// <reference path="./es/dropRepeatsWith.d.ts" />
87/// <reference path="./es/either.d.ts" />
88/// <reference path="./es/empty.d.ts" />
89/// <reference path="./es/endsWith.d.ts" />
90/// <reference path="./es/eqBy.d.ts" />
91/// <reference path="./es/eqProps.d.ts" />
92/// <reference path="./es/equals.d.ts" />
93/// <reference path="./es/evolve.d.ts" />
94/// <reference path="./es/F.d.ts" />
95/// <reference path="./es/filter.d.ts" />
96/// <reference path="./es/find.d.ts" />
97/// <reference path="./es/findIndex.d.ts" />
98/// <reference path="./es/findLast.d.ts" />
99/// <reference path="./es/findLastIndex.d.ts" />
100/// <reference path="./es/flatten.d.ts" />
101/// <reference path="./es/flip.d.ts" />
102/// <reference path="./es/forEach.d.ts" />
103/// <reference path="./es/forEachObjIndexed.d.ts" />
104/// <reference path="./es/fromPairs.d.ts" />
105/// <reference path="./es/groupBy.d.ts" />
106/// <reference path="./es/groupWith.d.ts" />
107/// <reference path="./es/gt.d.ts" />
108/// <reference path="./es/gte.d.ts" />
109/// <reference path="./es/has.d.ts" />
110/// <reference path="./es/hasIn.d.ts" />
111/// <reference path="./es/hasPath.d.ts" />
112/// <reference path="./es/head.d.ts" />
113/// <reference path="./es/identical.d.ts" />
114/// <reference path="./es/identity.d.ts" />
115/// <reference path="./es/ifElse.d.ts" />
116/// <reference path="./es/inc.d.ts" />
117/// <reference path="./es/indexBy.d.ts" />
118/// <reference path="./es/indexOf.d.ts" />
119/// <reference path="./es/init.d.ts" />
120/// <reference path="./es/innerJoin.d.ts" />
121/// <reference path="./es/insertAll.d.ts" />
122/// <reference path="./es/insert.d.ts" />
123/// <reference path="./es/intersection.d.ts" />
124/// <reference path="./es/intersectionWith.d.ts" />
125/// <reference path="./es/intersperse.d.ts" />
126/// <reference path="./es/into.d.ts" />
127/// <reference path="./es/invert.d.ts" />
128/// <reference path="./es/invertObj.d.ts" />
129/// <reference path="./es/invoker.d.ts" />
130/// <reference path="./es/isArrayLike.d.ts" />
131/// <reference path="./es/is.d.ts" />
132/// <reference path="./es/isEmpty.d.ts" />
133/// <reference path="./es/isNaN.d.ts" />
134/// <reference path="./es/isNil.d.ts" />
135/// <reference path="./es/join.d.ts" />
136/// <reference path="./es/juxt.d.ts" />
137/// <reference path="./es/keys.d.ts" />
138/// <reference path="./es/keysIn.d.ts" />
139/// <reference path="./es/last.d.ts" />
140/// <reference path="./es/lastIndexOf.d.ts" />
141/// <reference path="./es/length.d.ts" />
142/// <reference path="./es/lens.d.ts" />
143/// <reference path="./es/lensIndex.d.ts" />
144/// <reference path="./es/lensPath.d.ts" />
145/// <reference path="./es/lensProp.d.ts" />
146/// <reference path="./es/lift.d.ts" />
147/// <reference path="./es/lt.d.ts" />
148/// <reference path="./es/lte.d.ts" />
149/// <reference path="./es/mapAccum.d.ts" />
150/// <reference path="./es/mapAccumRight.d.ts" />
151/// <reference path="./es/map.d.ts" />
152/// <reference path="./es/mapObjIndexed.d.ts" />
153/// <reference path="./es/match.d.ts" />
154/// <reference path="./es/mathMod.d.ts" />
155/// <reference path="./es/maxBy.d.ts" />
156/// <reference path="./es/max.d.ts" />
157/// <reference path="./es/mean.d.ts" />
158/// <reference path="./es/median.d.ts" />
159/// <reference path="./es/memoizeWith.d.ts" />
160/// <reference path="./es/mergeAll.d.ts" />
161/// <reference path="./es/mergeDeepLeft.d.ts" />
162/// <reference path="./es/mergeDeepRight.d.ts" />
163/// <reference path="./es/mergeDeepWith.d.ts" />
164/// <reference path="./es/mergeDeepWithKey.d.ts" />
165/// <reference path="./es/mergeLeft.d.ts" />
166/// <reference path="./es/mergeRight.d.ts" />
167/// <reference path="./es/merge.d.ts" />
168/// <reference path="./es/mergeWith.d.ts" />
169/// <reference path="./es/mergeWithKey.d.ts" />
170/// <reference path="./es/minBy.d.ts" />
171/// <reference path="./es/min.d.ts" />
172/// <reference path="./es/modulo.d.ts" />
173/// <reference path="./es/move.d.ts" />
174/// <reference path="./es/multiply.d.ts" />
175/// <reference path="./es/nAry.d.ts" />
176/// <reference path="./es/negate.d.ts" />
177/// <reference path="./es/none.d.ts" />
178/// <reference path="./es/not.d.ts" />
179/// <reference path="./es/nthArg.d.ts" />
180/// <reference path="./es/nth.d.ts" />
181/// <reference path="./es/objOf.d.ts" />
182/// <reference path="./es/of.d.ts" />
183/// <reference path="./es/omit.d.ts" />
184/// <reference path="./es/once.d.ts" />
185/// <reference path="./es/or.d.ts" />
186/// <reference path="./es/over.d.ts" />
187/// <reference path="./es/otherwise.d.ts" />
188/// <reference path="./es/pair.d.ts" />
189/// <reference path="./es/partial.d.ts" />
190/// <reference path="./es/partialRight.d.ts" />
191/// <reference path="./es/partition.d.ts" />
192/// <reference path="./es/path.d.ts" />
193/// <reference path="./es/pathEq.d.ts" />
194/// <reference path="./es/pathOr.d.ts" />
195/// <reference path="./es/pathSatisfies.d.ts" />
196/// <reference path="./es/pickAll.d.ts" />
197/// <reference path="./es/pickBy.d.ts" />
198/// <reference path="./es/pick.d.ts" />
199/// <reference path="./es/pipe.d.ts" />
200/// <reference path="./es/pipeK.d.ts" />
201/// <reference path="./es/pipeP.d.ts" />
202/// <reference path="./es/pipeWith.d.ts" />
203/// <reference path="./es/pluck.d.ts" />
204/// <reference path="./es/prepend.d.ts" />
205/// <reference path="./es/product.d.ts" />
206/// <reference path="./es/project.d.ts" />
207/// <reference path="./es/prop.d.ts" />
208/// <reference path="./es/propEq.d.ts" />
209/// <reference path="./es/propIs.d.ts" />
210/// <reference path="./es/propOr.d.ts" />
211/// <reference path="./es/propSatisfies.d.ts" />
212/// <reference path="./es/props.d.ts" />
213/// <reference path="./es/range.d.ts" />
214/// <reference path="./es/reduceBy.d.ts" />
215/// <reference path="./es/reduced.d.ts" />
216/// <reference path="./es/reduce.d.ts" />
217/// <reference path="./es/reduceRight.d.ts" />
218/// <reference path="./es/reduceWhile.d.ts" />
219/// <reference path="./es/reject.d.ts" />
220/// <reference path="./es/remove.d.ts" />
221/// <reference path="./es/repeat.d.ts" />
222/// <reference path="./es/replace.d.ts" />
223/// <reference path="./es/reverse.d.ts" />
224/// <reference path="./es/scan.d.ts" />
225/// <reference path="./es/set.d.ts" />
226/// <reference path="./es/slice.d.ts" />
227/// <reference path="./es/sortBy.d.ts" />
228/// <reference path="./es/sort.d.ts" />
229/// <reference path="./es/sortWith.d.ts" />
230/// <reference path="./es/splitAt.d.ts" />
231/// <reference path="./es/split.d.ts" />
232/// <reference path="./es/splitEvery.d.ts" />
233/// <reference path="./es/splitWhen.d.ts" />
234/// <reference path="./es/startsWith.d.ts" />
235/// <reference path="./es/subtract.d.ts" />
236/// <reference path="./es/sum.d.ts" />
237/// <reference path="./es/symmetricDifference.d.ts" />
238/// <reference path="./es/symmetricDifferenceWith.d.ts" />
239/// <reference path="./es/tail.d.ts" />
240/// <reference path="./es/take.d.ts" />
241/// <reference path="./es/takeLast.d.ts" />
242/// <reference path="./es/takeLastWhile.d.ts" />
243/// <reference path="./es/takeWhile.d.ts" />
244/// <reference path="./es/tap.d.ts" />
245/// <reference path="./es/T.d.ts" />
246/// <reference path="./es/test.d.ts" />
247/// <reference path="./es/then.d.ts" />
248/// <reference path="./es/thunkify.d.ts" />
249/// <reference path="./es/times.d.ts" />
250/// <reference path="./es/toLower.d.ts" />
251/// <reference path="./es/toPairs.d.ts" />
252/// <reference path="./es/toPairsIn.d.ts" />
253/// <reference path="./es/toString.d.ts" />
254/// <reference path="./es/toUpper.d.ts" />
255/// <reference path="./es/transduce.d.ts" />
256/// <reference path="./es/transpose.d.ts" />
257/// <reference path="./es/traverse.d.ts" />
258/// <reference path="./es/trim.d.ts" />
259/// <reference path="./es/tryCatch.d.ts" />
260/// <reference path="./es/type.d.ts" />
261/// <reference path="./es/unapply.d.ts" />
262/// <reference path="./es/unary.d.ts" />
263/// <reference path="./es/uncurryN.d.ts" />
264/// <reference path="./es/unfold.d.ts" />
265/// <reference path="./es/union.d.ts" />
266/// <reference path="./es/unionWith.d.ts" />
267/// <reference path="./es/uniqBy.d.ts" />
268/// <reference path="./es/uniq.d.ts" />
269/// <reference path="./es/uniqWith.d.ts" />
270/// <reference path="./es/unless.d.ts" />
271/// <reference path="./es/unnest.d.ts" />
272/// <reference path="./es/until.d.ts" />
273/// <reference path="./es/update.d.ts" />
274/// <reference path="./es/useWith.d.ts" />
275/// <reference path="./es/values.d.ts" />
276/// <reference path="./es/valuesIn.d.ts" />
277/// <reference path="./es/view.d.ts" />
278/// <reference path="./es/when.d.ts" />
279/// <reference path="./es/where.d.ts" />
280/// <reference path="./es/whereEq.d.ts" />
281/// <reference path="./es/without.d.ts" />
282/// <reference path="./es/wrap.d.ts" />
283/// <reference path="./es/xprod.d.ts" />
284/// <reference path="./es/zip.d.ts" />
285/// <reference path="./es/zipObj.d.ts" />
286/// <reference path="./es/zipWith.d.ts" />
287/// <reference path="./es/includes.d.ts" />
288/// <reference path="./tools.d.ts" />
289
290/// <reference path="./src/add.d.ts" />
291/// <reference path="./src/addIndex.d.ts" />
292/// <reference path="./src/adjust.d.ts" />
293/// <reference path="./src/all.d.ts" />
294/// <reference path="./src/allPass.d.ts" />
295/// <reference path="./src/always.d.ts" />
296/// <reference path="./src/and.d.ts" />
297/// <reference path="./src/any.d.ts" />
298/// <reference path="./src/anyPass.d.ts" />
299/// <reference path="./src/ap.d.ts" />
300/// <reference path="./src/aperture.d.ts" />
301/// <reference path="./src/append.d.ts" />
302/// <reference path="./src/apply.d.ts" />
303/// <reference path="./src/applySpec.d.ts" />
304/// <reference path="./src/applyTo.d.ts" />
305/// <reference path="./src/ascend.d.ts" />
306/// <reference path="./src/assoc.d.ts" />
307/// <reference path="./src/assocPath.d.ts" />
308/// <reference path="./src/binary.d.ts" />
309/// <reference path="./src/bind.d.ts" />
310/// <reference path="./src/both.d.ts" />
311/// <reference path="./src/call.d.ts" />
312/// <reference path="./src/chain.d.ts" />
313/// <reference path="./src/clamp.d.ts" />
314/// <reference path="./src/clone.d.ts" />
315/// <reference path="./src/comparator.d.ts" />
316/// <reference path="./src/complement.d.ts" />
317/// <reference path="./src/compose.d.ts" />
318/// <reference path="./src/composeK.d.ts" />
319/// <reference path="./src/composeP.d.ts" />
320/// <reference path="./src/composeWith.d.ts" />
321/// <reference path="./src/concat.d.ts" />
322/// <reference path="./src/cond.d.ts" />
323/// <reference path="./src/construct.d.ts" />
324/// <reference path="./src/constructN.d.ts" />
325/// <reference path="./src/contains.d.ts" />
326/// <reference path="./src/converge.d.ts" />
327/// <reference path="./src/countBy.d.ts" />
328/// <reference path="./src/curry.d.ts" />
329/// <reference path="./src/curryN.d.ts" />
330/// <reference path="./src/dec.d.ts" />
331/// <reference path="./src/defaultTo.d.ts" />
332/// <reference path="./src/descend.d.ts" />
333/// <reference path="./src/difference.d.ts" />
334/// <reference path="./src/differenceWith.d.ts" />
335/// <reference path="./src/dissoc.d.ts" />
336/// <reference path="./src/dissocPath.d.ts" />
337/// <reference path="./src/divide.d.ts" />
338/// <reference path="./src/drop.d.ts" />
339/// <reference path="./src/dropLast.d.ts" />
340/// <reference path="./src/dropLastWhile.d.ts" />
341/// <reference path="./src/dropRepeats.d.ts" />
342/// <reference path="./src/dropRepeatsWith.d.ts" />
343/// <reference path="./src/either.d.ts" />
344/// <reference path="./src/empty.d.ts" />
345/// <reference path="./src/endsWith.d.ts" />
346/// <reference path="./src/eqBy.d.ts" />
347/// <reference path="./src/eqProps.d.ts" />
348/// <reference path="./src/equals.d.ts" />
349/// <reference path="./src/evolve.d.ts" />
350/// <reference path="./src/F.d.ts" />
351/// <reference path="./src/filter.d.ts" />
352/// <reference path="./src/find.d.ts" />
353/// <reference path="./src/findIndex.d.ts" />
354/// <reference path="./src/findLast.d.ts" />
355/// <reference path="./src/findLastIndex.d.ts" />
356/// <reference path="./src/flatten.d.ts" />
357/// <reference path="./src/flip.d.ts" />
358/// <reference path="./src/forEach.d.ts" />
359/// <reference path="./src/forEachObjIndexed.d.ts" />
360/// <reference path="./src/fromPairs.d.ts" />
361/// <reference path="./src/groupBy.d.ts" />
362/// <reference path="./src/groupWith.d.ts" />
363/// <reference path="./src/gt.d.ts" />
364/// <reference path="./src/gte.d.ts" />
365/// <reference path="./src/has.d.ts" />
366/// <reference path="./src/hasIn.d.ts" />
367/// <reference path="./src/hasPath.d.ts" />
368/// <reference path="./src/head.d.ts" />
369/// <reference path="./src/identical.d.ts" />
370/// <reference path="./src/identity.d.ts" />
371/// <reference path="./src/ifElse.d.ts" />
372/// <reference path="./src/inc.d.ts" />
373/// <reference path="./src/indexBy.d.ts" />
374/// <reference path="./src/indexOf.d.ts" />
375/// <reference path="./src/init.d.ts" />
376/// <reference path="./src/innerJoin.d.ts" />
377/// <reference path="./src/insertAll.d.ts" />
378/// <reference path="./src/insert.d.ts" />
379/// <reference path="./src/intersection.d.ts" />
380/// <reference path="./src/intersectionWith.d.ts" />
381/// <reference path="./src/intersperse.d.ts" />
382/// <reference path="./src/into.d.ts" />
383/// <reference path="./src/invert.d.ts" />
384/// <reference path="./src/invertObj.d.ts" />
385/// <reference path="./src/invoker.d.ts" />
386/// <reference path="./src/isArrayLike.d.ts" />
387/// <reference path="./src/is.d.ts" />
388/// <reference path="./src/isEmpty.d.ts" />
389/// <reference path="./src/isNaN.d.ts" />
390/// <reference path="./src/isNil.d.ts" />
391/// <reference path="./src/join.d.ts" />
392/// <reference path="./src/juxt.d.ts" />
393/// <reference path="./src/keys.d.ts" />
394/// <reference path="./src/keysIn.d.ts" />
395/// <reference path="./src/last.d.ts" />
396/// <reference path="./src/lastIndexOf.d.ts" />
397/// <reference path="./src/length.d.ts" />
398/// <reference path="./src/lens.d.ts" />
399/// <reference path="./src/lensIndex.d.ts" />
400/// <reference path="./src/lensPath.d.ts" />
401/// <reference path="./src/lensProp.d.ts" />
402/// <reference path="./src/lift.d.ts" />
403/// <reference path="./src/lt.d.ts" />
404/// <reference path="./src/lte.d.ts" />
405/// <reference path="./src/mapAccum.d.ts" />
406/// <reference path="./src/mapAccumRight.d.ts" />
407/// <reference path="./src/map.d.ts" />
408/// <reference path="./src/mapObjIndexed.d.ts" />
409/// <reference path="./src/match.d.ts" />
410/// <reference path="./src/mathMod.d.ts" />
411/// <reference path="./src/maxBy.d.ts" />
412/// <reference path="./src/max.d.ts" />
413/// <reference path="./src/mean.d.ts" />
414/// <reference path="./src/median.d.ts" />
415/// <reference path="./src/memoizeWith.d.ts" />
416/// <reference path="./src/mergeAll.d.ts" />
417/// <reference path="./src/mergeDeepLeft.d.ts" />
418/// <reference path="./src/mergeDeepRight.d.ts" />
419/// <reference path="./src/mergeDeepWith.d.ts" />
420/// <reference path="./src/mergeDeepWithKey.d.ts" />
421/// <reference path="./src/mergeLeft.d.ts" />
422/// <reference path="./src/mergeRight.d.ts" />
423/// <reference path="./src/merge.d.ts" />
424/// <reference path="./src/mergeWith.d.ts" />
425/// <reference path="./src/mergeWithKey.d.ts" />
426/// <reference path="./src/minBy.d.ts" />
427/// <reference path="./src/min.d.ts" />
428/// <reference path="./src/modulo.d.ts" />
429/// <reference path="./src/move.d.ts" />
430/// <reference path="./src/multiply.d.ts" />
431/// <reference path="./src/nAry.d.ts" />
432/// <reference path="./src/negate.d.ts" />
433/// <reference path="./src/none.d.ts" />
434/// <reference path="./src/not.d.ts" />
435/// <reference path="./src/nthArg.d.ts" />
436/// <reference path="./src/nth.d.ts" />
437/// <reference path="./src/objOf.d.ts" />
438/// <reference path="./src/of.d.ts" />
439/// <reference path="./src/omit.d.ts" />
440/// <reference path="./src/once.d.ts" />
441/// <reference path="./src/or.d.ts" />
442/// <reference path="./src/over.d.ts" />
443/// <reference path="./src/otherwise.d.ts" />
444/// <reference path="./src/pair.d.ts" />
445/// <reference path="./src/partial.d.ts" />
446/// <reference path="./src/partialRight.d.ts" />
447/// <reference path="./src/partition.d.ts" />
448/// <reference path="./src/path.d.ts" />
449/// <reference path="./src/pathEq.d.ts" />
450/// <reference path="./src/pathOr.d.ts" />
451/// <reference path="./src/pathSatisfies.d.ts" />
452/// <reference path="./src/pickAll.d.ts" />
453/// <reference path="./src/pickBy.d.ts" />
454/// <reference path="./src/pick.d.ts" />
455/// <reference path="./src/pipe.d.ts" />
456/// <reference path="./src/pipeK.d.ts" />
457/// <reference path="./src/pipeP.d.ts" />
458/// <reference path="./src/pipeWith.d.ts" />
459/// <reference path="./src/pluck.d.ts" />
460/// <reference path="./src/prepend.d.ts" />
461/// <reference path="./src/product.d.ts" />
462/// <reference path="./src/project.d.ts" />
463/// <reference path="./src/prop.d.ts" />
464/// <reference path="./src/propEq.d.ts" />
465/// <reference path="./src/propIs.d.ts" />
466/// <reference path="./src/propOr.d.ts" />
467/// <reference path="./src/propSatisfies.d.ts" />
468/// <reference path="./src/props.d.ts" />
469/// <reference path="./src/range.d.ts" />
470/// <reference path="./src/reduceBy.d.ts" />
471/// <reference path="./src/reduced.d.ts" />
472/// <reference path="./src/reduce.d.ts" />
473/// <reference path="./src/reduceRight.d.ts" />
474/// <reference path="./src/reduceWhile.d.ts" />
475/// <reference path="./src/reject.d.ts" />
476/// <reference path="./src/remove.d.ts" />
477/// <reference path="./src/repeat.d.ts" />
478/// <reference path="./src/replace.d.ts" />
479/// <reference path="./src/reverse.d.ts" />
480/// <reference path="./src/scan.d.ts" />
481/// <reference path="./src/set.d.ts" />
482/// <reference path="./src/slice.d.ts" />
483/// <reference path="./src/sortBy.d.ts" />
484/// <reference path="./src/sort.d.ts" />
485/// <reference path="./src/sortWith.d.ts" />
486/// <reference path="./src/splitAt.d.ts" />
487/// <reference path="./src/split.d.ts" />
488/// <reference path="./src/splitEvery.d.ts" />
489/// <reference path="./src/splitWhen.d.ts" />
490/// <reference path="./src/startsWith.d.ts" />
491/// <reference path="./src/subtract.d.ts" />
492/// <reference path="./src/sum.d.ts" />
493/// <reference path="./src/symmetricDifference.d.ts" />
494/// <reference path="./src/symmetricDifferenceWith.d.ts" />
495/// <reference path="./src/tail.d.ts" />
496/// <reference path="./src/take.d.ts" />
497/// <reference path="./src/takeLast.d.ts" />
498/// <reference path="./src/takeLastWhile.d.ts" />
499/// <reference path="./src/takeWhile.d.ts" />
500/// <reference path="./src/tap.d.ts" />
501/// <reference path="./src/T.d.ts" />
502/// <reference path="./src/test.d.ts" />
503/// <reference path="./src/then.d.ts" />
504/// <reference path="./src/thunkify.d.ts" />
505/// <reference path="./src/times.d.ts" />
506/// <reference path="./src/toLower.d.ts" />
507/// <reference path="./src/toPairs.d.ts" />
508/// <reference path="./src/toPairsIn.d.ts" />
509/// <reference path="./src/toString.d.ts" />
510/// <reference path="./src/toUpper.d.ts" />
511/// <reference path="./src/transduce.d.ts" />
512/// <reference path="./src/transpose.d.ts" />
513/// <reference path="./src/traverse.d.ts" />
514/// <reference path="./src/trim.d.ts" />
515/// <reference path="./src/tryCatch.d.ts" />
516/// <reference path="./src/type.d.ts" />
517/// <reference path="./src/unapply.d.ts" />
518/// <reference path="./src/unary.d.ts" />
519/// <reference path="./src/uncurryN.d.ts" />
520/// <reference path="./src/unfold.d.ts" />
521/// <reference path="./src/union.d.ts" />
522/// <reference path="./src/unionWith.d.ts" />
523/// <reference path="./src/uniqBy.d.ts" />
524/// <reference path="./src/uniq.d.ts" />
525/// <reference path="./src/uniqWith.d.ts" />
526/// <reference path="./src/unless.d.ts" />
527/// <reference path="./src/unnest.d.ts" />
528/// <reference path="./src/until.d.ts" />
529/// <reference path="./src/update.d.ts" />
530/// <reference path="./src/useWith.d.ts" />
531/// <reference path="./src/values.d.ts" />
532/// <reference path="./src/valuesIn.d.ts" />
533/// <reference path="./src/view.d.ts" />
534/// <reference path="./src/when.d.ts" />
535/// <reference path="./src/where.d.ts" />
536/// <reference path="./src/whereEq.d.ts" />
537/// <reference path="./src/without.d.ts" />
538/// <reference path="./src/wrap.d.ts" />
539/// <reference path="./src/xprod.d.ts" />
540/// <reference path="./src/zip.d.ts" />
541/// <reference path="./src/zipObj.d.ts" />
542/// <reference path="./src/zipWith.d.ts" />
543/// <reference path="./src/includes.d.ts" />
544
545declare let R: R.Static;
546
547declare namespace R {
548 type Omit<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
549
550 type CommonKeys<T1, T2> = keyof T1 & keyof T2;
551 type PropsThatAreObjects<T, K extends keyof T> = K extends keyof T ? T[K] extends object ? K : never : never;
552 type CommonPropsThatAreObjects<T1, T2> = PropsThatAreObjects<T1, keyof T1> & PropsThatAreObjects<T2, keyof T2>;
553
554 type Ord = number | string | boolean | Date;
555
556 type Path = ReadonlyArray<(number | string)>;
557
558 interface Functor<T> {
559 map<U>(fn: (t: T) => U): Functor<U>;
560 }
561
562 interface KeyValuePair<K, V> extends Array<K | V> {
563 0: K;
564 1: V;
565 }
566
567 interface ArrayLike {
568 nodeType: number;
569 }
570
571 type Arity0Fn = () => any;
572
573 type Arity1Fn = (a: any) => any;
574
575 type Arity2Fn = (a: any, b: any) => any;
576
577 interface ObjFunc {
578 [index: string]: (...a: any[]) => any;
579 }
580
581 interface ObjFunc2 {
582 [index: string]: (x: any, y: any) => boolean;
583 }
584
585 type Pred = (...a: any[]) => boolean;
586 type SafePred<T> = (...a: T[]) => boolean;
587
588 type ObjPred = (value: any, key: string) => boolean;
589
590 interface Dictionary<T> {
591 [index: string]: T;
592 }
593
594 interface CharList extends String {
595 push(x: string): void;
596 }
597
598 interface Lens {
599 <T, U>(obj: T): U;
600 set<T, U>(str: string, obj: T): U;
601 }
602
603 interface Filter {
604 <T>(fn: (value: T) => boolean): FilterOnceApplied<T>;
605 <T, Kind extends 'array'>(fn: (value: T) => boolean): (list: ReadonlyArray<T>) => T[];
606 <T, Kind extends 'object'>(fn: (value: T) => boolean): (list: Dictionary<T>) => Dictionary<T>;
607 <T>(fn: (value: T) => boolean, list: ReadonlyArray<T>): T[];
608 <T>(fn: (value: T) => boolean, obj: Dictionary<T>): Dictionary<T>;
609 }
610
611 interface FilterOnceApplied<T> {
612 (list: ReadonlyArray<T>): T[];
613 (obj: Dictionary<T>): Dictionary<T>;
614 }
615
616 type Evolve<O extends Evolvable<E>, E extends Evolver> = {
617 [P in keyof O]: P extends keyof E ? EvolveValue<O[P], E[P]> : O[P];
618 };
619
620 type EvolveValue<V, E> =
621 E extends (value: V) => any ? ReturnType<E> :
622 E extends Evolver ? EvolveNestedValue<V, E> :
623 never;
624
625 type EvolveNestedValue<V, E extends Evolver> =
626 V extends object ? (V extends Evolvable<E> ? Evolve<V, E> : never) : never;
627
628 interface Evolver {
629 [key: string]: ((value: any) => any) | Evolver;
630 }
631
632 // Represents all objects evolvable with Evolver E
633 type Evolvable<E extends Evolver> = {
634 [P in keyof E]?: Evolved<E[P]>;
635 };
636
637 type Evolved<T> =
638 T extends (value: infer V) => any ? V :
639 T extends Evolver ? Evolvable<T> :
640 never;
641
642 interface Placeholder { __isRamdaPlaceholder__: true; }
643
644 interface Reduced<T> {
645 '@@transducer/value': T;
646 '@@transducer/reduced': true;
647 }
648
649 type PipeWithFns<V0, T> = [
650 (x0: V0) => T
651 ] | [
652 (x0: V0) => any,
653 (x: any) => T
654 ] | [
655 (x0: V0) => any,
656 (x: any) => any,
657 (x: any) => T
658 ] | [
659 (x0: V0) => any,
660 (x: any) => any,
661 (x: any) => any,
662 (x: any) => T
663 ] | [
664 (x0: V0) => any,
665 (x: any) => any,
666 (x: any) => any,
667 (x: any) => any,
668 (x: any) => T
669 ] | [
670 (x0: V0) => any,
671 (x: any) => any,
672 (x: any) => any,
673 (x: any) => any,
674 (x: any) => any,
675 (x: any) => T
676 ] | [
677 (x0: V0) => any,
678 (x: any) => any,
679 (x: any) => any,
680 (x: any) => any,
681 (x: any) => any,
682 (x: any) => any,
683 (x: any) => T
684 ] | [
685 (x0: V0) => any,
686 (x: any) => any,
687 (x: any) => any,
688 (x: any) => any,
689 (x: any) => any,
690 (x: any) => any,
691 (x: any) => any,
692 (x: any) => T
693 ] | [
694 (x0: V0) => any,
695 (x: any) => any,
696 (x: any) => any,
697 (x: any) => any,
698 (x: any) => any,
699 (x: any) => any,
700 (x: any) => any,
701 (x: any) => any,
702 (x: any) => T
703 ] | [
704 (x0: V0) => any,
705 (x: any) => any,
706 (x: any) => any,
707 (x: any) => any,
708 (x: any) => any,
709 (x: any) => any,
710 (x: any) => any,
711 (x: any) => any,
712 (x: any) => any,
713 (x: any) => T
714 ];
715
716 type ComposeWithFns<V0, T> = [
717 (x0: V0) => T
718 ] | [
719 (x: any) => T,
720 (x: V0) => any
721 ] | [
722 (x: any) => T,
723 (x: any) => any,
724 (x: V0) => any
725 ] | [
726 (x: any) => T,
727 (x: any) => any,
728 (x: any) => any,
729 (x: V0) => any
730 ] | [
731 (x: any) => T,
732 (x: any) => any,
733 (x: any) => any,
734 (x: any) => any,
735 (x: V0) => any
736 ] | [
737 (x: any) => T,
738 (x: any) => any,
739 (x: any) => any,
740 (x: any) => any,
741 (x: any) => any,
742 (x: V0) => any
743 ] | [
744 (x: any) => T,
745 (x: any) => any,
746 (x: any) => any,
747 (x: any) => any,
748 (x: any) => any,
749 (x: any) => any,
750 (x: V0) => any
751 ] | [
752 (x: any) => T,
753 (x: any) => any,
754 (x: any) => any,
755 (x: any) => any,
756 (x: any) => any,
757 (x: any) => any,
758 (x: any) => any,
759 (x: V0) => any
760 ] | [
761 (x: any) => T,
762 (x: any) => any,
763 (x: any) => any,
764 (x: any) => any,
765 (x: any) => any,
766 (x: any) => any,
767 (x: any) => any,
768 (x: any) => any,
769 (x: V0) => any
770 ] | [
771 (x: any) => T,
772 (x: any) => any,
773 (x: any) => any,
774 (x: any) => any,
775 (x: any) => any,
776 (x: any) => any,
777 (x: any) => any,
778 (x: any) => any,
779 (x: any) => any,
780 (x: V0) => any
781 ];
782
783 type Merge<Primary, Secondary> = { [K in keyof Primary]: Primary[K] } & { [K in Exclude<keyof Secondary, CommonKeys<Primary, Secondary>>]: Secondary[K] };
784 type MergeDeep<Primary, Secondary> = { [K in CommonPropsThatAreObjects<Primary, Secondary>]: MergeDeep<Primary[K], Secondary[K]> } &
785 { [K in Exclude<keyof Primary, CommonPropsThatAreObjects<Primary, Secondary>>]: Primary[K] } &
786 { [K in Exclude<keyof Secondary, CommonKeys<Primary, Secondary>>]: Secondary[K] };
787
788 interface Static {
789 /**
790 * Placeholder. When used with functions like curry, or op, the second argument is applied to the second
791 * position, and it returns a function waiting for its first argument.
792 */
793 __: Placeholder; /* This is used in examples throughout the docs, but I it only seems to be directly explained here: https://ramdajs.com/0.9/docs/#op */
794
795 /**
796 * Adds two numbers (or strings). Equivalent to a + b but curried.
797 */
798 add(a: number, b: number): number;
799 add(a: string, b: string): string;
800 add(a: number): (b: number) => number;
801 add(a: string): (b: string) => string;
802
803 /**
804 * Creates a new list iteration function from an existing one by adding two new parameters to its callback
805 * function: the current index, and the entire list.
806 */
807 addIndex<T, U>(fn: (f: (item: T) => U, list: T[]) => U[]): Curry.Curry<(a: (item: T, idx: number, list?: T[]) => U, b: ReadonlyArray<T>) => U[]>;
808 /* Special case for forEach */
809 addIndex<T>(fn: (f: (item: T) => void, list: T[]) => T[]): Curry.Curry<(a: (item: T, idx: number, list?: T[]) => void, b: ReadonlyArray<T>) => T[]>;
810 /* Special case for reduce */
811 addIndex<T, U>(fn: (f: (acc: U, item: T) => U, aci: U, list: T[]) => U): Curry.Curry<(a: (acc: U, item: T, idx: number, list?: T[]) => U, b: U, c: ReadonlyArray<T>) => U>;
812
813 /**
814 * Applies a function to the value at the given index of an array, returning a new copy of the array with the
815 * element at the given index replaced with the result of the function application.
816 */
817 adjust<T>(index: number, fn: (a: T) => T, list: ReadonlyArray<T>): T[];
818 adjust<T>(index: number, fn: (a: T) => T): (list: ReadonlyArray<T>) => T[];
819
820 /**
821 * Returns true if all elements of the list match the predicate, false if there are any that don't.
822 */
823 all<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): boolean;
824 all<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => boolean;
825
826 /**
827 * Given a list of predicates, returns a new predicate that will be true exactly when all of them are.
828 */
829 allPass(preds: ReadonlyArray<Pred>): Pred;
830
831 /**
832 * Returns a function that always returns the given value.
833 */
834 always<T>(val: T): () => T;
835
836 /**
837 * A function that returns the first argument if it's falsy otherwise the second argument. Note that this is
838 * NOT short-circuited, meaning that if expressions are passed they are both evaluated.
839 */
840 and<T extends { and?: ((...a: any[]) => any); } | number | boolean | string | null>(fn1: T, val2: any): boolean;
841 and<T extends { and?: ((...a: any[]) => any); } | number | boolean | string | null>(fn1: T): (val2: any) => boolean;
842
843 /**
844 * Returns true if at least one of elements of the list match the predicate, false otherwise.
845 */
846 any<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): boolean;
847 any<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => boolean;
848
849 /**
850 * Given a list of predicates returns a new predicate that will be true exactly when any one of them is.
851 */
852 anyPass<T>(preds: ReadonlyArray<SafePred<T>>): SafePred<T>;
853
854 /**
855 * ap applies a list of functions to a list of values.
856 */
857 ap<T, U>(fns: Array<((a: T) => U)>, vs: ReadonlyArray<T>): U[];
858 ap<T, U>(fns: Array<((a: T) => U)>): (vs: ReadonlyArray<T>) => U[];
859
860 /**
861 * Returns a new list, composed of n-tuples of consecutive elements If n is greater than the length of the list,
862 * an empty list is returned.
863 */
864 aperture<T>(n: 1, list: T[]): Array<[T]>;
865 aperture<T>(n: 2, list: T[]): Array<[T, T]>;
866 aperture<T>(n: 3, list: T[]): Array<[T, T, T]>;
867 aperture<T>(n: 4, list: T[]): Array<[T, T, T, T]>;
868 aperture<T>(n: 5, list: T[]): Array<[T, T, T, T, T]>;
869 aperture<T>(n: 6, list: T[]): Array<[T, T, T, T, T, T]>;
870 aperture<T>(n: 7, list: T[]): Array<[T, T, T, T, T, T, T]>;
871 aperture<T>(n: 8, list: T[]): Array<[T, T, T, T, T, T, T, T]>;
872 aperture<T>(n: 9, list: T[]): Array<[T, T, T, T, T, T, T, T, T]>;
873 aperture<T>(n: 10, list: T[]): Array<[T, T, T, T, T, T, T, T, T, T]>;
874 aperture<T>(n: number, list: ReadonlyArray<T>): T[][];
875 aperture(n: number): <T>(list: ReadonlyArray<T>) => T[][];
876
877 /**
878 * Returns a new list containing the contents of the given list, followed by the given element.
879 */
880 append<T>(el: T, list: ReadonlyArray<T>): T[];
881 append<T>(el: T): <T>(list: ReadonlyArray<T>) => T[];
882
883 /**
884 * Applies function fn to the argument list args. This is useful for creating a fixed-arity function from
885 * a variadic function. fn should be a bound function if context is significant.
886 */
887 apply<T, U, TResult>(fn: (arg0: T, ...args: T[]) => TResult, args: ReadonlyArray<U>): TResult;
888 apply<T, TResult>(fn: (arg0: T, ...args: T[]) => TResult): <U>(args: ReadonlyArray<U>) => TResult;
889
890 /**
891 * Given a spec object recursively mapping properties to functions, creates a function producing an object
892 * of the same structure, by mapping each property to the result of calling its associated function with
893 * the supplied arguments.
894 */
895 applySpec<T>(obj: any): (...args: any[]) => T;
896
897 /**
898 * Takes a value and applies a function to it.
899 * This function is also known as the thrush combinator.
900 */
901 applyTo<T, U>(el: T, fn: (t: T) => U): U;
902 applyTo<T>(el: T): <U>(fn: (t: T) => U) => U;
903
904 /**
905 * Makes an ascending comparator function out of a function that returns a value that can be compared with < and >.
906 */
907 ascend<T>(fn: (obj: T) => any, a: T, b: T): number;
908 ascend<T>(fn: (obj: T) => any): (a: T, b: T) => number;
909
910 /**
911 * Makes a shallow clone of an object, setting or overriding the specified property with the given value.
912 */
913 assoc<T, U>(__: Placeholder, val: T, obj: U): <K extends string>(prop: K) => Record<K, T> & U;
914 assoc<U, K extends string>(prop: K, __: Placeholder, obj: U): <T>(val: T) => Record<K, T> & U;
915 assoc<T, U, K extends string>(prop: K, val: T, obj: U): Record<K, T> & U;
916 assoc<T, K extends string>(prop: K, val: T): <U>(obj: U) => Record<K, T> & U;
917 assoc<K extends string>(prop: K): <T, U>(val: T, obj: U) => Record<K, T> & U;
918
919 /**
920 * Makes a shallow clone of an object, setting or overriding the nodes required to create the given path, and
921 * placing the specific value at the tail end of that path.
922 */
923 assocPath<T, U>(__: Placeholder, val: T, obj: U): (path: Path) => U;
924 assocPath<T, U>(path: Path, __: Placeholder, obj: U): (val: T) => U;
925 assocPath<T, U>(path: Path, val: T, obj: U): U;
926 assocPath<T, U>(path: Path, val: T): (obj: U) => U;
927 assocPath<T, U>(path: Path): Curry.Curry<(a: T, b: U) => U>;
928
929 /**
930 * Wraps a function of any arity (including nullary) in a function that accepts exactly 2
931 * parameters. Any extraneous parameters will not be passed to the supplied function.
932 */
933 binary(fn: (...args: any[]) => any): (...a: any[]) => any;
934
935 /**
936 * Creates a function that is bound to a context. Note: R.bind does not provide the additional argument-binding
937 * capabilities of Function.prototype.bind.
938 */
939 bind<T>(fn: (...args: any[]) => any, thisObj: T): (...args: any[]) => any;
940
941 /**
942 * A function wrapping calls to the two functions in an && operation, returning the result of the first function
943 * if it is false-y and the result of the second function otherwise. Note that this is short-circuited, meaning
944 * that the second function will not be invoked if the first returns a false-y value.
945 */
946 both(pred1: Pred, pred2: Pred): Pred;
947 both(pred1: Pred): (pred2: Pred) => Pred;
948
949 /**
950 * Returns the result of calling its first argument with the remaining arguments. This is occasionally useful
951 * as a converging function for R.converge: the left branch can produce a function while the right branch
952 * produces a value to be passed to that function as an argument.
953 */
954 call(fn: (...args: any[]) => (...args: any[]) => any, ...args: any[]): any;
955
956 /**
957 * `chain` maps a function over a list and concatenates the results.
958 * This implementation is compatible with the Fantasy-land Chain spec
959 */
960 chain<T, U>(fn: (n: T) => ReadonlyArray<U>, list: ReadonlyArray<T>): U[];
961 chain<T, U>(fn: (n: T) => ReadonlyArray<U>): (list: ReadonlyArray<T>) => U[];
962
963 /**
964 * Restricts a number to be within a range.
965 * Also works for other ordered types such as Strings and Date
966 */
967 clamp<T>(min: T, max: T, value: T): T;
968 clamp<T>(min: T, max: T): (value: T) => T;
969 clamp<T>(min: T): (max: T, value: T) => T;
970 clamp<T>(min: T): (max: T) => (value: T) => T;
971
972 /**
973 * Creates a deep copy of the value which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates.
974 */
975 clone<T>(value: T): T;
976 clone<T>(value: ReadonlyArray<T>): T[];
977
978 /**
979 * Makes a comparator function out of a function that reports whether the first element is less than the second.
980 */
981 // comparator(pred: (a: any, b: any) => boolean): (x: number, y: number) => number;
982 comparator<T>(pred: (a: T, b: T) => boolean): (x: T, y: T) => number;
983
984 /**
985 * Takes a function f and returns a function g such that:
986 * - applying g to zero or more arguments will give true if applying the same arguments to f gives
987 * a logical false value; and
988 * - applying g to zero or more arguments will give false if applying the same arguments to f gives
989 * a logical true value.
990 */
991 complement(pred: (...args: any[]) => boolean): (...args: any[]) => boolean;
992
993 /**
994 * Performs right-to-left function composition. The rightmost function may have any arity; the remaining
995 * functions must be unary.
996 */
997
998 // generic rest parameters in TS 3.0 allows writing a single variant for any number of Vx
999 // compose<V extends any[], T1>(fn0: (...args: V) => T1): (...args: V) => T1;
1000 // compose<V extends any[], T1, T2>(fn1: (x: T1) => T2, fn0: (...args: V) => T1): (...args: V) => T2;
1001 // but requiring TS>=3.0 sounds like a breaking change, so just leaving a comment for the future
1002
1003 compose<T1>(fn0: () => T1): () => T1;
1004 compose<V0, T1>(fn0: (x0: V0) => T1): (x0: V0) => T1;
1005 compose<V0, V1, T1>(fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T1;
1006 compose<V0, V1, V2, T1>(fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T1;
1007
1008 compose<T1, T2>(fn1: (x: T1) => T2, fn0: () => T1): () => T2;
1009 compose<V0, T1, T2>(fn1: (x: T1) => T2, fn0: (x0: V0) => T1): (x0: V0) => T2;
1010 compose<V0, V1, T1, T2>(fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T2;
1011 compose<V0, V1, V2, T1, T2>(fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T2;
1012
1013 compose<T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: () => T1): () => T3;
1014 compose<V0, T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T3;
1015 compose<V0, V1, T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T3;
1016 compose<V0, V1, V2, T1, T2, T3>(fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T3;
1017
1018 compose<T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: () => T1): () => T4;
1019 compose<V0, T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T4;
1020 compose<V0, V1, T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T4;
1021 compose<V0, V1, V2, T1, T2, T3, T4>(fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T4;
1022
1023 compose<T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: () => T1): () => T5;
1024 compose<V0, T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T5;
1025 compose<V0, V1, T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T5;
1026 compose<V0, V1, V2, T1, T2, T3, T4, T5>(fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T5;
1027
1028 compose<T1, T2, T3, T4, T5, T6>(fn5: (x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: () => T1): () => T6;
1029 compose<V0, T1, T2, T3, T4, T5, T6>(fn5: (x: T5) => T6, fn4: (x: T4) => T5, fn3: (x: T3) => T4, fn2: (x: T2) => T3, fn1: (x: T1) => T2, fn0: (x: V0) => T1): (x: V0) => T6;
1030 compose<V0, V1, T1, T2, T3, T4, T5, T6>(
1031 fn5: (x: T5) => T6,
1032 fn4: (x: T4) => T5,
1033 fn3: (x: T3) => T4,
1034 fn2: (x: T2) => T3,
1035 fn1: (x: T1) => T2,
1036 fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T6;
1037 compose<V0, V1, V2, T1, T2, T3, T4, T5, T6>(
1038 fn5: (x: T5) => T6,
1039 fn4: (x: T4) => T5,
1040 fn3: (x: T3) => T4,
1041 fn2: (x: T2) => T3,
1042 fn1: (x: T1) => T2,
1043 fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T6;
1044
1045 /**
1046 * Returns the right-to-left Kleisli composition of the provided functions, each of which must return a value of a type supported by chain.
1047 * The typings only support arrays for now.
1048 * All functions must be unary.
1049 * R.composeK(h, g, f) is equivalent to R.compose(R.chain(h), R.chain(g), f).
1050 *
1051 * @deprecated since 0.26 in favor of composeWith(chain)
1052 */
1053 composeK<V0, T1>(
1054 fn0: (x0: V0) => T1[]): (x0: V0) => T1[];
1055 composeK<V0, T1, T2>(
1056 fn1: (x: T1) => T2[],
1057 fn0: (x0: V0) => T1[]): (x0: V0) => T2[];
1058 composeK<V0, T1, T2, T3>(
1059 fn2: (x: T2) => T3[],
1060 fn1: (x: T1) => T2[],
1061 fn0: (x: V0) => T1[]): (x: V0) => T3[];
1062 composeK<V0, T1, T2, T3, T4>(
1063 fn3: (x: T3) => T4[],
1064 fn2: (x: T2) => T3[],
1065 fn1: (x: T1) => T2[],
1066 fn0: (x: V0) => T1[]): (x: V0) => T4[];
1067 composeK<V0, T1, T2, T3, T4, T5>(
1068 fn4: (x: T4) => T5[],
1069 fn3: (x: T3) => T4[],
1070 fn2: (x: T2) => T3[],
1071 fn1: (x: T1) => T2[],
1072 fn0: (x: V0) => T1[]): (x: V0) => T5[];
1073 composeK<V0, T1, T2, T3, T4, T5, T6>(
1074 fn5: (x: T5) => T6[],
1075 fn4: (x: T4) => T5[],
1076 fn3: (x: T3) => T4[],
1077 fn2: (x: T2) => T3[],
1078 fn1: (x: T1) => T2[],
1079 fn0: (x: V0) => T1[]): (x: V0) => T6[];
1080
1081 /**
1082 * Performs right-to-left composition of one or more Promise-returning functions.
1083 * All functions must be unary.
1084 *
1085 * @deprecated since 0.26 in favor of composeWith(then)
1086 */
1087 composeP<V0, T1>(
1088 fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T1>;
1089 composeP<V0, T1, T2>(
1090 fn1: (x: T1) => Promise<T2>,
1091 fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T2>;
1092 composeP<V0, T1, T2, T3>(
1093 fn2: (x: T2) => Promise<T3>,
1094 fn1: (x: T1) => Promise<T2>,
1095 fn0: (x: V0) => Promise<T1>): (x: V0) => Promise<T3>;
1096 composeP<V0, T1, T2, T3, T4>(
1097 fn3: (x: T3) => Promise<T4>,
1098 fn2: (x: T2) => Promise<T3>,
1099 fn1: (x: T1) => Promise<T2>,
1100 fn0: (x: V0) => Promise<T1>): (x: V0) => Promise<T4>;
1101 composeP<V0, T1, T2, T3, T4, T5>(
1102 fn4: (x: T4) => Promise<T5>,
1103 fn3: (x: T3) => Promise<T4>,
1104 fn2: (x: T2) => Promise<T3>,
1105 fn1: (x: T1) => Promise<T2>,
1106 fn0: (x: V0) => Promise<T1>):
1107 (x: V0) => Promise<T5>;
1108 composeP<V0, T1, T2, T3, T4, T5, T6>(
1109 fn5: (x: T5) => Promise<T6>,
1110 fn4: (x: T4) => Promise<T5>,
1111 fn3: (x: T3) => Promise<T4>,
1112 fn2: (x: T2) => Promise<T3>,
1113 fn1: (x: T1) => Promise<T2>,
1114 fn0: (x: V0) => Promise<T1>):
1115 (x: V0) => Promise<T6>;
1116
1117 /**
1118 * Performs right-to-left function composition using transforming function.
1119 * With the current typings, all functions must be unary.
1120 */
1121 composeWith<V0, T>(composer: (a: any) => any, fns: ComposeWithFns<V0, T>): (x0: V0) => T;
1122 composeWith(composer: (a: any) => any): <V0, T>(fns: ComposeWithFns<V0, T>) => (x: V0) => T;
1123
1124 /**
1125 * Returns a new list consisting of the elements of the first list followed by the elements
1126 * of the second.
1127 */
1128 concat<T>(placeholder: Placeholder): (list2: ReadonlyArray<T>, list1: ReadonlyArray<T>) => T[];
1129 concat<T>(placeholder: Placeholder, list2: ReadonlyArray<T>): (list1: ReadonlyArray<T>) => T[];
1130 concat<T>(list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
1131 concat<T>(list1: ReadonlyArray<T>): (list2: ReadonlyArray<T>) => T[];
1132 concat(list1: string, list2: string): string;
1133 concat(list1: string): (list2: string) => string;
1134
1135 /**
1136 * Returns a function, fn, which encapsulates if/else-if/else logic. R.cond takes a list of [predicate, transform] pairs.
1137 * All of the arguments to fn are applied to each of the predicates in turn until one returns a "truthy" value, at which
1138 * point fn returns the result of applying its arguments to the corresponding transformer. If none of the predicates
1139 * matches, fn returns undefined.
1140 */
1141 cond(fns: ReadonlyArray<[Pred, (...a: any[]) => any]>): (...a: any[]) => any;
1142 cond<A, B>(fns: ReadonlyArray<[SafePred<A>, (...a: A[]) => B]>): (...a: A[]) => B;
1143
1144 /**
1145 * Wraps a constructor function inside a curried function that can be called with the same arguments and returns the same type.
1146 */
1147 construct(fn: (...a: any[]) => any): (...a: any[]) => any;
1148
1149 /**
1150 * Wraps a constructor function inside a curried function that can be called with the same arguments and returns the same type.
1151 * The arity of the function returned is specified to allow using variadic constructor functions.
1152 */
1153 constructN(n: number, fn: (...a: any[]) => any): (...a: any[]) => any;
1154
1155 /**
1156 * Returns `true` if the specified item is somewhere in the list, `false` otherwise.
1157 * Equivalent to `indexOf(a)(list) > -1`. Uses strict (`===`) equality checking.
1158 *
1159 * @deprecated since 0.26 in favor of includes
1160 */
1161 contains(__: Placeholder, list: string): (a: string) => boolean;
1162 contains<T>(__: Placeholder, list: T[]): (a: T) => boolean;
1163 contains(__: Placeholder): (list: string, a: string) => boolean;
1164 contains<T>(__: Placeholder): (list: T[], a: T) => boolean;
1165 contains(a: string, list: string): boolean;
1166 contains<T>(a: T, list: ReadonlyArray<T>): boolean;
1167 contains(a: string): (list: string) => boolean;
1168 contains<T>(a: T): (list: ReadonlyArray<T>) => boolean;
1169
1170 /**
1171 * Accepts a converging function and a list of branching functions and returns a new
1172 * function. When invoked, this new function is applied to some arguments, each branching
1173 * function is applied to those same arguments. The results of each branching function
1174 * are passed as arguments to the converging function to produce the return value.
1175 */
1176 converge(after: ((...a: any[]) => any), fns: ReadonlyArray<((...a: any[]) => any)>): (...a: any[]) => any;
1177
1178 /**
1179 * Counts the elements of a list according to how many match each value
1180 * of a key generated by the supplied function. Returns an object
1181 * mapping the keys produced by `fn` to the number of occurrences in
1182 * the list. Note that all keys are coerced to strings because of how
1183 * JavaScript objects work.
1184 */
1185 countBy<T>(fn: (a: T) => string | number, list: ReadonlyArray<T>): { [index: string]: number };
1186 countBy<T>(fn: (a: T) => string | number): (list: ReadonlyArray<T>) => { [index: string]: number };
1187
1188 /**
1189 * Returns a curried equivalent of the provided function. The curried function has two unusual capabilities.
1190 * First, its arguments needn't be provided one at a time.
1191 */
1192 curry<F extends (...args: any) => any>(f: F): Curry.Curry<F>;
1193
1194 /**
1195 * Returns a curried equivalent of the provided function, with the specified arity. The curried function has
1196 * two unusual capabilities. First, its arguments needn't be provided one at a time.
1197 */
1198 curryN(length: number, fn: (...args: any[]) => any): (...a: any[]) => any;
1199
1200 /**
1201 * Decrements its argument.
1202 */
1203 dec(n: number): number;
1204
1205 /**
1206 * Returns the second argument if it is not null or undefined. If it is null or undefined, the
1207 * first (default) argument is returned.
1208 */
1209 defaultTo<T, U>(a: T, b: U | null | undefined): T | U;
1210 defaultTo<T>(a: T): <U>(b: U | null | undefined) => T | U;
1211
1212 /**
1213 * Makes a descending comparator function out of a function that returns a value that can be compared with < and >.
1214 */
1215 descend<T>(fn: (obj: T) => any, a: T, b: T): number;
1216 descend<T>(fn: (obj: T) => any): (a: T, b: T) => number;
1217
1218 /**
1219 * Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.
1220 */
1221 difference<T>(list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
1222 difference<T>(list1: ReadonlyArray<T>): (list2: ReadonlyArray<T>) => T[];
1223
1224 /**
1225 * Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.
1226 * Duplication is determined according to the value returned by applying the supplied predicate to two list
1227 * elements.
1228 */
1229 differenceWith<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray<T1>, list2: ReadonlyArray<T2>): T1[];
1230 differenceWith<T1, T2>(pred: (a: T1, b: T2) => boolean): (list1: ReadonlyArray<T1>, list2: ReadonlyArray<T2>) => T1[];
1231 differenceWith<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray<T1>): (list2: ReadonlyArray<T2>) => T1[];
1232
1233 /*
1234 * Returns a new object that does not contain a prop property.
1235 */
1236 // It seems impossible to infer the return type, so this may to be specified explicitely
1237 dissoc<T>(prop: string, obj: any): T;
1238 dissoc(prop: string): <U>(obj: any) => U;
1239
1240 /**
1241 * Makes a shallow clone of an object, omitting the property at the given path.
1242 */
1243 dissocPath<T>(path: Path, obj: any): T;
1244 dissocPath<T>(path: Path): (obj: any) => T;
1245
1246 /**
1247 * Divides two numbers. Equivalent to a / b.
1248 */
1249 divide(__: Placeholder, b: number): (a: number) => number;
1250 divide(__: Placeholder): (b: number, a: number) => number;
1251 divide(a: number, b: number): number;
1252 divide(a: number): (b: number) => number;
1253
1254 /**
1255 * Returns a new list containing all but the first n elements of the given list.
1256 */
1257 drop<T>(n: number, xs: ReadonlyArray<T>): T[];
1258 drop(n: number, xs: string): string;
1259 drop<T>(n: number): {
1260 (xs: string): string;
1261 (xs: ReadonlyArray<T>): T[];
1262 };
1263
1264 /**
1265 * Returns a list containing all but the last n elements of the given list.
1266 */
1267 dropLast<T>(n: number, xs: ReadonlyArray<T>): T[];
1268 dropLast(n: number, xs: string): string;
1269 dropLast<T>(n: number): {
1270 (xs: ReadonlyArray<T>): T[];
1271 (xs: string): string;
1272 };
1273
1274 /**
1275 * Returns a new list containing all but last then elements of a given list, passing each value from the
1276 * right to the supplied predicate function, skipping elements while the predicate function returns true.
1277 */
1278 dropLastWhile<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): T[];
1279 dropLastWhile<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => T[];
1280
1281 /**
1282 * Returns a new list without any consecutively repeating elements. R.equals is used to determine equality.
1283 */
1284 dropRepeats<T>(list: ReadonlyArray<T>): T[];
1285
1286 /**
1287 * Returns a new list without any consecutively repeating elements.
1288 * Equality is determined by applying the supplied predicate to each pair of consecutive elements.
1289 * The first element in a series of equal elements will be preserved.
1290 */
1291 dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean, list: ReadonlyArray<T>): T[];
1292 dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean): (list: ReadonlyArray<T>) => T[];
1293
1294 /**
1295 * Returns a new list containing the last n elements of a given list, passing each value to the supplied
1296 * predicate function, skipping elements while the predicate function returns true.
1297 */
1298 dropWhile<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): T[];
1299 dropWhile<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => T[];
1300
1301 /**
1302 * A function wrapping calls to the two functions in an || operation, returning the result of the first
1303 * function if it is truth-y and the result of the second function otherwise. Note that this is
1304 * short-circuited, meaning that the second function will not be invoked if the first returns a truth-y value.
1305 */
1306 either(pred1: Pred, pred2: Pred): Pred;
1307 either(pred1: Pred): (pred2: Pred) => Pred;
1308
1309 /**
1310 * Returns the empty value of its argument's type. Ramda defines the empty value of Array ([]), Object ({}),
1311 * String (''), and Arguments. Other types are supported if they define <Type>.empty and/or <Type>.prototype.empty.
1312 * Dispatches to the empty method of the first argument, if present.
1313 */
1314 empty<T>(x: T): T;
1315
1316 /**
1317 * Checks if a list ends with the provided values
1318 */
1319 endsWith(a: string, list: string): boolean;
1320 endsWith(a: string): (list: string) => boolean;
1321 endsWith<T>(a: T | ReadonlyArray<T>, list: ReadonlyArray<T>): boolean;
1322 endsWith<T>(a: T | ReadonlyArray<T>): (list: ReadonlyArray<T>) => boolean;
1323
1324 /**
1325 * Takes a function and two values in its domain and returns true if the values map to the same value in the
1326 * codomain; false otherwise.
1327 */
1328 eqBy<T, U = T>(fn: (a: T) => U, a: T, b: T): boolean;
1329 eqBy<T, U = T>(fn: (a: T) => U, a: T): (b: T) => boolean;
1330 eqBy<T, U = T>(fn: (a: T) => U): Curry.Curry<(a: T, b: T) => boolean>;
1331
1332 /**
1333 * Reports whether two functions have the same value for the specified property.
1334 */
1335 eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;
1336 eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;
1337 eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
1338
1339 /**
1340 * Returns true if its arguments are equivalent, false otherwise. Dispatches to an equals method if present.
1341 * Handles cyclical data structures.
1342 */
1343 equals<T>(a: T, b: T): boolean;
1344 equals<T>(a: T): (b: T) => boolean;
1345
1346 /**
1347 * Creates a new object by evolving a shallow copy of object, according to the transformation functions.
1348 */
1349 evolve<E extends Evolver, V extends Evolvable<E>>(transformations: E, obj: V): Evolve<V, E>;
1350 evolve<E extends Evolver>(transformations: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
1351
1352 /*
1353 * A function that always returns false. Any passed in parameters are ignored.
1354 */
1355 F(): boolean;
1356
1357 /**
1358 * Returns a new list containing only those items that match a given predicate function. The predicate function is passed one argument: (value).
1359 */
1360 filter: Filter;
1361
1362 /**
1363 * Returns the first element of the list which matches the predicate, or `undefined` if no
1364 * element matches.
1365 */
1366 find<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): T | undefined;
1367 find<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => T | undefined;
1368
1369 /**
1370 * Returns the index of the first element of the list which matches the predicate, or `-1`
1371 * if no element matches.
1372 */
1373 findIndex<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): number;
1374 findIndex<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => number;
1375
1376 /**
1377 * Returns the last element of the list which matches the predicate, or `undefined` if no
1378 * element matches.
1379 */
1380 findLast<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): T | undefined;
1381 findLast<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => T | undefined;
1382
1383 /**
1384 * Returns the index of the last element of the list which matches the predicate, or
1385 * `-1` if no element matches.
1386 */
1387 findLastIndex<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): number;
1388 findLastIndex<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => number;
1389
1390 /**
1391 * Returns a new list by pulling every item out of it (and all its sub-arrays) and putting
1392 * them in a new array, depth-first.
1393 */
1394 flatten<T>(x: ReadonlyArray<T> | ReadonlyArray<T[]> | ReadonlyArray<ReadonlyArray<T>>): T[];
1395
1396 /**
1397 * Returns a new function much like the supplied one, except that the first two arguments'
1398 * order is reversed.
1399 */
1400 flip<T, U, TResult>(fn: (arg0: T, arg1: U) => TResult): (arg1: U, arg0?: T) => TResult;
1401 flip<T, U, TResult>(fn: (arg0: T, arg1: U, ...args: any[]) => TResult): (arg1: U, arg0?: T, ...args: any[]) => TResult;
1402
1403 /**
1404 * Iterate over an input list, calling a provided function fn for each element in the list.
1405 */
1406 forEach<T>(fn: (x: T) => void, list: T[]): T[];
1407 forEach<T>(fn: (x: T) => void): (list: T[]) => T[];
1408 forEach<T>(fn: (x: T) => void, list: ReadonlyArray<T>): ReadonlyArray<T>;
1409 forEach<T>(fn: (x: T) => void): (list: ReadonlyArray<T>) => ReadonlyArray<T>;
1410
1411 /**
1412 * Iterate over an input object, calling a provided function fn for each key and value in the object.
1413 */
1414 forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void, obj: T): T;
1415 forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void): (obj: T) => T;
1416
1417 /**
1418 * Creates a new object out of a list key-value pairs.
1419 */
1420 fromPairs<V>(pairs: Array<KeyValuePair<string, V>>): { [index: string]: V };
1421 fromPairs<V>(pairs: Array<KeyValuePair<number, V>>): { [index: number]: V };
1422
1423 /**
1424 * Splits a list into sublists stored in an object, based on the result of
1425 * calling a String-returning function
1426 * on each element, and grouping the results according to values returned.
1427 */
1428 groupBy<T>(fn: (a: T) => string, list: ReadonlyArray<T>): { [index: string]: T[] };
1429 groupBy<T>(fn: (a: T) => string): (list: ReadonlyArray<T>) => { [index: string]: T[] };
1430
1431 /**
1432 * Takes a list and returns a list of lists where each sublist's elements are all "equal" according to the provided equality function
1433 */
1434 groupWith<T>(fn: (x: T, y: T) => boolean): (list: ReadonlyArray<T>) => T[][];
1435 groupWith<T>(fn: (x: T, y: T) => boolean, list: ReadonlyArray<T>): T[][];
1436 groupWith<T>(fn: (x: T, y: T) => boolean, list: string): string[];
1437
1438 /**
1439 * Returns true if the first parameter is greater than the second.
1440 */
1441 gt(__: Placeholder, b: number): (a: number) => boolean;
1442 gt(__: Placeholder): (b: number, a: number) => boolean;
1443 gt(a: number, b: number): boolean;
1444 gt(a: number): (b: number) => boolean;
1445
1446 /**
1447 * Returns true if the first parameter is greater than or equal to the second.
1448 */
1449 gte(__: Placeholder, b: number): (a: number) => boolean;
1450 gte(__: Placeholder): (b: number, a: number) => boolean;
1451 gte(a: number, b: number): boolean;
1452 gte(a: number): (b: number) => boolean;
1453
1454 /**
1455 * Returns whether or not an object has an own property with the specified name.
1456 */
1457 has<T>(__: Placeholder, obj: T): (s: string) => boolean;
1458 has<T>(__: Placeholder): (obj: T, s: string) => boolean;
1459 has<T>(s: string, obj: T): boolean;
1460 has(s: string): <T>(obj: T) => boolean;
1461
1462 /**
1463 * Returns whether or not an object or its prototype chain has a property with the specified name
1464 */
1465 hasIn<T>(s: string, obj: T): boolean;
1466 hasIn(s: string): <T>(obj: T) => boolean;
1467
1468 /**
1469 * Returns whether or not a path exists in an object. Only the object's own properties are checked.
1470 */
1471 hasPath<T>(list: ReadonlyArray<string>, obj: T): boolean;
1472 hasPath(list: ReadonlyArray<string>): <T>(obj: T) => boolean;
1473
1474 /**
1475 * Returns the first element in a list.
1476 * In some libraries this function is named `first`.
1477 */
1478 head<T>(list: ReadonlyArray<T>): T | undefined;
1479 head(list: string): string;
1480
1481 /**
1482 * Returns true if its arguments are identical, false otherwise. Values are identical if they reference the
1483 * same memory. NaN is identical to NaN; 0 and -0 are not identical.
1484 */
1485 identical<T>(a: T, b: T): boolean;
1486 identical<T>(a: T): (b: T) => boolean;
1487
1488 /**
1489 * A function that does nothing but return the parameter supplied to it. Good as a default
1490 * or placeholder function.
1491 */
1492 identity<T>(a: T): T;
1493
1494 /**
1495 * Creates a function that will process either the onTrue or the onFalse function depending upon the result
1496 * of the condition predicate.
1497 */
1498 ifElse(fn: Pred, onTrue: Arity1Fn, onFalse: Arity1Fn): Arity1Fn;
1499 ifElse(fn: Pred, onTrue: Arity2Fn, onFalse: Arity2Fn): Arity2Fn;
1500
1501 /**
1502 * Increments its argument.
1503 */
1504 inc(n: number): number;
1505
1506 /**
1507 * Given a target, this function checks a list for the target and returns a boolean.
1508 * Given a string, this function checks for the string in another string or list and returns
1509 * a boolean.
1510 */
1511 includes(s: string, list: ReadonlyArray<string> | string): boolean;
1512 includes(s: string): (list: ReadonlyArray<string> | string) => boolean;
1513 includes<T>(target: T, list: ReadonlyArray<T>): boolean;
1514 includes<T>(target: T): (list: ReadonlyArray<T>) => boolean;
1515
1516 /**
1517 * Given a function that generates a key, turns a list of objects into an object indexing the objects
1518 * by the given key.
1519 */
1520 indexBy<T>(fn: (a: T) => string, list: ReadonlyArray<T>): { [key: string]: T };
1521 indexBy<T>(fn: (a: T) => string): (list: ReadonlyArray<T>) => { [key: string]: T };
1522
1523 /**
1524 * Returns the position of the first occurrence of an item in an array
1525 * (by strict equality),
1526 * or -1 if the item is not included in the array.
1527 */
1528 indexOf<T>(target: T, list: ReadonlyArray<T>): number;
1529 indexOf<T>(target: T): (list: ReadonlyArray<T>) => number;
1530
1531 /**
1532 * Returns all but the last element of a list or string.
1533 */
1534 init<T>(list: ReadonlyArray<T>): T[];
1535 init(list: string): string;
1536
1537 /**
1538 * Takes a predicate `pred`, a list `xs`, and a list `ys`, and returns a list
1539 * `xs'` comprising each of the elements of `xs` which is equal to one or more
1540 * elements of `ys` according to `pred`.
1541 *
1542 * `pred` must be a binary function expecting an element from each list.
1543 *
1544 * `xs`, `ys`, and `xs'` are treated as sets, semantically, so ordering should
1545 * not be significant, but since `xs'` is ordered the implementation guarantees
1546 * that its values are in the same order as they appear in `xs`. Duplicates are
1547 * not removed, so `xs'` may contain duplicates if `xs` contains duplicates.
1548 */
1549
1550 innerJoin<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray<T1>, list2: ReadonlyArray<T2>): T1[];
1551 innerJoin<T1, T2>(pred: (a: T1, b: T2) => boolean): (list1: ReadonlyArray<T1>, list2: ReadonlyArray<T2>) => T1[];
1552 innerJoin<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: ReadonlyArray<T1>): (list2: ReadonlyArray<T2>) => T1[];
1553
1554 /**
1555 * Inserts the supplied element into the list, at index index. Note that
1556 * this is not destructive: it returns a copy of the list with the changes.
1557 */
1558 insert<T>(index: number, elt: T, list: ReadonlyArray<T>): T[];
1559 insert<T>(index: number, elt: T): (list: ReadonlyArray<T>) => T[];
1560 insert(index: number): <T>(elt: T, list: ReadonlyArray<T>) => T[];
1561
1562 /**
1563 * Inserts the sub-list into the list, at index `index`. _Note that this
1564 * is not destructive_: it returns a copy of the list with the changes.
1565 */
1566 insertAll<T>(index: number, elts: ReadonlyArray<T>, list: ReadonlyArray<T>): T[];
1567 insertAll<T>(index: number, elts: ReadonlyArray<T>): (list: ReadonlyArray<T>) => T[];
1568 insertAll(index: number): <T>(elts: ReadonlyArray<T>, list: ReadonlyArray<T>) => T[];
1569
1570 /**
1571 * Combines two lists into a set (i.e. no duplicates) composed of those elements common to both lists.
1572 */
1573 intersection<T>(list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
1574 intersection<T>(list1: ReadonlyArray<T>): (list2: ReadonlyArray<T>) => T[];
1575
1576 /**
1577 * Combines two lists into a set (i.e. no duplicates) composed of those
1578 * elements common to both lists. Duplication is determined according
1579 * to the value returned by applying the supplied predicate to two list
1580 * elements.
1581 */
1582 intersectionWith<T>(pred: (a: T, b: T) => boolean, list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
1583
1584 /**
1585 * Creates a new list with the separator interposed between elements.
1586 */
1587 intersperse<T>(separator: T, list: ReadonlyArray<T>): T[];
1588 intersperse<T>(separator: T): (list: ReadonlyArray<T>) => T[];
1589
1590 /**
1591 * Transforms the items of the list with the transducer and appends the transformed items to the accumulator
1592 * using an appropriate iterator function based on the accumulator type.
1593 */
1594 into<T>(acc: any, xf: (...a: any[]) => any, list: ReadonlyArray<T>): T[];
1595 into(acc: any, xf: (...a: any[]) => any): <T>(list: ReadonlyArray<T>) => T[];
1596 into(acc: any): <T>(xf: (...a: any[]) => any, list: ReadonlyArray<T>) => T[];
1597
1598 /**
1599 * Same as R.invertObj, however this accounts for objects with duplicate values by putting the values into an array.
1600 */
1601 invert<T>(obj: T): { [index: string]: string[] };
1602
1603 /**
1604 * Returns a new object with the keys of the given object as values, and the values of the given object as keys.
1605 */
1606 invertObj(obj: { [index: string]: string } | { [index: number]: string }): { [index: string]: string };
1607
1608 /**
1609 * Turns a named method with a specified arity into a function that can be called directly
1610 * supplied with arguments and a target object.
1611 *
1612 * The returned function is curried and accepts `arity + 1` parameters where the final
1613 * parameter is the target object.
1614 */
1615 invoker(arity: number, method: string): (...a: any[]) => any;
1616
1617 /**
1618 * See if an object (`val`) is an instance of the supplied constructor.
1619 * This function will check up the inheritance chain, if any.
1620 */
1621 is(ctor: any, val: any): boolean;
1622 is(ctor: any): (val: any) => boolean;
1623
1624 /**
1625 * Tests whether or not an object is similar to an array.
1626 */
1627 isArrayLike(val: any): boolean;
1628
1629 /**
1630 * Reports whether the list has zero elements.
1631 */
1632 isEmpty(value: any): boolean;
1633
1634 /**
1635 * Returns true if the input value is NaN.
1636 */
1637 isNaN(x: any): boolean;
1638
1639 /**
1640 * Checks if the input value is null or undefined.
1641 */
1642 isNil(value: any): value is null | undefined;
1643
1644 /**
1645 * Returns a string made by inserting the `separator` between each
1646 * element and concatenating all the elements into a single string.
1647 */
1648 join(x: string, xs: ReadonlyArray<any>): string;
1649 join(x: string): (xs: ReadonlyArray<any>) => string;
1650
1651 /**
1652 * Applies a list of functions to a list of values.
1653 */
1654 juxt<T, U>(fns: Array<(...args: T[]) => U>): (...args: T[]) => U[];
1655
1656 /**
1657 * Returns a list containing the names of all the enumerable own
1658 * properties of the supplied object.
1659 */
1660 keys<T extends object>(x: T): Array<keyof T>;
1661 keys<T>(x: T): string[];
1662
1663 /**
1664 * Returns a list containing the names of all the
1665 * properties of the supplied object, including prototype properties.
1666 */
1667 keysIn<T>(obj: T): string[];
1668
1669 /**
1670 * Returns the last element from a list.
1671 */
1672 last<T>(list: ReadonlyArray<T>): T | undefined;
1673 last(list: string): string;
1674
1675 /**
1676 * Returns the position of the last occurrence of an item (by strict equality) in
1677 * an array, or -1 if the item is not included in the array.
1678 */
1679 lastIndexOf<T>(target: T, list: ReadonlyArray<T>): number;
1680
1681 /**
1682 * Returns the number of elements in the array by returning list.length.
1683 */
1684 length<T>(list: ReadonlyArray<T>): number;
1685
1686 /**
1687 * Returns a lens for the given getter and setter functions. The getter
1688 * "gets" the value of the focus; the setter "sets" the value of the focus.
1689 * The setter should not mutate the data structure.
1690 */
1691 lens<T, U, V>(getter: (s: T) => U, setter: (a: U, s: T) => V): Lens;
1692
1693 /**
1694 * Creates a lens that will focus on index n of the source array.
1695 */
1696 lensIndex(n: number): Lens;
1697
1698 /**
1699 * Returns a lens whose focus is the specified path.
1700 * See also view, set, over.
1701 */
1702 lensPath(path: Path): Lens;
1703
1704 /**
1705 * lensProp creates a lens that will focus on property k of the source object.
1706 */
1707 lensProp(str: string): {
1708 <T, U>(obj: T): U;
1709 set<T, U, V>(val: T, obj: U): V;
1710 /*map<T>(fn: (...a: any[]) => any, obj: T): T*/
1711 };
1712
1713 /**
1714 * "lifts" a function of arity > 1 so that it may "map over" a list, Function or other object that satisfies
1715 * the FantasyLand Apply spec.
1716 */
1717 lift(fn: ((...a: any[]) => any), ...args: any[]): any;
1718
1719 /**
1720 * "lifts" a function to be the specified arity, so that it may "map over" that many lists, Functions or other
1721 * objects that satisfy the FantasyLand Apply spec.
1722 */
1723 liftN(n: number, fn: ((...a: any[]) => any), ...args: any[]): any;
1724
1725 /**
1726 * Returns true if the first parameter is less than the second.
1727 */
1728 lt(__: Placeholder, b: number): (a: number) => boolean;
1729 lt(__: Placeholder): (b: number, a: number) => boolean;
1730 lt(a: number, b: number): boolean;
1731 lt(a: number): (b: number) => boolean;
1732
1733 /**
1734 * Returns true if the first parameter is less than or equal to the second.
1735 */
1736 lte(__: Placeholder, b: number): (a: number) => boolean;
1737 lte(__: Placeholder): (b: number, a: number) => boolean;
1738 lte(a: number, b: number): boolean;
1739 lte(a: number): (b: number) => boolean;
1740
1741 /**
1742 * Returns a new list, constructed by applying the supplied function to every element of the supplied list.
1743 */
1744 map<T, U>(fn: (x: T) => U, list: ReadonlyArray<T>): U[];
1745 map<T, U>(fn: (x: T) => U): (list: ReadonlyArray<T>) => U[];
1746 map<T, U>(fn: (x: T[keyof T & keyof U]) => U[keyof T & keyof U], list: T): U;
1747 map<T, U>(fn: (x: T[keyof T & keyof U]) => U[keyof T & keyof U]): (list: T) => U;
1748 map<T, U>(fn: (x: T) => U, obj: Functor<T>): Functor<U>; // used in functors
1749 map<T, U>(fn: (x: T) => U): (obj: Functor<T>) => Functor<U>; // used in functors
1750
1751 /**
1752 * The mapAccum function behaves like a combination of map and reduce.
1753 */
1754 mapAccum<T, U, TResult>(fn: (acc: U, value: T) => [U, TResult], acc: U, list: ReadonlyArray<T>): [U, TResult[]];
1755 mapAccum<T, U, TResult>(fn: (acc: U, value: T) => [U, TResult]): (acc: U, list: ReadonlyArray<T>) => [U, TResult[]];
1756 mapAccum<T, U, TResult>(fn: (acc: U, value: T) => [U, TResult], acc: U): (list: ReadonlyArray<T>) => [U, TResult[]];
1757
1758 /**
1759 * The mapAccumRight function behaves like a combination of map and reduce.
1760 */
1761 mapAccumRight<T, U, TResult>(fn: (acc: U, value: T) => [U, TResult], acc: U, list: ReadonlyArray<T>): [U, TResult[]];
1762 mapAccumRight<T, U, TResult>(fn: (acc: U, value: T) => [U, TResult]): (acc: U, list: ReadonlyArray<T>) => [U, TResult[]];
1763 mapAccumRight<T, U, TResult>(fn: (acc: U, value: T) => [U, TResult], acc: U): (list: ReadonlyArray<T>) => [U, TResult[]];
1764
1765 /**
1766 * Like mapObj, but but passes additional arguments to the predicate function.
1767 */
1768 mapObjIndexed<T, TResult>(
1769 fn: (value: T, key: string, obj?: {
1770 [key: string]: T
1771 }) => TResult,
1772 obj: {
1773 [key: string]: T
1774 }
1775 ): {
1776 [key: string]: TResult
1777 };
1778 mapObjIndexed<T, TResult>(fn: (value: T, key: string, obj?: any) => TResult, obj: any): { [index: string]: TResult };
1779 mapObjIndexed<T, TResult>(fn: (value: T, key: string, obj?: any) => TResult): (obj: any) => { [index: string]: TResult };
1780
1781 /**
1782 * Tests a regular expression agains a String
1783 */
1784 match(regexp: RegExp, str: string): any[];
1785 match(regexp: RegExp): (str: string) => any[];
1786
1787 /**
1788 * mathMod behaves like the modulo operator should mathematically, unlike the `%`
1789 * operator (and by extension, R.modulo). So while "-17 % 5" is -2,
1790 * mathMod(-17, 5) is 3. mathMod requires Integer arguments, and returns NaN
1791 * when the modulus is zero or negative.
1792 */
1793 mathMod(__: Placeholder, b: number): (a: number) => number;
1794 mathMod(__: Placeholder): (b: number, a: number) => number;
1795 mathMod(a: number, b: number): number;
1796 mathMod(a: number): (b: number) => number;
1797
1798 /**
1799 * Returns the larger of its two arguments.
1800 */
1801 max<T extends Ord>(a: T, b: T): T;
1802 max<T extends Ord>(a: T): (b: T) => T;
1803
1804 /**
1805 * Takes a function and two values, and returns whichever value produces
1806 * the larger result when passed to the provided function.
1807 */
1808 maxBy<T>(keyFn: (a: T) => Ord, a: T, b: T): T;
1809 maxBy<T>(keyFn: (a: T) => Ord, a: T): (b: T) => T;
1810 maxBy<T>(keyFn: (a: T) => Ord): Curry.Curry<(a: T, b: T) => T>;
1811
1812 /**
1813 * Returns the mean of the given list of numbers.
1814 */
1815 mean(list: ReadonlyArray<number>): number;
1816
1817 /**
1818 * Returns the median of the given list of numbers.
1819 */
1820 median(list: ReadonlyArray<number>): number;
1821
1822 /**
1823 * Creates a new function that, when invoked, caches the result of calling fn for a given argument set and returns the result.
1824 * Subsequent calls to the memoized fn with the same argument set will not result in an additional call to fn; instead, the cached result for that set of arguments will be returned.
1825 */
1826 memoizeWith<T extends (...args: any[]) => any>(keyFn: (...v: Parameters<T>) => string, fn: T): T;
1827
1828 /**
1829 * Create a new object with the own properties of a
1830 * merged with the own properties of object b.
1831 * This function will *not* mutate passed-in objects.
1832 *
1833 * @deprecated since 0.26 in favor of mergeRight
1834 */
1835 merge<T2>(__: Placeholder, b: T2): <T1>(a: T1) => Merge<T2, T1>;
1836 merge(__: Placeholder): <T1, T2>(b: T2, a: T1) => Merge<T2, T1>;
1837 merge<T1, T2>(a: T1, b: T2): Merge<T2, T1>;
1838 merge<T1>(a: T1): <T2>(b: T2) => Merge<T2, T1>;
1839
1840 /**
1841 * Merges a list of objects together into one object.
1842 */
1843 mergeAll<T>(list: ReadonlyArray<T>): T;
1844 mergeAll(list: ReadonlyArray<any>): any;
1845
1846 /**
1847 * Creates a new object with the own properties of the first object merged with the own properties of the second object.
1848 * If a key exists in both objects:
1849 * and both values are objects, the two values will be recursively merged
1850 * otherwise the value from the first object will be used.
1851 */
1852 mergeDeepLeft<T1, T2>(a: T1, b: T2): MergeDeep<T1, T2>;
1853 mergeDeepLeft<T1>(a: T1): <T2>(b: T2) => MergeDeep<T1, T2>;
1854
1855 /**
1856 * Creates a new object with the own properties of the first object merged with the own properties of the second object.
1857 * If a key exists in both objects:
1858 * and both values are objects, the two values will be recursively merged
1859 * otherwise the value from the second object will be used.
1860 */
1861 mergeDeepRight<A, B>(a: A, b: B): MergeDeep<B, A>;
1862 mergeDeepRight<A>(a: A): <B>(b: B) => MergeDeep<B, A>;
1863
1864 /**
1865 * Creates a new object with the own properties of the two provided objects. If a key exists in both objects:
1866 * and both associated values are also objects then the values will be recursively merged.
1867 * otherwise the provided function is applied to associated values using the resulting value as the new value
1868 * associated with the key. If a key only exists in one object, the value will be associated with the key of the resulting object.
1869 */
1870 mergeDeepWith<T1, T2>(fn: (x: any, z: any) => any, a: T1, b: T2): any;
1871 mergeDeepWith<T1, T2>(fn: (x: any, z: any) => any, a: T1): (b: T2) => any;
1872 mergeDeepWith<T1, T2>(fn: (x: any, z: any) => any): (a: T1, b: T2) => any;
1873
1874 /**
1875 * Creates a new object with the own properties of the two provided objects. If a key exists in both objects:
1876 * and both associated values are also objects then the values will be recursively merged.
1877 * otherwise the provided function is applied to the key and associated values using the resulting value as
1878 * the new value associated with the key. If a key only exists in one object, the value will be associated with
1879 * the key of the resulting object.
1880 */
1881 mergeDeepWithKey<T1, T2>(fn: (k: string, x: any, z: any) => any, a: T1, b: T2): any;
1882 mergeDeepWithKey<T1, T2>(fn: (k: string, x: any, z: any) => any, a: T1): (b: T2) => any;
1883 mergeDeepWithKey<T1, T2>(fn: (k: string, x: any, z: any) => any): (a: T1, b: T2) => any;
1884
1885 /**
1886 * Create a new object with the own properties of the first object merged with the own properties of the second object.
1887 * If a key exists in both objects, the value from the first object will be used.
1888 */
1889 mergeLeft<T1, T2>(a: T1, b: T2): Merge<T1, T2>;
1890 mergeLeft<T1>(a: T1): <T2>(b: T2) => Merge<T1, T2>;
1891
1892 /**
1893 * Create a new object with the own properties of the first object merged with the own properties of the second object.
1894 * If a key exists in both objects, the value from the second object will be used.
1895 */
1896 mergeRight<T1, T2>(a: T1, b: T2): Merge<T2, T1>;
1897 mergeRight<T1>(a: T1): <T2>(b: T2) => Merge<T2, T1>;
1898
1899 /**
1900 * Creates a new object with the own properties of the two provided objects. If a key exists in both objects,
1901 * the provided function is applied to the values associated with the key in each object, with the result being used as
1902 * the value associated with the key in the returned object. The key will be excluded from the returned object if the
1903 * resulting value is undefined.
1904 */
1905 mergeWith<U, V>(fn: (x: any, z: any) => any, a: U, b: V): any;
1906 mergeWith<U>(fn: (x: any, z: any) => any, a: U): <V>(b: V) => any;
1907 mergeWith(fn: (x: any, z: any) => any): <U, V>(a: U, b: V) => any;
1908
1909 /**
1910 * Creates a new object with the own properties of the two provided objects. If a key exists in both objects,
1911 * the provided function is applied to the key and the values associated with the key in each object, with the
1912 * result being used as the value associated with the key in the returned object. The key will be excluded from
1913 * the returned object if the resulting value is undefined.
1914 */
1915 mergeWithKey<U, V>(fn: (str: string, x: any, z: any) => any, a: U, b: V): any;
1916 mergeWithKey<U>(fn: (str: string, x: any, z: any) => any, a: U): <V>(b: V) => any;
1917 mergeWithKey(fn: (str: string, x: any, z: any) => any): <U, V>(a: U, b: V) => any;
1918
1919 /**
1920 * Returns the smaller of its two arguments.
1921 */
1922 min<T extends Ord>(a: T, b: T): T;
1923 min<T extends Ord>(a: T): (b: T) => T;
1924
1925 /**
1926 * Takes a function and two values, and returns whichever value produces
1927 * the smaller result when passed to the provided function.
1928 */
1929 minBy<T>(keyFn: (a: T) => Ord, a: T, b: T): T;
1930 minBy<T>(keyFn: (a: T) => Ord, a: T): (b: T) => T;
1931 minBy<T>(keyFn: (a: T) => Ord): Curry.Curry<(a: T, b: T) => T>;
1932
1933 /**
1934 * Divides the second parameter by the first and returns the remainder.
1935 * The flipped version (`moduloBy`) may be more useful curried.
1936 * Note that this functions preserves the JavaScript-style behavior for
1937 * modulo. For mathematical modulo see `mathMod`
1938 */
1939 modulo(__: Placeholder, b: number): (a: number) => number;
1940 modulo(__: Placeholder): (b: number, a: number) => number;
1941 modulo(a: number, b: number): number;
1942 modulo(a: number): (b: number) => number;
1943
1944 /**
1945 * Multiplies two numbers. Equivalent to a * b but curried.
1946 */
1947 multiply(a: number, b: number): number;
1948 multiply(a: number): (b: number) => number;
1949
1950 /**
1951 * Moves an item, at index `from`, to index `to`, in a `list` of elements.
1952 * A new list will be created containing the new elements order.
1953 */
1954 move<T>(from: number, to: number, list: ReadonlyArray<T>): T[];
1955 move(from: number, to: number): <T>(list: ReadonlyArray<T>) => T[];
1956 move(from: number): {
1957 <T>(to: number, list: ReadonlyArray<T>): T[];
1958 (to: number): <T>(list: ReadonlyArray<T>) => T[];
1959 };
1960
1961 /**
1962 * Wraps a function of any arity (including nullary) in a function that accepts exactly n parameters.
1963 * Any extraneous parameters will not be passed to the supplied function.
1964 */
1965 nAry(n: number, fn: (...arg: any[]) => any): (...a: any[]) => any;
1966 nAry(n: number): (fn: (...arg: any[]) => any) => (...a: any[]) => any;
1967
1968 /**
1969 * Negates its argument.
1970 */
1971 negate(n: number): number;
1972
1973 /**
1974 * Returns true if no elements of the list match the predicate, false otherwise.
1975 */
1976 none<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): boolean;
1977 none<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => boolean;
1978
1979 /**
1980 * A function wrapping a call to the given function in a `!` operation. It will return `true` when the
1981 * underlying function would return a false-y value, and `false` when it would return a truth-y one.
1982 */
1983 not(value: any): boolean;
1984
1985 /**
1986 * Returns the nth element in a list.
1987 */
1988 nth<T>(n: number, list: ReadonlyArray<T>): T | undefined;
1989 nth(n: number): <T>(list: ReadonlyArray<T>) => T | undefined;
1990
1991 /**
1992 * Returns a function which returns its nth argument.
1993 */
1994 nthArg(n: number): (...a: any[]) => any;
1995
1996 /**
1997 * Creates an object containing a single key:value pair.
1998 */
1999 objOf<T, K extends string>(key: K, value: T): Record<K, T>;
2000 objOf<K extends string>(key: K): <T>(value: T) => Record<K, T>;
2001
2002 /**
2003 * Returns a singleton array containing the value provided.
2004 */
2005 of<T>(x: T): T[];
2006
2007 /**
2008 * Returns a partial copy of an object omitting the keys specified.
2009 */
2010 omit<T, K extends string>(names: ReadonlyArray<K>, obj: T): Omit<T, K>;
2011 omit<K extends string>(names: ReadonlyArray<K>): <T>(obj: T) => Omit<T, K>;
2012
2013 /**
2014 * Accepts a function fn and returns a function that guards invocation of fn such that fn can only ever be
2015 * called once, no matter how many times the returned function is invoked. The first value calculated is
2016 * returned in subsequent invocations.
2017 */
2018 once(fn: (...a: any[]) => any): (...a: any[]) => any;
2019 once<T>(fn: (...a: any[]) => T): (...a: any[]) => T;
2020
2021 /**
2022 * A function that returns the first truthy of two arguments otherwise the last argument. Note that this is
2023 * NOT short-circuited, meaning that if expressions are passed they are both evaluated.
2024 * Dispatches to the or method of the first argument if applicable.
2025 */
2026 or<T, U>(a: T, b: U): T | U;
2027 or<T>(a: T): <U>(b: U) => T | U;
2028 or<T extends { or?: ((...a: any[]) => any); }, U>(fn1: T, val2: U): T | U;
2029 or<T extends { or?: ((...a: any[]) => any); }>(fn1: T): <U>(val2: U) => T | U;
2030
2031 /**
2032 * Returns the result of applying the onFailure function to the value inside a failed promise.
2033 * This is useful for handling rejected promises inside function compositions.
2034 */
2035 otherwise<A, B>(onError: (error: any) => B | Promise<B>, promise: Promise<A>): Promise<B>;
2036 otherwise<A, B>(onError: (error: any) => B | Promise<B>): (promise: Promise<A>) => Promise<B>;
2037
2038 /**
2039 * Returns the result of "setting" the portion of the given data structure
2040 * focused by the given lens to the given value.
2041 */
2042 over<T>(lens: Lens, fn: Arity1Fn, value: T): T;
2043 over<T>(lens: Lens, fn: Arity1Fn, value: T[]): T[];
2044 over(lens: Lens, fn: Arity1Fn): <T>(value: T) => T;
2045 over(lens: Lens, fn: Arity1Fn): <T>(value: T[]) => T[];
2046 over(lens: Lens): <T>(fn: Arity1Fn, value: T) => T;
2047 over(lens: Lens): <T>(fn: Arity1Fn, value: T[]) => T[];
2048
2049 /**
2050 * Takes two arguments, fst and snd, and returns [fst, snd].
2051 */
2052 pair<F, S>(fst: F, snd: S): [F, S];
2053
2054 /**
2055 * Takes a function `f` and a list of arguments, and returns a function `g`.
2056 * When applied, `g` returns the result of applying `f` to the arguments
2057 * provided initially followed by the arguments provided to `g`.
2058 */
2059 partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V0]): (x1: V1) => T;
2060
2061 partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0, V1]): (x2: V2) => T;
2062 partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0]): (x1: V1, x2: V2) => T;
2063
2064 partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0, V1, V2]): (x2: V3) => T;
2065 partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0, V1]): (x2: V2, x3: V3) => T;
2066 partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0]): (x1: V1, x2: V2, x3: V3) => T;
2067
2068 partial<T>(fn: (...a: any[]) => T, args: any[]): (...a: any[]) => T;
2069
2070 /**
2071 * Takes a function `f` and a list of arguments, and returns a function `g`.
2072 * When applied, `g` returns the result of applying `f` to the arguments
2073 * provided to `g` followed by the arguments provided initially.
2074 */
2075 partialRight<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V1]): (x1: V0) => T;
2076
2077 partialRight<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V1, V2]): (x2: V0) => T;
2078 partialRight<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V2]): (x1: V0, x2: V1) => T;
2079
2080 partialRight<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V1, V2, V3]): (x0: V0) => T;
2081 partialRight<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V2, V3]): (x0: V0, x1: V1) => T;
2082 partialRight<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V3]): (x0: V0, x1: V1, x2: V2) => T;
2083
2084 partialRight<T>(fn: (...a: any[]) => T, args: any[]): (...a: any[]) => T;
2085
2086 /**
2087 * Takes a predicate and a list and returns the pair of lists of elements
2088 * which do and do not satisfy the predicate, respectively.
2089 */
2090 partition(fn: (a: string) => boolean, list: ReadonlyArray<string>): [string[], string[]];
2091 partition<T>(fn: (a: T) => boolean, list: ReadonlyArray<T>): [T[], T[]];
2092 partition<T>(fn: (a: T) => boolean): (list: ReadonlyArray<T>) => [T[], T[]];
2093 partition(fn: (a: string) => boolean): (list: ReadonlyArray<string>) => [string[], string[]];
2094
2095 /**
2096 * Retrieve the value at a given path.
2097 */
2098 path<T>(path: Path, obj: any): T | undefined;
2099 path<T>(path: Path): (obj: any) => T | undefined;
2100
2101 /**
2102 * Determines whether a nested path on an object has a specific value,
2103 * in `R.equals` terms. Most likely used to filter a list.
2104 */
2105 pathEq(path: Path, val: any, obj: any): boolean;
2106 pathEq(path: Path, val: any): (obj: any) => boolean;
2107 pathEq(path: Path): Curry.Curry<(a: any, b: any) => boolean>;
2108
2109 /**
2110 * If the given, non-null object has a value at the given path, returns the value at that path.
2111 * Otherwise returns the provided default value.
2112 */
2113 pathOr<T>(defaultValue: T, path: Path, obj: any): any;
2114 pathOr<T>(defaultValue: T, path: Path): (obj: any) => any;
2115 pathOr<T>(defaultValue: T): Curry.Curry<(a: Path, b: any) => any>;
2116
2117 /**
2118 * Returns true if the specified object property at given path satisfies the given predicate; false otherwise.
2119 */
2120 pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path, obj: U): boolean;
2121 pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path): (obj: U) => boolean;
2122 pathSatisfies<T, U>(pred: (val: T) => boolean): Curry.Curry<(a: Path, b: U) => boolean>;
2123
2124 /**
2125 * Returns a partial copy of an object containing only the keys specified. If the key does not exist, the
2126 * property is ignored.
2127 */
2128 pick<T, K extends string>(names: ReadonlyArray<K>, obj: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
2129 pick<K extends string>(names: ReadonlyArray<K>): <T>(obj: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
2130
2131 /**
2132 * Similar to `pick` except that this one includes a `key: undefined` pair for properties that don't exist.
2133 */
2134 pickAll<T, U>(names: ReadonlyArray<string>, obj: T): U;
2135 pickAll(names: ReadonlyArray<string>): <T, U>(obj: T) => U;
2136
2137 /**
2138 * Returns a partial copy of an object containing only the keys that satisfy the supplied predicate.
2139 */
2140 pickBy<T, U>(pred: ObjPred, obj: T): U;
2141 pickBy(pred: ObjPred): <T, U>(obj: T) => U;
2142
2143 /**
2144 * Creates a new function that runs each of the functions supplied as parameters in turn,
2145 * passing the return value of each function invocation to the next function invocation,
2146 * beginning with whatever arguments were passed to the initial invocation.
2147 */
2148 pipe<T1>(fn0: () => T1): () => T1;
2149 pipe<V0, T1>(fn0: (x0: V0) => T1): (x0: V0) => T1;
2150 pipe<V0, V1, T1>(fn0: (x0: V0, x1: V1) => T1): (x0: V0, x1: V1) => T1;
2151 pipe<V0, V1, V2, T1>(fn0: (x0: V0, x1: V1, x2: V2) => T1): (x0: V0, x1: V1, x2: V2) => T1;
2152
2153 pipe<T1, T2>(fn0: () => T1, fn1: (x: T1) => T2): () => T2;
2154 pipe<V0, T1, T2>(fn0: (x0: V0) => T1, fn1: (x: T1) => T2): (x0: V0) => T2;
2155 pipe<V0, V1, T1, T2>(fn0: (x0: V0, x1: V1) => T1, fn1: (x: T1) => T2): (x0: V0, x1: V1) => T2;
2156 pipe<V0, V1, V2, T1, T2>(fn0: (x0: V0, x1: V1, x2: V2) => T1, fn1: (x: T1) => T2): (x0: V0, x1: V1, x2: V2) => T2;
2157
2158 pipe<T1, T2, T3>(fn0: () => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3): () => T3;
2159 pipe<V0, T1, T2, T3>(fn0: (x: V0) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3): (x: V0) => T3;
2160 pipe<V0, V1, T1, T2, T3>(fn0: (x0: V0, x1: V1) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3): (x0: V0, x1: V1) => T3;
2161 pipe<V0, V1, V2, T1, T2, T3>(fn0: (x0: V0, x1: V1, x2: V2) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3): (x0: V0, x1: V1, x2: V2) => T3;
2162
2163 pipe<T1, T2, T3, T4>(fn0: () => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4): () => T4;
2164 pipe<V0, T1, T2, T3, T4>(fn0: (x: V0) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4): (x: V0) => T4;
2165 pipe<V0, V1, T1, T2, T3, T4>(fn0: (x0: V0, x1: V1) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4): (x0: V0, x1: V1) => T4;
2166 pipe<V0, V1, V2, T1, T2, T3, T4>(fn0: (x0: V0, x1: V1, x2: V2) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4): (x0: V0, x1: V1, x2: V2) => T4;
2167
2168 pipe<T1, T2, T3, T4, T5>(fn0: () => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5): () => T5;
2169 pipe<V0, T1, T2, T3, T4, T5>(fn0: (x: V0) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5): (x: V0) => T5;
2170 pipe<V0, V1, T1, T2, T3, T4, T5>(fn0: (x0: V0, x1: V1) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5): (x0: V0, x1: V1) => T5;
2171 pipe<V0, V1, V2, T1, T2, T3, T4, T5>(fn0: (x0: V0, x1: V1, x2: V2) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5): (x0: V0, x1: V1, x2: V2) => T5;
2172
2173 pipe<T1, T2, T3, T4, T5, T6>(fn0: () => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5, fn5: (x: T5) => T6): () => T6;
2174 pipe<V0, T1, T2, T3, T4, T5, T6>(fn0: (x: V0) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5, fn5: (x: T5) => T6): (x: V0) => T6;
2175 pipe<V0, V1, T1, T2, T3, T4, T5, T6>(fn0: (x0: V0, x1: V1) => T1, fn1: (x: T1) => T2, fn2: (x: T2) => T3, fn3: (x: T3) => T4, fn4: (x: T4) => T5, fn5: (x: T5) => T6): (x0: V0, x1: V1) => T6;
2176 pipe<V0, V1, V2, T1, T2, T3, T4, T5, T6>(
2177 fn0: (x0: V0, x1: V1, x2: V2) => T1,
2178 fn1: (x: T1) => T2,
2179 fn2: (x: T2) => T3,
2180 fn3: (x: T3) => T4,
2181 fn4: (x: T4) => T5,
2182 fn5: (x: T5) => T6): (x0: V0, x1: V1, x2: V2) => T6;
2183
2184 pipe<T1, T2, T3, T4, T5, T6, T7>(
2185 fn0: () => T1,
2186 fn1: (x: T1) => T2,
2187 fn2: (x: T2) => T3,
2188 fn3: (x: T3) => T4,
2189 fn4: (x: T4) => T5,
2190 fn5: (x: T5) => T6,
2191 fn: (x: T6) => T7): () => T7;
2192 pipe<V0, T1, T2, T3, T4, T5, T6, T7>(
2193 fn0: (x: V0) => T1,
2194 fn1: (x: T1) => T2,
2195 fn2: (x: T2) => T3,
2196 fn3: (x: T3) => T4,
2197 fn4: (x: T4) => T5,
2198 fn5: (x: T5) => T6,
2199 fn: (x: T6) => T7): (x: V0) => T7;
2200 pipe<V0, V1, T1, T2, T3, T4, T5, T6, T7>(
2201 fn0: (x0: V0, x1: V1) => T1,
2202 fn1: (x: T1) => T2,
2203 fn2: (x: T2) => T3,
2204 fn3: (x: T3) => T4,
2205 fn4: (x: T4) => T5,
2206 fn5: (x: T5) => T6,
2207 fn6: (x: T6) => T7): (x0: V0, x1: V1) => T7;
2208 pipe<V0, V1, V2, T1, T2, T3, T4, T5, T6, T7>(
2209 fn0: (x0: V0, x1: V1, x2: V2) => T1,
2210 fn1: (x: T1) => T2,
2211 fn2: (x: T2) => T3,
2212 fn3: (x: T3) => T4,
2213 fn4: (x: T4) => T5,
2214 fn5: (x: T5) => T6,
2215 fn6: (x: T6) => T7): (x0: V0, x1: V1, x2: V2) => T7;
2216
2217 pipe<T1, T2, T3, T4, T5, T6, T7, T8>(
2218 fn0: () => T1,
2219 fn1: (x: T1) => T2,
2220 fn2: (x: T2) => T3,
2221 fn3: (x: T3) => T4,
2222 fn4: (x: T4) => T5,
2223 fn5: (x: T5) => T6,
2224 fn6: (x: T6) => T7,
2225 fn: (x: T7) => T8): () => T8;
2226 pipe<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
2227 fn0: (x: V0) => T1,
2228 fn1: (x: T1) => T2,
2229 fn2: (x: T2) => T3,
2230 fn3: (x: T3) => T4,
2231 fn4: (x: T4) => T5,
2232 fn5: (x: T5) => T6,
2233 fn6: (x: T6) => T7,
2234 fn: (x: T7) => T8): (x: V0) => T8;
2235 pipe<V0, V1, T1, T2, T3, T4, T5, T6, T7, T8>(
2236 fn0: (x0: V0, x1: V1) => T1,
2237 fn1: (x: T1) => T2,
2238 fn2: (x: T2) => T3,
2239 fn3: (x: T3) => T4,
2240 fn4: (x: T4) => T5,
2241 fn5: (x: T5) => T6,
2242 fn6: (x: T6) => T7,
2243 fn7: (x: T7) => T8): (x0: V0, x1: V1) => T8;
2244 pipe<V0, V1, V2, T1, T2, T3, T4, T5, T6, T7, T8>(
2245 fn0: (x0: V0, x1: V1, x2: V2) => T1,
2246 fn1: (x: T1) => T2,
2247 fn2: (x: T2) => T3,
2248 fn3: (x: T3) => T4,
2249 fn4: (x: T4) => T5,
2250 fn5: (x: T5) => T6,
2251 fn6: (x: T6) => T7,
2252 fn7: (x: T7) => T8): (x0: V0, x1: V1, x2: V2) => T8;
2253
2254 pipe<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2255 fn0: () => T1,
2256 fn1: (x: T1) => T2,
2257 fn2: (x: T2) => T3,
2258 fn3: (x: T3) => T4,
2259 fn4: (x: T4) => T5,
2260 fn5: (x: T5) => T6,
2261 fn6: (x: T6) => T7,
2262 fn7: (x: T7) => T8,
2263 fn8: (x: T8) => T9): () => T9;
2264 pipe<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2265 fn0: (x0: V0) => T1,
2266 fn1: (x: T1) => T2,
2267 fn2: (x: T2) => T3,
2268 fn3: (x: T3) => T4,
2269 fn4: (x: T4) => T5,
2270 fn5: (x: T5) => T6,
2271 fn6: (x: T6) => T7,
2272 fn7: (x: T7) => T8,
2273 fn8: (x: T8) => T9): (x0: V0) => T9;
2274 pipe<V0, V1, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2275 fn0: (x0: V0, x1: V1) => T1,
2276 fn1: (x: T1) => T2,
2277 fn2: (x: T2) => T3,
2278 fn3: (x: T3) => T4,
2279 fn4: (x: T4) => T5,
2280 fn5: (x: T5) => T6,
2281 fn6: (x: T6) => T7,
2282 fn7: (x: T7) => T8,
2283 fn8: (x: T8) => T9): (x0: V0, x1: V1) => T9;
2284 pipe<V0, V1, V2, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2285 fn0: (x0: V0, x1: V1, x2: V2) => T1,
2286 fn1: (x: T1) => T2,
2287 fn2: (x: T2) => T3,
2288 fn3: (x: T3) => T4,
2289 fn4: (x: T4) => T5,
2290 fn5: (x: T5) => T6,
2291 fn6: (x: T6) => T7,
2292 fn7: (x: T7) => T8,
2293 fn8: (x: T8) => T9): (x0: V0, x1: V1, x2: V2) => T9;
2294
2295 pipe<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
2296 fn0: () => T1,
2297 fn1: (x: T1) => T2,
2298 fn2: (x: T2) => T3,
2299 fn3: (x: T3) => T4,
2300 fn4: (x: T4) => T5,
2301 fn5: (x: T5) => T6,
2302 fn6: (x: T6) => T7,
2303 fn7: (x: T7) => T8,
2304 fn8: (x: T8) => T9,
2305 fn9: (x: T9) => T10): () => T10;
2306 pipe<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
2307 fn0: (x0: V0) => T1,
2308 fn1: (x: T1) => T2,
2309 fn2: (x: T2) => T3,
2310 fn3: (x: T3) => T4,
2311 fn4: (x: T4) => T5,
2312 fn5: (x: T5) => T6,
2313 fn6: (x: T6) => T7,
2314 fn7: (x: T7) => T8,
2315 fn8: (x: T8) => T9,
2316 fn9: (x: T9) => T10): (x0: V0) => T10;
2317 pipe<V0, V1, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
2318 fn0: (x0: V0, x1: V1) => T1,
2319 fn1: (x: T1) => T2,
2320 fn2: (x: T2) => T3,
2321 fn3: (x: T3) => T4,
2322 fn4: (x: T4) => T5,
2323 fn5: (x: T5) => T6,
2324 fn6: (x: T6) => T7,
2325 fn7: (x: T7) => T8,
2326 fn8: (x: T8) => T9,
2327 fn9: (x: T9) => T10): (x0: V0, x1: V1) => T10;
2328 pipe<V0, V1, V2, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
2329 fn0: (x0: V0, x1: V1, x2: V2) => T1,
2330 fn1: (x: T1) => T2,
2331 fn2: (x: T2) => T3,
2332 fn3: (x: T3) => T4,
2333 fn4: (x: T4) => T5,
2334 fn5: (x: T5) => T6,
2335 fn6: (x: T6) => T7,
2336 fn7: (x: T7) => T8,
2337 fn8: (x: T8) => T9,
2338 fn9: (x: T9) => T10): (x0: V0, x1: V1, x2: V2) => T10;
2339
2340 /**
2341 * Returns the left-to-right Kleisli composition of the provided functions, each of which must return a value of a type supported by chain.
2342 * The typings currently support arrays only as return values.
2343 * All functions need to be unary.
2344 * R.pipeK(f, g, h) is equivalent to R.pipe(f, R.chain(g), R.chain(h)).
2345 *
2346 * @deprecated since 0.26 in favor of pipeWith(chain)
2347 */
2348 pipeK<V0, T1>(
2349 fn0: (x0: V0) => T1[]): (x0: V0) => T1[];
2350 pipeK<V0, T1, T2>(
2351 fn0: (x0: V0) => T1[],
2352 fn1: (x: T1) => T2[]): (x0: V0) => T2[];
2353 pipeK<V0, T1, T2, T3>(
2354 fn0: (x: V0) => T1[],
2355 fn1: (x: T1) => T2[],
2356 fn2: (x: T2) => T3[]): (x: V0) => T3[];
2357 pipeK<V0, T1, T2, T3, T4>(
2358 fn0: (x: V0) => T1[],
2359 fn1: (x: T1) => T2[],
2360 fn2: (x: T2) => T3[],
2361 fn3: (x: T3) => T4[]): (x: V0) => T4[];
2362 pipeK<V0, T1, T2, T3, T4, T5>(
2363 fn0: (x: V0) => T1[],
2364 fn1: (x: T1) => T2[],
2365 fn2: (x: T2) => T3[],
2366 fn3: (x: T3) => T4[],
2367 fn4: (x: T4) => T5[]): (x: V0) => T5[];
2368 pipeK<V0, T1, T2, T3, T4, T5, T6>(
2369 fn0: (x: V0) => T1[],
2370 fn1: (x: T1) => T2[],
2371 fn2: (x: T2) => T3[],
2372 fn3: (x: T3) => T4[],
2373 fn4: (x: T4) => T5[],
2374 fn5: (x: T5) => T6[]): (x: V0) => T6[];
2375 pipeK<V0, T1, T2, T3, T4, T5, T6, T7>(
2376 fn0: (x: V0) => T1[],
2377 fn1: (x: T1) => T2[],
2378 fn2: (x: T2) => T3[],
2379 fn3: (x: T3) => T4[],
2380 fn4: (x: T4) => T5[],
2381 fn5: (x: T5) => T6[],
2382 fn: (x: T6) => T7[]): (x: V0) => T7[];
2383 pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
2384 fn0: (x: V0) => T1[],
2385 fn1: (x: T1) => T2[],
2386 fn2: (x: T2) => T3[],
2387 fn3: (x: T3) => T4[],
2388 fn4: (x: T4) => T5[],
2389 fn5: (x: T5) => T6[],
2390 fn6: (x: T6) => T7[],
2391 fn: (x: T7) => T8[]): (x: V0) => T8[];
2392 pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2393 fn0: (x0: V0) => T1[],
2394 fn1: (x: T1) => T2[],
2395 fn2: (x: T2) => T3[],
2396 fn3: (x: T3) => T4[],
2397 fn4: (x: T4) => T5[],
2398 fn5: (x: T5) => T6[],
2399 fn6: (x: T6) => T7[],
2400 fn7: (x: T7) => T8[],
2401 fn8: (x: T8) => T9[]): (x0: V0) => T9[];
2402 pipeK<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
2403 fn0: (x0: V0) => T1[],
2404 fn1: (x: T1) => T2[],
2405 fn2: (x: T2) => T3[],
2406 fn3: (x: T3) => T4[],
2407 fn4: (x: T4) => T5[],
2408 fn5: (x: T5) => T6[],
2409 fn6: (x: T6) => T7[],
2410 fn7: (x: T7) => T8[],
2411 fn8: (x: T8) => T9[],
2412 fn9: (x: T9) => T10[]): (x0: V0) => T10[];
2413
2414 /**
2415 * Performs left-to-right composition of one or more Promise-returning functions.
2416 * All functions need to be unary.
2417 *
2418 * @deprecated since 0.26 in favor of pipeWith(then)
2419 */
2420 pipeP<V0, T1>(
2421 fn0: (x0: V0) => Promise<T1>): (x0: V0) => Promise<T1>;
2422 pipeP<V0, T1, T2>(
2423 fn0: (x0: V0) => Promise<T1>,
2424 fn1: (x: T1) => Promise<T2>): (x0: V0) => Promise<T2>;
2425 pipeP<V0, T1, T2, T3>(
2426 fn0: (x: V0) => Promise<T1>,
2427 fn1: (x: T1) => Promise<T2>,
2428 fn2: (x: T2) => Promise<T3>): (x: V0) => Promise<T3>;
2429 pipeP<V0, T1, T2, T3, T4>(
2430 fn0: (x: V0) => Promise<T1>,
2431 fn1: (x: T1) => Promise<T2>,
2432 fn2: (x: T2) => Promise<T3>,
2433 fn3: (x: T3) => Promise<T4>): (x: V0) => Promise<T4>;
2434 pipeP<V0, T1, T2, T3, T4, T5>(
2435 fn0: (x: V0) => Promise<T1>,
2436 fn1: (x: T1) => Promise<T2>,
2437 fn2: (x: T2) => Promise<T3>,
2438 fn3: (x: T3) => Promise<T4>,
2439 fn4: (x: T4) => Promise<T5>): (x: V0) => Promise<T5>;
2440 pipeP<V0, T1, T2, T3, T4, T5, T6>(
2441 fn0: (x: V0) => Promise<T1>,
2442 fn1: (x: T1) => Promise<T2>,
2443 fn2: (x: T2) => Promise<T3>,
2444 fn3: (x: T3) => Promise<T4>,
2445 fn4: (x: T4) => Promise<T5>,
2446 fn5: (x: T5) => Promise<T6>): (x: V0) => Promise<T6>;
2447 pipeP<V0, T1, T2, T3, T4, T5, T6, T7>(
2448 fn0: (x: V0) => Promise<T1>,
2449 fn1: (x: T1) => Promise<T2>,
2450 fn2: (x: T2) => Promise<T3>,
2451 fn3: (x: T3) => Promise<T4>,
2452 fn4: (x: T4) => Promise<T5>,
2453 fn5: (x: T5) => Promise<T6>,
2454 fn: (x: T6) => Promise<T7>): (x: V0) => Promise<T7>;
2455 pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8>(
2456 fn0: (x: V0) => Promise<T1>,
2457 fn1: (x: T1) => Promise<T2>,
2458 fn2: (x: T2) => Promise<T3>,
2459 fn3: (x: T3) => Promise<T4>,
2460 fn4: (x: T4) => Promise<T5>,
2461 fn5: (x: T5) => Promise<T6>,
2462 fn6: (x: T6) => Promise<T7>,
2463 fn: (x: T7) => Promise<T8>): (x: V0) => Promise<T8>;
2464 pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(
2465 fn0: (x0: V0) => Promise<T1>,
2466 fn1: (x: T1) => Promise<T2>,
2467 fn2: (x: T2) => Promise<T3>,
2468 fn3: (x: T3) => Promise<T4>,
2469 fn4: (x: T4) => Promise<T5>,
2470 fn5: (x: T5) => Promise<T6>,
2471 fn6: (x: T6) => Promise<T7>,
2472 fn7: (x: T7) => Promise<T8>,
2473 fn8: (x: T8) => Promise<T9>): (x0: V0) => Promise<T9>;
2474 pipeP<V0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
2475 fn0: (x0: V0) => Promise<T1>,
2476 fn1: (x: T1) => Promise<T2>,
2477 fn2: (x: T2) => Promise<T3>,
2478 fn3: (x: T3) => Promise<T4>,
2479 fn4: (x: T4) => Promise<T5>,
2480 fn5: (x: T5) => Promise<T6>,
2481 fn6: (x: T6) => Promise<T7>,
2482 fn7: (x: T7) => Promise<T8>,
2483 fn8: (x: T8) => Promise<T9>,
2484 fn9: (x: T9) => Promise<T10>): (x0: V0) => Promise<T10>;
2485
2486 /*
2487 * Performs left-to-right function composition using transforming function.
2488 * With the current typings, all functions must be unary.
2489 */
2490 pipeWith<V0, T>(composer: (a: any) => any, fns: PipeWithFns<V0, T>): (x0: V0) => T;
2491 pipeWith(composer: (a: any) => any): <V0, T>(fns: PipeWithFns<V0, T>) => (x0: V0) => T;
2492
2493 /**
2494 * Returns a new list by plucking the same named property off all objects in the list supplied.
2495 */
2496 pluck<K extends keyof T, T>(p: K, list: ReadonlyArray<T>): Array<T[K]>;
2497 pluck<T>(p: number, list: ReadonlyArray<{ [k: number]: T }>): T[];
2498 pluck<P extends string>(p: P): <T>(list: ReadonlyArray<Record<P, T>>) => T[];
2499 pluck(p: number): <T>(list: ReadonlyArray<{ [k: number]: T }>) => T[];
2500
2501 /**
2502 * Returns a new list with the given element at the front, followed by the contents of the
2503 * list.
2504 */
2505 prepend<T>(el: T, list: ReadonlyArray<T>): T[];
2506 prepend<T>(el: T): (list: ReadonlyArray<T>) => T[];
2507
2508 /**
2509 * Multiplies together all the elements of a list.
2510 */
2511 product(list: ReadonlyArray<number>): number;
2512
2513 /**
2514 * Reasonable analog to SQL `select` statement.
2515 */
2516 project<T, U>(props: ReadonlyArray<string>, objs: ReadonlyArray<T>): U[];
2517 project<T, U>(props: ReadonlyArray<string>): (objs: ReadonlyArray<T>) => U[];
2518
2519 /**
2520 * Returns a function that when supplied an object returns the indicated property of that object, if it exists.
2521 */
2522 prop<T>(__: Placeholder, obj: T): <P extends keyof T>(p: P) => T[P];
2523 prop<P extends keyof T, T>(p: P, obj: T): T[P];
2524 prop<P extends string>(p: P): <T>(obj: Record<P, T>) => T;
2525 prop<P extends string, T>(p: P): (obj: Record<P, T>) => T;
2526
2527 /**
2528 * Determines whether the given property of an object has a specific
2529 * value according to strict equality (`===`). Most likely used to
2530 * filter a list.
2531 */
2532 propEq<T>(name: string | number, val: T, obj: any): boolean;
2533 propEq<T>(name: string | number, val: T): (obj: any) => boolean;
2534 propEq(name: string | number): {
2535 <T>(val: T, obj: any): boolean;
2536 <T>(val: T): (obj: any) => boolean;
2537 };
2538
2539 /**
2540 * Returns true if the specified object property is of the given type; false otherwise.
2541 */
2542 propIs(type: any, name: string, obj: any): boolean;
2543 propIs(type: any, name: string): (obj: any) => boolean;
2544 propIs(type: any): {
2545 (name: string, obj: any): boolean;
2546 (name: string): (obj: any) => boolean;
2547 };
2548
2549 /**
2550 * If the given, non-null object has an own property with the specified name, returns the value of that property.
2551 * Otherwise returns the provided default value.
2552 */
2553 propOr<T, U>(val: T, __: Placeholder, obj: U): <V>(p: string) => V;
2554 propOr<U>(__: Placeholder, p: string, obj: U): <T, V>(val: T) => V;
2555 propOr<T, U, V>(val: T, p: string, obj: U): V;
2556 propOr<T>(val: T, p: string): <U, V>(obj: U) => V;
2557 propOr<T>(val: T): <U, V>(p: string, obj: U) => V;
2558
2559 /**
2560 * Returns the value at the specified property.
2561 * The only difference from `prop` is the parameter order.
2562 * Note: TS1.9 # replace any by dictionary
2563 */
2564 props<P extends string, T>(ps: ReadonlyArray<P>, obj: Record<P, T>): T[];
2565 props<P extends string>(ps: ReadonlyArray<P>): <T>(obj: Record<P, T>) => T[];
2566 props<P extends string, T>(ps: ReadonlyArray<P>): (obj: Record<P, T>) => T[];
2567
2568 /**
2569 * Returns true if the specified object property satisfies the given predicate; false otherwise.
2570 */
2571 propSatisfies<T, U>(pred: (val: T) => boolean, name: string, obj: U): boolean;
2572 propSatisfies<T, U>(pred: (val: T) => boolean, name: string): (obj: U) => boolean;
2573 propSatisfies<T, U>(pred: (val: T) => boolean): Curry.Curry<(a: string, b: U) => boolean>;
2574
2575 /**
2576 * Returns a list of numbers from `from` (inclusive) to `to`
2577 * (exclusive). In mathematical terms, `range(a, b)` is equivalent to
2578 * the half-open interval `[a, b)`.
2579 */
2580 range(from: number, to: number): number[];
2581 range(from: number): (to: number) => number[];
2582
2583 /**
2584 * Returns a single item by iterating through the list, successively calling the iterator
2585 * function and passing it an accumulator value and the current value from the array, and
2586 * then passing the result to the next call.
2587 */
2588 reduce<T, TResult>(fn: (acc: TResult, elem: T) => TResult | Reduced<TResult>, acc: TResult, list: ReadonlyArray<T>): TResult;
2589 reduce<T, TResult>(fn: (acc: TResult, elem: T) => TResult | Reduced<TResult>): (acc: TResult, list: ReadonlyArray<T>) => TResult;
2590 reduce<T, TResult>(fn: (acc: TResult, elem: T) => TResult | Reduced<TResult>, acc: TResult): (list: ReadonlyArray<T>) => TResult;
2591
2592 /**
2593 * Groups the elements of the list according to the result of calling the String-returning function keyFn on each
2594 * element and reduces the elements of each group to a single value via the reducer function valueFn.
2595 */
2596 reduceBy<T, TResult>(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult, keyFn: (elem: T) => string, list: ReadonlyArray<T>): { [index: string]: TResult };
2597 reduceBy<T, TResult>(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult, keyFn: (elem: T) => string): (list: ReadonlyArray<T>) => { [index: string]: TResult };
2598 reduceBy<T, TResult>(valueFn: (acc: TResult, elem: T) => TResult, acc: TResult): Curry.Curry<(a: (elem: T) => string, b: ReadonlyArray<T>) => { [index: string]: TResult }>;
2599 reduceBy<T, TResult>(valueFn: (acc: TResult, elem: T) => TResult): Curry.Curry<(a: TResult, b: (elem: T) => string, c: ReadonlyArray<T>) => { [index: string]: TResult }>;
2600
2601 /**
2602 * Returns a value wrapped to indicate that it is the final value of the reduce and
2603 * transduce functions. The returned value should be considered a black box: the internal
2604 * structure is not guaranteed to be stable.
2605 */
2606 reduced<T>(elem: T): Reduced<T>;
2607
2608 /**
2609 * Returns a single item by iterating through the list, successively calling the iterator
2610 * function and passing it an accumulator value and the current value from the array, and
2611 * then passing the result to the next call.
2612 */
2613 reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult, acc: TResult, list: ReadonlyArray<T>): TResult;
2614 reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult): (acc: TResult, list: ReadonlyArray<T>) => TResult;
2615 reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult, acc: TResult): (list: ReadonlyArray<T>) => TResult;
2616
2617 /**
2618 * Like reduce, reduceWhile returns a single item by iterating through the list, successively
2619 * calling the iterator function. reduceWhile also takes a predicate that is evaluated before
2620 * each step. If the predicate returns false, it "short-circuits" the iteration and returns
2621 * the current value of the accumulator.
2622 */
2623 reduceWhile<T, TResult>(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult, acc: TResult, list: ReadonlyArray<T>): TResult;
2624 reduceWhile<T, TResult>(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult, acc: TResult): (list: ReadonlyArray<T>) => TResult;
2625 reduceWhile<T, TResult>(predicate: (acc: TResult, elem: T) => boolean, fn: (acc: TResult, elem: T) => TResult): Curry.Curry<(a: TResult, b: ReadonlyArray<T>) => TResult>;
2626 reduceWhile<T, TResult>(predicate: (acc: TResult, elem: T) => boolean): Curry.Curry<(a: (acc: TResult, elem: T) => TResult, b: TResult, c: ReadonlyArray<T>) => TResult>;
2627
2628 /**
2629 * Similar to `filter`, except that it keeps only values for which the given predicate
2630 * function returns falsy.
2631 */
2632 reject: Filter;
2633
2634 /**
2635 * Removes the sub-list of `list` starting at index `start` and containing `count` elements.
2636 */
2637 remove<T>(start: number, count: number, list: ReadonlyArray<T>): T[];
2638 remove<T>(start: number): (count: number, list: ReadonlyArray<T>) => T[];
2639 remove<T>(start: number, count: number): (list: ReadonlyArray<T>) => T[];
2640
2641 /**
2642 * Returns a fixed list of size n containing a specified identical value.
2643 */
2644 repeat<T>(a: T, n: number): T[];
2645 repeat<T>(a: T): (n: number) => T[];
2646
2647 /**
2648 * Replace a substring or regex match in a string with a replacement.
2649 */
2650 replace(pattern: RegExp | string, replacement: string | ((match: string, ...args: any[]) => string), str: string): string;
2651 replace(pattern: RegExp | string, replacement: string | ((match: string, ...args: any[]) => string)): (str: string) => string;
2652 replace(pattern: RegExp | string): (replacement: string | ((match: string, ...args: any[]) => string)) => (str: string) => string;
2653
2654 /**
2655 * Returns a new list with the same elements as the original list, just in the reverse order.
2656 */
2657 reverse<T>(list: ReadonlyArray<T>): T[];
2658 /**
2659 * Returns a new string with the characters in reverse order.
2660 */
2661 reverse(str: string): string;
2662
2663 /**
2664 * Scan is similar to reduce, but returns a list of successively reduced values from the left.
2665 */
2666 scan<T, TResult>(fn: (acc: TResult, elem: T) => any, acc: TResult, list: ReadonlyArray<T>): TResult[];
2667 scan<T, TResult>(fn: (acc: TResult, elem: T) => any, acc: TResult): (list: ReadonlyArray<T>) => TResult[];
2668 scan<T, TResult>(fn: (acc: TResult, elem: T) => any): (acc: TResult, list: ReadonlyArray<T>) => TResult[];
2669
2670 /**
2671 * Returns the result of "setting" the portion of the given data structure focused by the given lens to the
2672 * given value.
2673 */
2674 set<T, U>(lens: Lens, a: U, obj: T): T;
2675 set<U>(lens: Lens, a: U): <T>(obj: T) => T;
2676 set(lens: Lens): <T, U>(a: U, obj: T) => T;
2677
2678 /**
2679 * Returns the elements from `xs` starting at `a` and ending at `b - 1`.
2680 */
2681 slice(a: number, b: number, list: string): string;
2682 slice<T>(a: number, b: number, list: ReadonlyArray<T>): T[];
2683 slice(a: number, b: number): {
2684 (list: string): string;
2685 <T>(list: ReadonlyArray<T>): T[];
2686 };
2687 slice(a: number): {
2688 (b: number, list: string): string;
2689 <T>(b: number, list: ReadonlyArray<T>): T[];
2690 };
2691
2692 /**
2693 * Returns a copy of the list, sorted according to the comparator function, which should accept two values at a
2694 * time and return a negative number if the first value is smaller, a positive number if it's larger, and zero
2695 * if they are equal.
2696 */
2697 sort<T>(fn: (a: T, b: T) => number, list: ReadonlyArray<T>): T[];
2698 sort<T>(fn: (a: T, b: T) => number): (list: ReadonlyArray<T>) => T[];
2699
2700 /**
2701 * Sorts the list according to a key generated by the supplied function.
2702 */
2703 sortBy<T>(fn: (a: T) => Ord, list: ReadonlyArray<T>): T[];
2704 sortBy(fn: (a: any) => Ord): <T>(list: ReadonlyArray<T>) => T[];
2705
2706 /**
2707 * Sorts a list according to a list of comparators.
2708 */
2709 sortWith<T>(fns: ReadonlyArray<((a: T, b: T) => number)>, list: ReadonlyArray<T>): T[];
2710 sortWith<T>(fns: ReadonlyArray<((a: T, b: T) => number)>): (list: ReadonlyArray<T>) => T[];
2711
2712 /**
2713 * Splits a string into an array of strings based on the given
2714 * separator.
2715 */
2716 split(sep: string | RegExp): (str: string) => string[];
2717 split(sep: string | RegExp, str: string): string[];
2718
2719 /**
2720 * Splits a given list or string at a given index.
2721 */
2722 splitAt<T>(index: number, list: ReadonlyArray<T>): [T[], T[]];
2723 splitAt(index: number, list: string): [string, string];
2724 splitAt(index: number): {
2725 <T>(list: ReadonlyArray<T>): [T[], T[]];
2726 (list: string): [string, string];
2727 };
2728
2729 /**
2730 * Splits a collection into slices of the specified length.
2731 */
2732 splitEvery<T>(a: number, list: ReadonlyArray<T>): T[][];
2733 splitEvery(a: number, list: string): string[];
2734 splitEvery(a: number): {
2735 (list: string): string[];
2736 <T>(list: ReadonlyArray<T>): T[][];
2737 };
2738
2739 /**
2740 * Takes a list and a predicate and returns a pair of lists with the following properties:
2741 * - the result of concatenating the two output lists is equivalent to the input list;
2742 * - none of the elements of the first output list satisfies the predicate; and
2743 * - if the second output list is non-empty, its first element satisfies the predicate.
2744 */
2745 splitWhen<T, U>(pred: (val: T) => boolean, list: ReadonlyArray<U>): U[][];
2746 splitWhen<T>(pred: (val: T) => boolean): <U>(list: ReadonlyArray<U>) => U[][];
2747
2748 /**
2749 * Checks if a list starts with the provided values
2750 */
2751 startsWith(a: string, list: string): boolean;
2752 startsWith(a: string): (list: string) => boolean;
2753 startsWith<T>(a: T | ReadonlyArray<T>, list: ReadonlyArray<T>): boolean;
2754 startsWith<T>(a: T | ReadonlyArray<T>): (list: ReadonlyArray<T>) => boolean;
2755
2756 /**
2757 * Subtracts two numbers. Equivalent to `a - b` but curried.
2758 */
2759 subtract(__: Placeholder, b: number): (a: number) => number;
2760 subtract(__: Placeholder): (b: number, a: number) => number;
2761 subtract(a: number, b: number): number;
2762 subtract(a: number): (b: number) => number;
2763
2764 /**
2765 * Adds together all the elements of a list.
2766 */
2767 sum(list: ReadonlyArray<number>): number;
2768
2769 /**
2770 * Finds the set (i.e. no duplicates) of all elements contained in the first or second list, but not both.
2771 */
2772 symmetricDifference<T>(list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
2773 symmetricDifference<T>(list: ReadonlyArray<T>): <T>(list: ReadonlyArray<T>) => T[];
2774
2775 /**
2776 * Finds the set (i.e. no duplicates) of all elements contained in the first or second list, but not both.
2777 * Duplication is determined according to the value returned by applying the supplied predicate to two list elements.
2778 */
2779 symmetricDifferenceWith<T>(pred: (a: T, b: T) => boolean, list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
2780 symmetricDifferenceWith<T>(pred: (a: T, b: T) => boolean): Curry.Curry<(a: ReadonlyArray<T>, b: ReadonlyArray<T>) => T[]>;
2781
2782 /**
2783 * A function that always returns true. Any passed in parameters are ignored.
2784 */
2785 T(): boolean;
2786
2787 /**
2788 * Returns all but the first element of a list or string.
2789 */
2790 tail<T>(list: ReadonlyArray<T>): T[];
2791 tail(list: string): string;
2792
2793 /**
2794 * Returns a new list containing the first `n` elements of the given list. If
2795 * `n > * list.length`, returns a list of `list.length` elements.
2796 */
2797 take<T>(n: number, xs: ReadonlyArray<T>): T[];
2798 take(n: number, xs: string): string;
2799 take<T>(n: number): {
2800 (xs: string): string;
2801 (xs: ReadonlyArray<T>): T[];
2802 };
2803
2804 /**
2805 * Returns a new list containing the last n elements of the given list. If n > list.length,
2806 * returns a list of list.length elements.
2807 */
2808 takeLast<T>(n: number, xs: ReadonlyArray<T>): T[];
2809 takeLast(n: number, xs: string): string;
2810 takeLast(n: number): {
2811 <T>(xs: ReadonlyArray<T>): T[];
2812 (xs: string): string;
2813 };
2814
2815 /**
2816 * Returns a new list containing the last n elements of a given list, passing each value
2817 * to the supplied predicate function, and terminating when the predicate function returns
2818 * false. Excludes the element that caused the predicate function to fail. The predicate
2819 * function is passed one argument: (value).
2820 */
2821 takeLastWhile<T>(pred: (a: T) => boolean, list: ReadonlyArray<T>): T[];
2822 takeLastWhile<T>(pred: (a: T) => boolean): <T>(list: ReadonlyArray<T>) => T[];
2823
2824 /**
2825 * Returns a new list containing the first `n` elements of a given list, passing each value
2826 * to the supplied predicate function, and terminating when the predicate function returns
2827 * `false`.
2828 */
2829 takeWhile<T>(fn: (x: T) => boolean, list: ReadonlyArray<T>): T[];
2830 takeWhile<T>(fn: (x: T) => boolean): (list: ReadonlyArray<T>) => T[];
2831
2832 /**
2833 * The function to call with x. The return value of fn will be thrown away.
2834 */
2835 tap<T>(fn: (a: T) => any, value: T): T;
2836 tap<T>(fn: (a: T) => any): (value: T) => T;
2837
2838 /**
2839 * Determines whether a given string matches a given regular expression.
2840 */
2841 test(regexp: RegExp, str: string): boolean;
2842 test(regexp: RegExp): (str: string) => boolean;
2843
2844 /**
2845 * Returns the result of applying the onSuccess function to the value inside a successfully resolved promise. This is useful for working with promises inside function compositions.
2846 */
2847 then<A, B>(onSuccess: (a: A) => B | Promise<B>, promise: Promise<A>): Promise<B>;
2848 then<A, B>(onSuccess: (a: A) => B | Promise<B>): (promise: Promise<A>) => Promise<B>;
2849
2850 /**
2851 * Creates a thunk out of a function.
2852 * A thunk delays a calculation until its result is needed, providing lazy evaluation of arguments.
2853 */
2854 thunkify<F extends (...args: any[]) => any>(fn: F): Curry.Curry<(...args: Parameters<F>) => (() => ReturnType<F>)>;
2855
2856 /**
2857 * Calls an input function `n` times, returning an array containing the results of those
2858 * function calls.
2859 */
2860 times<T>(fn: (i: number) => T, n: number): T[];
2861 times<T>(fn: (i: number) => T): (n: number) => T[];
2862
2863 /**
2864 * The lower case version of a string.
2865 */
2866 toLower(str: string): string;
2867
2868 /**
2869 * Converts an object into an array of key, value arrays.
2870 * Only the object's own properties are used.
2871 * Note that the order of the output array is not guaranteed to be
2872 * consistent across different JS platforms.
2873 */
2874 toPairs<S>(obj: { [k: string]: S } | { [k: number]: S }): Array<[string, S]>;
2875
2876 /**
2877 * Converts an object into an array of key, value arrays.
2878 * The object's own properties and prototype properties are used.
2879 * Note that the order of the output array is not guaranteed to be
2880 * consistent across different JS platforms.
2881 */
2882 toPairsIn<S>(obj: { [k: string]: S } | { [k: number]: S }): Array<[string, S]>;
2883
2884 /**
2885 * Returns the string representation of the given value. eval'ing the output should
2886 * result in a value equivalent to the input value. Many of the built-in toString
2887 * methods do not satisfy this requirement.
2888 *
2889 * If the given value is an [object Object] with a toString method other than
2890 * Object.prototype.toString, this method is invoked with no arguments to produce the
2891 * return value. This means user-defined constructor functions can provide a suitable
2892 * toString method.
2893 */
2894 toString<T>(val: T): string;
2895
2896 /**
2897 * The upper case version of a string.
2898 */
2899 toUpper(str: string): string;
2900
2901 /**
2902 * Initializes a transducer using supplied iterator function. Returns a single item by iterating through the
2903 * list, successively calling the transformed iterator function and passing it an accumulator value and the
2904 * current value from the array, and then passing the result to the next call.
2905 */
2906 transduce<T, U>(xf: (arg: T[]) => ReadonlyArray<T>, fn: (acc: U[], val: U) => ReadonlyArray<U>, acc: ReadonlyArray<T>, list: ReadonlyArray<T>): U;
2907 transduce<T, U>(xf: (arg: T[]) => ReadonlyArray<T>): (fn: (acc: U[], val: U) => ReadonlyArray<U>, acc: ReadonlyArray<T>, list: ReadonlyArray<T>) => U;
2908 transduce<T, U>(xf: (arg: T[]) => ReadonlyArray<T>, fn: (acc: U[], val: U) => ReadonlyArray<U>): (acc: ReadonlyArray<T>, list: ReadonlyArray<T>) => U;
2909 transduce<T, U>(xf: (arg: T[]) => ReadonlyArray<T>, fn: (acc: U[], val: U) => ReadonlyArray<U>, acc: ReadonlyArray<T>): (list: ReadonlyArray<T>) => U;
2910
2911 /**
2912 * Transposes the rows and columns of a 2D list. When passed a list of n lists of length x, returns a list of x lists of length n.
2913 */
2914 transpose<T>(list: ReadonlyArray<T[]>): T[][];
2915
2916 /**
2917 * Maps an Applicative-returning function over a Traversable, then uses
2918 * sequence to transform the resulting Traversable of Applicative into
2919 * an Applicative of Traversable.
2920 */
2921 traverse<A, B>(of: (a: B) => ReadonlyArray<B>, fn: (t: A) => ReadonlyArray<B>, list: ReadonlyArray<A>): B[][];
2922 traverse<A, B>(of: (a: B) => ReadonlyArray<B>, fn: (t: A) => ReadonlyArray<B>): (list: ReadonlyArray<A>) => B[][];
2923 traverse<A, B>(of: (a: B) => ReadonlyArray<B>): (fn: (t: A) => ReadonlyArray<B>, list: ReadonlyArray<A>) => B[][];
2924
2925 /**
2926 * Removes (strips) whitespace from both ends of the string.
2927 */
2928 trim(str: string): string;
2929
2930 /**
2931 * tryCatch takes two functions, a tryer and a catcher. The returned function evaluates the tryer; if it does
2932 * not throw, it simply returns the result. If the tryer does throw, the returned function evaluates the catcher
2933 * function and returns its result. Note that for effective composition with this function, both the tryer and
2934 * catcher functions must return the same type of results.
2935 */
2936 tryCatch<T>(tryer: (...args: any[]) => T, catcher: (...args: any[]) => T): (...args: any[]) => T;
2937
2938 /**
2939 * Gives a single-word string description of the (native) type of a value, returning such answers as 'Object',
2940 * 'Number', 'Array', or 'Null'. Does not attempt to distinguish user Object types any further, reporting them
2941 * all as 'Object'.
2942 */
2943 type(val: any): 'Object' | 'Number' | 'Boolean' | 'String' | 'Null' | 'Array' | 'RegExp' | 'Function' | 'Undefined';
2944
2945 /**
2946 * Takes a function fn, which takes a single array argument, and returns a function which:
2947 * - takes any number of positional arguments;
2948 * - passes these arguments to fn as an array; and
2949 * - returns the result.
2950 * In other words, R.unapply derives a variadic function from a function which takes an array.
2951 * R.unapply is the inverse of R.apply.
2952 */
2953 unapply<T>(fn: (args: any[]) => T): (...args: any[]) => T;
2954
2955 /**
2956 * Wraps a function of any arity (including nullary) in a function that accepts exactly 1 parameter.
2957 * Any extraneous parameters will not be passed to the supplied function.
2958 */
2959 unary<T>(fn: (a: T, ...args: any[]) => any): (a: T) => any;
2960
2961 /**
2962 * Returns a function of arity n from a (manually) curried function.
2963 */
2964 uncurryN<T>(len: number, fn: (a: any) => any): (...a: any[]) => T;
2965
2966 /**
2967 * Builds a list from a seed value. Accepts an iterator function, which returns either false
2968 * to stop iteration or an array of length 2 containing the value to add to the resulting
2969 * list and the seed to be used in the next call to the iterator function.
2970 */
2971 unfold<T, TResult>(fn: (seed: T) => [TResult, T] | false, seed: T): TResult[];
2972 unfold<T, TResult>(fn: (seed: T) => [TResult, T] | false): (seed: T) => TResult[];
2973
2974 /**
2975 * Combines two lists into a set (i.e. no duplicates) composed of the
2976 * elements of each list.
2977 */
2978 union<T>(as: ReadonlyArray<T>, bs: ReadonlyArray<T>): T[];
2979 union<T>(as: ReadonlyArray<T>): (bs: ReadonlyArray<T>) => T[];
2980
2981 /**
2982 * Combines two lists into a set (i.e. no duplicates) composed of the elements of each list. Duplication is
2983 * determined according to the value returned by applying the supplied predicate to two list elements.
2984 */
2985 unionWith<T>(pred: (a: T, b: T) => boolean, list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
2986 unionWith<T>(pred: (a: T, b: T) => boolean): Curry.Curry<(a: ReadonlyArray<T>, b: ReadonlyArray<T>) => T[]>;
2987
2988 /**
2989 * Returns a new list containing only one copy of each element in the original list.
2990 */
2991 uniq<T>(list: ReadonlyArray<T>): T[];
2992
2993 /**
2994 * Returns a new list containing only one copy of each element in the original list,
2995 * based upon the value returned by applying the supplied function to each list element.
2996 * Prefers the first item if the supplied function produces the same value on two items.
2997 * R.equals is used for comparison.
2998 */
2999 uniqBy<T, U>(fn: (a: T) => U, list: ReadonlyArray<T>): T[];
3000 uniqBy<T, U>(fn: (a: T) => U): (list: ReadonlyArray<T>) => T[];
3001
3002 /**
3003 * Returns a new list containing only one copy of each element in the original list, based upon the value
3004 * returned by applying the supplied predicate to two list elements.
3005 */
3006 uniqWith<T, U>(pred: (x: T, y: T) => boolean, list: ReadonlyArray<T>): T[];
3007 uniqWith<T, U>(pred: (x: T, y: T) => boolean): (list: ReadonlyArray<T>) => T[];
3008
3009 /**
3010 * Tests the final argument by passing it to the given predicate function. If the predicate is not satisfied,
3011 * the function will return the result of calling the whenFalseFn function with the same argument. If the
3012 * predicate is satisfied, the argument is returned as is.
3013 */
3014 unless<T, U>(pred: (a: T) => boolean, whenFalseFn: (a: T) => U, obj: T): U;
3015 unless<T, U>(pred: (a: T) => boolean, whenFalseFn: (a: T) => U): (obj: T) => U;
3016
3017 /**
3018 * Returns a new list by pulling every item at the first level of nesting out, and putting
3019 * them in a new array.
3020 */
3021 unnest<T>(x: ReadonlyArray<T[]> | ReadonlyArray<ReadonlyArray<T>> | ReadonlyArray<T>): T[];
3022
3023 /**
3024 * Takes a predicate, a transformation function, and an initial value, and returns a value of the same type as
3025 * the initial value. It does so by applying the transformation until the predicate is satisfied, at which point
3026 * it returns the satisfactory value.
3027 */
3028 until<T, U>(pred: (val: T) => boolean, fn: (val: T) => U, init: U): U;
3029 until<T, U>(pred: (val: T) => boolean, fn: (val: T) => U): (init: U) => U;
3030
3031 /**
3032 * Returns a new copy of the array with the element at the provided index replaced with the given value.
3033 */
3034 update<T>(index: number, value: T, list: ReadonlyArray<T>): T[];
3035 update<T>(index: number, value: T): (list: ReadonlyArray<T>) => T[];
3036
3037 /**
3038 * Accepts a function fn and a list of transformer functions and returns a new curried function.
3039 * When the new function is invoked, it calls the function fn with parameters consisting of the
3040 * result of calling each supplied handler on successive arguments to the new function.
3041 *
3042 * If more arguments are passed to the returned function than transformer functions, those arguments
3043 * are passed directly to fn as additional parameters. If you expect additional arguments that don't
3044 * need to be transformed, although you can ignore them, it's best to pass an identity function so
3045 * that the new function reports the correct arity.
3046 */
3047 useWith(fn: ((...a: any[]) => any), transformers: Array<((...a: any[]) => any)>): (...a: any[]) => any;
3048
3049 /**
3050 * Returns a list of all the enumerable own properties of the supplied object.
3051 * Note that the order of the output array is not guaranteed across
3052 * different JS platforms.
3053 */
3054 values<T extends object, K extends keyof T>(obj: T): Array<T[K]>;
3055
3056 /**
3057 * Returns a list of all the properties, including prototype properties, of the supplied
3058 * object. Note that the order of the output array is not guaranteed to be consistent across different JS platforms.
3059 */
3060 valuesIn<T>(obj: any): T[];
3061
3062 /**
3063 * Returns a "view" of the given data structure, determined by the given lens. The lens's focus determines which
3064 * portion of the data structure is visible.
3065 */
3066 view<T, U>(lens: Lens): (obj: T) => U;
3067 view<T, U>(lens: Lens, obj: T): U;
3068
3069 /**
3070 * Tests the final argument by passing it to the given predicate function. If the predicate is satisfied, the function
3071 * will return the result of calling the whenTrueFn function with the same argument. If the predicate is not satisfied,
3072 * the argument is returned as is.
3073 */
3074 when<T, U>(pred: (a: T) => boolean, whenTrueFn: (a: T) => U, obj: T): U;
3075 when<T, U>(pred: (a: T) => boolean, whenTrueFn: (a: T) => U): (obj: T) => U;
3076
3077 /**
3078 * Takes a spec object and a test object and returns true if the test satisfies the spec.
3079 * Any property on the spec that is not a function is interpreted as an equality
3080 * relation.
3081 *
3082 * If the spec has a property mapped to a function, then `where` evaluates the function, passing in
3083 * the test object's value for the property in question, as well as the whole test object.
3084 *
3085 * `where` is well suited to declarativley expressing constraints for other functions, e.g.,
3086 * `filter`, `find`, `pickWith`, etc.
3087 */
3088 where<T, U>(spec: T, testObj: U): boolean;
3089 where<T>(spec: T): <U>(testObj: U) => boolean;
3090 where<ObjFunc2, U>(spec: ObjFunc2, testObj: U): boolean;
3091 where<ObjFunc2>(spec: ObjFunc2): <U>(testObj: U) => boolean;
3092
3093 /**
3094 * Takes a spec object and a test object; returns true if the test satisfies the spec,
3095 * false otherwise. An object satisfies the spec if, for each of the spec's own properties,
3096 * accessing that property of the object gives the same value (in R.eq terms) as accessing
3097 * that property of the spec.
3098 */
3099 whereEq<T, U>(spec: T, obj: U): boolean;
3100 whereEq<T>(spec: T): <U>(obj: U) => boolean;
3101
3102 /**
3103 * Returns a new list without values in the first argument. R.equals is used to determine equality.
3104 * Acts as a transducer if a transformer is given in list position.
3105 */
3106 without<T>(list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
3107 without<T>(list1: ReadonlyArray<T>): (list2: ReadonlyArray<T>) => T[];
3108
3109 /**
3110 * Wrap a function inside another to allow you to make adjustments to the parameters, or do other processing
3111 * either before the internal function is called or with its results.
3112 */
3113 wrap(fn: (...a: any[]) => any, wrapper: (...a: any[]) => any): (...a: any[]) => any;
3114
3115 /**
3116 * Creates a new list out of the two supplied by creating each possible pair from the lists.
3117 */
3118 xprod<K, V>(as: ReadonlyArray<K>, bs: ReadonlyArray<V>): Array<KeyValuePair<K, V>>;
3119 xprod<K>(as: ReadonlyArray<K>): <V>(bs: ReadonlyArray<V>) => Array<KeyValuePair<K, V>>;
3120
3121 /**
3122 * Creates a new list out of the two supplied by pairing up equally-positioned items from
3123 * both lists. Note: `zip` is equivalent to `zipWith(function(a, b) { return [a, b] })`.
3124 */
3125 zip<K, V>(list1: ReadonlyArray<K>, list2: ReadonlyArray<V>): Array<KeyValuePair<K, V>>;
3126 zip<K>(list1: ReadonlyArray<K>): <V>(list2: ReadonlyArray<V>) => Array<KeyValuePair<K, V>>;
3127
3128 /**
3129 * Creates a new object out of a list of keys and a list of values.
3130 */
3131 // TODO: Dictionary<T> as a return value is to specific, any seems to loose
3132 zipObj<T>(keys: ReadonlyArray<string>, values: ReadonlyArray<T>): { [index: string]: T };
3133 zipObj(keys: ReadonlyArray<string>): <T>(values: ReadonlyArray<T>) => { [index: string]: T };
3134
3135 /**
3136 * Creates a new list out of the two supplied by applying the function to each
3137 * equally-positioned pair in the lists.
3138 */
3139 zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: ReadonlyArray<T>, list2: ReadonlyArray<U>): TResult[];
3140 zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: ReadonlyArray<T>): (list2: ReadonlyArray<U>) => TResult[];
3141 zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult): (list1: ReadonlyArray<T>, list2: ReadonlyArray<U>) => TResult[];
3142 }
3143}
3144
3145export = R;
3146export as namespace R;