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