rambda 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.cts ADDED
@@ -0,0 +1,2196 @@
1
+ export type RambdaTypes = "Object" | "Number" | "Boolean" | "String" | "Null" | "Array" | "RegExp" | "NaN" | "Function" | "Undefined" | "Async" | "Promise" | "Symbol" | "Set" | "Error" | "Map" | "WeakMap" | "Generator" | "GeneratorFunction" | "BigInt" | "ArrayBuffer" | "Date";
2
+
3
+ export type EqualTypes<X, Y> =
4
+ (<T>() => T extends X ? 1 : 2) extends
5
+ (<T>() => T extends Y ? 1 : 2) ? true : false;
6
+
7
+ export type IterableContainer<T = unknown> = ReadonlyArray<T> | readonly [];
8
+
9
+ export type Mapped<T extends IterableContainer, K> = {
10
+ -readonly [P in keyof T]: K;
11
+ };
12
+
13
+ export type ElementOf<Type extends readonly any[]> = Type[number];
14
+ export type MergeTypes<T> = {[KeyType in keyof T]: T[KeyType]} & {};
15
+ export type MergeTypesAlternative<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
16
+
17
+ export type EntryForKey<T, Key extends keyof T> = Key extends number | string
18
+ ? [key: `${Key}`, value: Required<T>[Key]]
19
+ : never;
20
+
21
+ export type Entry<T> = MergeTypes<{ [P in keyof T]-?: EntryForKey<T, P> }[keyof T]>;
22
+
23
+ export type Ord = number | string | boolean | Date;
24
+ export type Ordering = -1 | 0 | 1;
25
+
26
+ interface KeyValuePair<K, V> extends Array<K | V> {
27
+ 0: K;
28
+ 1: V;
29
+ }
30
+
31
+ export type Functor<A> = { map: <B>(fn: (x: A) => B) => Functor<B>; [key: string]: any };
32
+ export type DeepModify<Keys extends readonly PropertyKey[], U, T> =
33
+ Keys extends [infer K, ...infer Rest]
34
+ ? K extends keyof U
35
+ ? Rest extends readonly []
36
+ ? Omit<U, K> & Record<K, T>
37
+ : Rest extends readonly PropertyKey[]
38
+ ? Omit<U, K> & Record<K, DeepModify<Rest, U[K], T>>
39
+ : never
40
+ : never
41
+ : never;
42
+
43
+
44
+ export type PickStringToPickPath<T> = T extends `${infer Head},${infer Tail}` ? [Head, ...PickStringToPickPath<Tail>]
45
+ : T extends `${infer Head}` ? [Head]
46
+ : [];
47
+
48
+ declare const emptyObjectSymbol: unique symbol;
49
+ type EmptyObject = {[emptyObjectSymbol]?: never};
50
+ type EnumerableStringKeyOf<T> =
51
+ Required<T> extends Record<infer K, unknown>
52
+ ? `${Exclude<K, symbol>}`
53
+ : never;
54
+ type EnumerableStringKeyedValueOf<T> = ValuesOf<{
55
+ [K in keyof T]-?: K extends symbol ? never : T[K];
56
+ }>;
57
+ type ValuesOf<T> =
58
+ T extends EmptyObject
59
+ ? T[keyof T]
60
+ : T extends Record<PropertyKey, infer V>
61
+ ? V
62
+ : never;
63
+ type MappedValues<T extends object, Value> = MergeTypes<{
64
+ -readonly [P in keyof T as `${P extends number | string ? P : never}`]: Value;
65
+ }>;
66
+
67
+ type SimpleMerge<Destination, Source> = {
68
+ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
69
+ } & Source;
70
+
71
+ type OmitIndexSignature<ObjectType> = {
72
+ [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
73
+ ? never
74
+ : KeyType]: ObjectType[KeyType];
75
+ };
76
+
77
+ type PickIndexSignature<ObjectType> = {
78
+ [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
79
+ ? KeyType
80
+ : never]: ObjectType[KeyType];
81
+ };
82
+
83
+ type Merge<Destination, Source> =
84
+ MergeTypes<
85
+ SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
86
+ & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>
87
+ >;
88
+
89
+ type StrictNonNullable<T> = Exclude<T, null | undefined>;
90
+
91
+ type Flatten<T> = T extends object
92
+ ? T extends readonly any[]
93
+ ? T
94
+ : {
95
+ [K in keyof T]-?: NonNullable<T[K]> extends infer V
96
+ ? V extends object
97
+ ? V extends readonly any[]
98
+ ? never
99
+ : Flatten<V>
100
+ : V
101
+ : never
102
+ }
103
+ : T;
104
+
105
+ export type FlattenObject<T extends object> = object extends T
106
+ ? object
107
+ : {
108
+ [K in keyof T]-?: (
109
+ x: NonNullable<T[K]> extends infer V
110
+ ? V extends object
111
+ ? V extends readonly any[]
112
+ ? never
113
+ : Flatten<V> extends infer FV
114
+ ? {
115
+ [P in keyof FV as `${Extract<K, string>}.${Extract<P, string>}`]: FV[P]
116
+ }
117
+ : never
118
+ : Pick<T, K>
119
+ : never
120
+ ) => void
121
+ } extends Record<keyof T, (y: infer O) => void>
122
+ ? O
123
+ : never;
124
+
125
+ /**
126
+ * It adds new key-value pair to the object.
127
+ */
128
+ export function addProp<T extends object, P extends PropertyKey, V extends unknown>(
129
+ prop: P,
130
+ value: V
131
+ ): (obj: T) => MergeTypes<T & Record<P, V>>;
132
+
133
+ /**
134
+ * It receives list of objects and add new property to each item.
135
+ *
136
+ * The value is based on result of `fn` function, which receives the current object as argument.
137
+ */
138
+ export function addPropToObjects<
139
+ T extends object,
140
+ K extends string,
141
+ R
142
+ >(
143
+ property: K,
144
+ fn: (input: T) => R
145
+ ): (list: T[]) => MergeTypes<T & { [P in K]: R }>[];
146
+
147
+ /**
148
+ * It returns `true`, if all members of array `list` returns `true`, when applied as argument to `predicate` function.
149
+ */
150
+ export function all<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
151
+
152
+ /**
153
+ * It returns `true`, if all functions of `predicates` return `true`, when `input` is their argument.
154
+ */
155
+ export function allPass<F extends (...args: any[]) => boolean>(predicates: readonly F[]): F;
156
+
157
+ /**
158
+ * It returns `true`, if at least one member of `list` returns true, when passed to a `predicate` function.
159
+ */
160
+ export function any<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
161
+
162
+ /**
163
+ * It accepts list of `predicates` and returns a function. This function with its `input` will return `true`, if any of `predicates` returns `true` for this `input`.
164
+ */
165
+ export function anyPass<T, TF1 extends T, TF2 extends T>(
166
+ predicates: [(a: T) => a is TF1, (a: T) => a is TF2],
167
+ ): (a: T) => a is TF1 | TF2;
168
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
169
+ predicates: [(a: T) => a is TF1, (a: T) => a is TF2, (a: T) => a is TF3],
170
+ ): (a: T) => a is TF1 | TF2 | TF3;
171
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T>(
172
+ predicates: [(a: T) => a is TF1, (a: T) => a is TF2, (a: T) => a is TF3],
173
+ ): (a: T) => a is TF1 | TF2 | TF3;
174
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T>(
175
+ predicates: [(a: T) => a is TF1, (a: T) => a is TF2, (a: T) => a is TF3, (a: T) => a is TF4],
176
+ ): (a: T) => a is TF1 | TF2 | TF3 | TF4;
177
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T>(
178
+ predicates: [
179
+ (a: T) => a is TF1,
180
+ (a: T) => a is TF2,
181
+ (a: T) => a is TF3,
182
+ (a: T) => a is TF4,
183
+ (a: T) => a is TF5
184
+ ],
185
+ ): (a: T) => a is TF1 | TF2 | TF3 | TF4 | TF5;
186
+ export function anyPass<T, TF1 extends T, TF2 extends T, TF3 extends T, TF4 extends T, TF5 extends T, TF6 extends T>(
187
+ predicates: [
188
+ (a: T) => a is TF1,
189
+ (a: T) => a is TF2,
190
+ (a: T) => a is TF3,
191
+ (a: T) => a is TF4,
192
+ (a: T) => a is TF5,
193
+ (a: T) => a is TF6
194
+ ],
195
+ ): (a: T) => a is TF1 | TF2 | TF3 | TF4 | TF5 | TF6;
196
+ export function anyPass<F extends (...args: any[]) => boolean>(predicates: readonly F[]): F;
197
+
198
+ /**
199
+ * It adds element `x` at the end of `iterable`.
200
+ */
201
+ export function append<T>(el: T): (list: T[]) => T[];
202
+ export function append<T>(el: T): (list: readonly T[]) => T[];
203
+
204
+ /**
205
+ * Helper function to be used with `R.sort` to sort list in ascending order.
206
+ */
207
+ export function ascend<T>(fn: (obj: T) => Ord): (a: T, b: T)=> Ordering;
208
+
209
+ /**
210
+ * It helps to make sure that input is from specific type. Similar to `R.convertToType`, but it actually checks the type of the input value. If `fn` input returns falsy value, then the function will throw an error.
211
+ */
212
+ export function assertType<T, U extends T>(fn: (x: T) => x is U) : (x: T) => U;
213
+
214
+ /**
215
+ * It returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object.
216
+ */
217
+ export function checkObjectWithSpec<T>(spec: T): <U>(testObj: U) => boolean;
218
+
219
+ /**
220
+ * It removes `null` and `undefined` members from list or object input.
221
+ */
222
+ export function compact<T>(list: T[]): Array<StrictNonNullable<T>>;
223
+ export function compact<T extends object>(record: T): {
224
+ [K in keyof T as Exclude<T[K], null | undefined> extends never
225
+ ? never
226
+ : K
227
+ ]: Exclude<T[K], null | undefined>
228
+ };
229
+
230
+ /**
231
+ * It returns `inverted` version of `origin` function that accept `input` as argument.
232
+ *
233
+ * The return value of `inverted` is the negative boolean value of `origin(input)`.
234
+ */
235
+ export function complement<T extends any[]>(predicate: (...args: T) => unknown): (...args: T) => boolean;
236
+
237
+ /**
238
+ * It returns a new string or array, which is the result of merging `x` and `y`.
239
+ */
240
+ export function concat<T>(x: T[]): (y: T[]) => T[];
241
+ export function concat(x: string): (y: string) => string;
242
+
243
+ /**
244
+ * It helps to convert a value to a specific type.
245
+ * It is useful when you have to overcome TypeScript's type inference.
246
+ */
247
+ export function convertToType<T>(x: unknown) : T;
248
+
249
+ /**
250
+ * It counts how many times `predicate` function returns `true`, when supplied with iteration of `list`.
251
+ */
252
+ export function count<T>(predicate: (x: T) => boolean): (list: T[]) => number;
253
+
254
+ /**
255
+ * It counts elements in a list after each instance of the input list is passed through `transformFn` function.
256
+ */
257
+ export function countBy<T>(fn: (x: T) => string | number): (list: T[]) => { [index: string]: number };
258
+
259
+ export function createObjectFromKeys<const K extends readonly PropertyKey[], V>(
260
+ fn: (key: K[number]) => V
261
+ ): (keys: K) => { [P in K[number]]: V };
262
+ export function createObjectFromKeys<const K extends readonly PropertyKey[], V>(
263
+ fn: (key: K[number], index: number) => V
264
+ ): (keys: K) => { [P in K[number]]: V };
265
+
266
+ /**
267
+ * It returns `defaultValue`, if all of `inputArguments` are `undefined`, `null` or `NaN`.
268
+ *
269
+ * Else, it returns the first truthy `inputArguments` instance(from left to right).
270
+ */
271
+ export function defaultTo<T>(defaultValue: T): (input: unknown) => T;
272
+
273
+ /**
274
+ * Helper function to be used with `R.sort` to sort list in descending order.
275
+ */
276
+ export function descend<T>(fn: (obj: T) => Ord): (a: T, b: T)=> Ordering;
277
+
278
+ /**
279
+ * It returns `howMany` items dropped from beginning of list.
280
+ */
281
+ export function drop<T>(howMany: number): (list: T[]) => T[];
282
+
283
+ /**
284
+ * It returns `howMany` items dropped from the end of list.
285
+ */
286
+ export function dropLast<T>(howMany: number): (list: T[]) => T[];
287
+
288
+ export function dropLastWhile<T>(predicate: (x: T, index: number) => boolean): (list: T[]) => T[];
289
+ export function dropLastWhile<T>(predicate: (x: T) => boolean): (list: T[]) => T[];
290
+
291
+ export function dropRepeatsBy<T, U>(fn: (x: T) => U): (list: T[]) => T[];
292
+
293
+ export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean): (list: T[]) => T[];
294
+
295
+ export function dropWhile<T>(predicate: (x: T, index: number) => boolean): (list: T[]) => T[];
296
+ export function dropWhile<T>(predicate: (x: T) => boolean): (list: T[]) => T[];
297
+
298
+ export function eqBy<T>(fn: (x: T) => unknown, a: T): (b: T) => boolean;
299
+
300
+ /**
301
+ * It returns `true` if property `prop` in `obj1` is equal to property `prop` in `obj2` according to `R.equals`.
302
+ */
303
+ export function eqProps<T, K extends keyof T>(prop: K, obj1: T): (obj2: T) => boolean;
304
+
305
+ /**
306
+ * It deeply compares `x` and `y` and returns `true` if they are equal.
307
+ */
308
+ export function equals<T>(x: T, y: T): boolean;
309
+ export function equals<T>(x: T): (y: T) => boolean;
310
+
311
+ /**
312
+ * It takes object of functions as set of rules. These `rules` are applied to the `iterable` input to produce the result.
313
+ * It doesn't support nested rules, i.e rules are only one level deep.
314
+ */
315
+ export function evolve<T>(rules: {
316
+ [K in keyof T]?: (x: T[K]) => T[K]
317
+ }): (obj: T) => T;
318
+
319
+ /**
320
+ * Opposite of `R.includes`
321
+ *
322
+ * `R.equals` is used to determine equality.
323
+ */
324
+ export function excludes<T extends string>(valueToFind: T): (input: string) => boolean;
325
+ export function excludes<T>(valueToFind: T): (input: T[]) => boolean;
326
+
327
+ /**
328
+ * It filters list or object `input` using a `predicate` function.
329
+ */
330
+ export function filter<T, S extends T>(
331
+ predicate: (value: T) => value is S,
332
+ ): (list: T[]) => S[];
333
+ export function filter<T>(
334
+ predicate: BooleanConstructor,
335
+ ): (list: readonly T[]) => StrictNonNullable<T>[];
336
+ export function filter<T>(
337
+ predicate: BooleanConstructor,
338
+ ): (list: T[]) => StrictNonNullable<T>[];
339
+ export function filter<T>(
340
+ predicate: (value: T) => boolean,
341
+ ): (list: T[]) => T[];
342
+
343
+ /**
344
+ * It loops over each property of `obj` and returns a new object with only those properties that satisfy the `predicate`.
345
+ */
346
+ export function filterObject<T extends object>(
347
+ valueMapper: (
348
+ value: EnumerableStringKeyedValueOf<T>,
349
+ key: EnumerableStringKeyOf<T>,
350
+ data: T,
351
+ ) => boolean,
352
+ ): <U extends T>(data: T) => U;
353
+
354
+ /**
355
+ * It returns the first element of `list` that satisfy the `predicate`.
356
+ *
357
+ * If there is no such element, it returns `undefined`.
358
+ */
359
+ export function find<T>(predicate: (x: T) => boolean): (list: T[]) => T | undefined;
360
+
361
+ /**
362
+ * It returns the index of the first element of `list` satisfying the `predicate` function.
363
+ *
364
+ * If there is no such element, then `-1` is returned.
365
+ */
366
+ export function findIndex<T>(predicate: (x: T) => boolean): (list: T[]) => number;
367
+
368
+ /**
369
+ * It returns the last element of `list` satisfying the `predicate` function.
370
+ *
371
+ * If there is no such element, then `undefined` is returned.
372
+ */
373
+ export function findLast<T>(fn: (x: T) => boolean): (list: T[]) => T | undefined;
374
+
375
+ /**
376
+ * It returns the index of the last element of `list` satisfying the `predicate` function.
377
+ *
378
+ * If there is no such element, then `-1` is returned.
379
+ */
380
+ export function findLastIndex<T>(predicate: (x: T) => boolean): (list: T[]) => number;
381
+
382
+ /**
383
+ * It returns the `nth` element of `list` that satisfy the `predicate` function.
384
+ */
385
+ export function findNth<T>(predicate: (x: T) => boolean, nth: number): (list: T[]) => T | undefined;
386
+
387
+ /**
388
+ * It maps `fn` over `list` and then flatten the result by one-level.
389
+ */
390
+ export function flatMap<T, U extends unknown>(transformFn: (x: T extends any[] ? T[number]: never) => U): (listOfLists: T[]) => U[];
391
+
392
+ /**
393
+ * It deeply flattens an array.
394
+ * You must pass expected output type as a type argument.
395
+ */
396
+ export function flatten<T>(list: any[]): T[];
397
+
398
+ /**
399
+ * It transforms object to object where each value is represented with its path.
400
+ */
401
+ export function flattenObject<T extends object>(obj: T): FlattenObject<T>;
402
+
403
+ /**
404
+ * It splits `list` according to a provided `groupFn` function and returns an object.
405
+ */
406
+ export function groupBy<T, K extends string = string>(fn: (x: T) => K): (list: T[]) => Partial<Record<K, T[]>>;
407
+
408
+ /**
409
+ * It returns the first element of list or string `input`. It returns `undefined` if array has length of 0.
410
+ */
411
+ export function head<T>(listOrString: T): T extends string ? string :
412
+ T extends [] ? undefined:
413
+ T extends readonly [infer F, ...infer R] ? F :
414
+ T extends readonly [infer F] ? F :
415
+ T extends [infer F] ? F :
416
+ T extends [infer F, ...infer R] ? F :
417
+ T extends unknown[] ? T[number] :
418
+ undefined;
419
+
420
+ /**
421
+ * If `input` is string, then this method work as native `String.includes`.
422
+ *
423
+ * If `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.
424
+ */
425
+ export function includes<T extends string>(valueToFind: T): (input: string) => boolean;
426
+ export function includes<T>(valueToFind: T): (input: T[]) => boolean;
427
+
428
+ /**
429
+ * It uses `R.equals` for list of objects/arrays or native `indexOf` for any other case.
430
+ */
431
+ export function indexOf<T>(valueToFind: T): (list: T[]) => number;
432
+
433
+ /**
434
+ * It returns all but the last element of list or string `input`.
435
+ */
436
+ export function init<T extends unknown[]>(input: T): T extends readonly [...infer U, any] ? U : [...T];
437
+ export function init(input: string): string;
438
+
439
+ /**
440
+ * It returns a new list by applying a `predicate` function to all elements of `list1` and `list2` and keeping only these elements where `predicate` returns `true`.
441
+ */
442
+ export function innerJoin<T1, T2>(
443
+ pred: (a: T1, b: T2) => boolean,
444
+ list1: T1[],
445
+ ): (list2: T2[]) => T1[];
446
+
447
+ /**
448
+ * It generates a new string from `inputWithTags` by replacing all `{{x}}` occurrences with values provided by `templateArguments`.
449
+ */
450
+ export function interpolate(inputWithTags: string): (templateArguments: object) => string;
451
+
452
+
453
+ // API_MARKER_END
454
+ // ===========================================
455
+
456
+ /**
457
+ * It loops through `listA` and `listB` and returns the intersection of the two according to `R.equals`.
458
+ */
459
+ export function intersection<T>(listA: T[]): (listB: T[]) => T[];
460
+
461
+ /**
462
+ * It adds a `separator` between members of `list`.
463
+ */
464
+ export function intersperse<T>(separator: T): (list: T[]) => T[];
465
+
466
+ /**
467
+ * It returns a string of all `list` instances joined with a `glue`.
468
+ */
469
+ export function join<T>(glue: string): (list: T[]) => string;
470
+
471
+ /**
472
+ * It returns the last element of `input`, as the `input` can be either a string or an array. It returns `undefined` if array has length of 0.
473
+ */
474
+ export function last<T>(listOrString: T): T extends string ? string :
475
+ T extends [] ? undefined :
476
+ T extends readonly [...infer R, infer L] ? L :
477
+ T extends readonly [infer L] ? L :
478
+ T extends [infer L] ? L :
479
+ T extends [...infer R, infer L] ? L :
480
+ T extends unknown[] ? T[number] :
481
+ undefined;
482
+
483
+ /**
484
+ * It returns the last index of `target` in `list` array.
485
+ *
486
+ * `R.equals` is used to determine equality between `target` and members of `list`.
487
+ *
488
+ * If there is no such index, then `-1` is returned.
489
+ */
490
+ export function lastIndexOf<T>(target: T): (list: T[]) => number;
491
+
492
+ /**
493
+ * It returns the result of looping through `iterable` with `fn`.
494
+ *
495
+ * It works with both array and object.
496
+ */
497
+ export function map<T extends IterableContainer, U>(
498
+ fn: (value: T[number], index: number) => U,
499
+ ): (data: T) => Mapped<T, U>;
500
+ export function map<T extends IterableContainer, U>(
501
+ fn: (value: T[number]) => U,
502
+ ): (data: T) => Mapped<T, U>;
503
+ export function map<T extends IterableContainer, U>(
504
+ fn: (value: T[number], index: number) => U,
505
+ data: T
506
+ ) : Mapped<T, U>;
507
+ export function map<T extends IterableContainer, U>(
508
+ fn: (value: T[number]) => U,
509
+ data: T
510
+ ) : Mapped<T, U>;
511
+
512
+ /**
513
+ * Sequential asynchronous mapping with `fn` over members of `list`.
514
+ */
515
+ export function mapAsync<T extends IterableContainer, U>(
516
+ fn: (value: T[number], index: number) => Promise<U>,
517
+ ): (data: T) => Promise<Mapped<T, U>>;
518
+ export function mapAsync<T extends IterableContainer, U>(
519
+ fn: (value: T[number]) => Promise<U>,
520
+ ): (data: T) => Promise<Mapped<T, U>>;
521
+ export function mapAsync<T extends IterableContainer, U>(
522
+ fn: (value: T[number], index: number) => Promise<U>,
523
+ data: T
524
+ ): Promise<Mapped<T, U>>;
525
+ export function mapAsync<T extends IterableContainer, U>(
526
+ fn: (value: T[number]) => Promise<U>,
527
+ data: T
528
+ ): Promise<Mapped<T, U>>;
529
+
530
+ /**
531
+ * It returns a copy of `obj` with keys transformed by `fn`.
532
+ */
533
+ export function mapKeys<T>(fn: (prop: string, value: T) => string): (obj: Record<string, T>) => Record<string, T>;
534
+
535
+ export function mapObject<T extends object, Value>(
536
+ valueMapper: (
537
+ value: EnumerableStringKeyedValueOf<T>,
538
+ key: EnumerableStringKeyOf<T>,
539
+ data: T,
540
+ ) => Value,
541
+ ): (data: T) => MappedValues<T, Value>;
542
+
543
+ export function mapObjectAsync<T extends object, Value>(
544
+ valueMapper: (
545
+ value: EnumerableStringKeyedValueOf<T>,
546
+ key: EnumerableStringKeyOf<T>,
547
+ data: T,
548
+ ) => Promise<Value>,
549
+ ): (data: T) => Promise<MappedValues<T, Value>>;
550
+
551
+ /**
552
+ * Wrapper around `Promise.all` for asynchronous mapping with `fn` over members of `list`.
553
+ */
554
+ export function mapParallelAsync<T extends IterableContainer, U>(
555
+ fn: (value: T[number], index: number) => Promise<U>,
556
+ ): (data: T) => Promise<Mapped<T, U>>;
557
+ export function mapParallelAsync<T extends IterableContainer, U>(
558
+ fn: (value: T[number]) => Promise<U>,
559
+ ): (data: T) => Promise<Mapped<T, U>>;
560
+ export function mapParallelAsync<T extends IterableContainer, U>(
561
+ fn: (value: T[number], index: number) => Promise<U>,
562
+ data: T
563
+ ): Promise<Mapped<T, U>>;
564
+ export function mapParallelAsync<T extends IterableContainer, U>(
565
+ fn: (value: T[number]) => Promise<U>,
566
+ data: T
567
+ ): Promise<Mapped<T, U>>;
568
+
569
+ /**
570
+ * Curried version of `String.prototype.match` which returns empty array, when there is no match.
571
+ */
572
+ export function match(regExpression: RegExp): (str: string) => string[];
573
+
574
+ /**
575
+ * It returns the greater value between `x` and `y` according to `compareFn` function.
576
+ */
577
+ export function maxBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;
578
+
579
+ /**
580
+ * It creates a copy of `target` object with overwritten `newProps` properties.
581
+ */
582
+ export function merge<Source>(source: Source): <T>(data: T) => Merge<T, Source>;
583
+
584
+ /**
585
+ * Helper to merge all calculated TypeScript definitions into one definition.
586
+ * It returns its input and it is intended to be used as last method inside `R.pipe` chain.
587
+ */
588
+ export function mergeTypes<T>(x: T): MergeTypes<T>;
589
+
590
+ /**
591
+ * It returns the lesser value between `x` and `y` according to `compareFn` function.
592
+ */
593
+ export function minBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;
594
+
595
+ /**
596
+ * It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
597
+ */
598
+ export function modifyItemAtIndex<T>(index: number, replaceFn: (x: T) => T): (list: T[]) => T[];
599
+
600
+ /**
601
+ * It changes a property with the result of transformer function.
602
+ */
603
+ export function modifyProp<T, K extends keyof T>(
604
+ prop: K,
605
+ fn: (x: T[K]) => T[K],
606
+ ): (target: T) => T;
607
+
608
+ /**
609
+ * It returns `true`, if all members of array `list` returns `false`, when applied as argument to `predicate` function.
610
+ */
611
+ export function none<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
612
+
613
+ /**
614
+ * It creates an object with a single key-value pair.
615
+ */
616
+ export function objOf<T, K extends PropertyKey>(key: K): (value: T) => { [P in K]: T };
617
+
618
+ /**
619
+ * It will return `true` if `specification` object fully or partially include `obj` object.
620
+ *
621
+ * `R.equals` is used to determine equality.
622
+ */
623
+ export function objectIncludes<T>(specification: T): (obj: Partial<T>) => boolean;
624
+
625
+ /**
626
+ * It returns a partial copy of an `obj` without `propsToOmit` properties.
627
+ */
628
+ export function omit<
629
+ S extends string,
630
+ Keys extends PickStringToPickPath<S>,
631
+ >(propsToPick: S): <U extends Partial<Record<ElementOf<Keys>, any>>>(
632
+ obj: ElementOf<Keys> extends keyof U ? U : never
633
+ ) => ElementOf<Keys> extends keyof U ? MergeTypes<Omit<U, ElementOf<Keys>>> : never;
634
+ export function omit<const Keys extends PropertyKey[]>(propsToPick: Keys): <
635
+ U extends Partial<Record<ElementOf<Keys>, any>>
636
+ >(
637
+ obj: ElementOf<Keys> extends keyof U ? U : never
638
+ ) => ElementOf<Keys> extends keyof U ? MergeTypes<Omit<U, ElementOf<Keys>>> : never;
639
+
640
+ /**
641
+ * It will return array of two arrays according to `predicate` function. The first member holds all instances of `input` that pass the `predicate` function, while the second member - those who doesn't.
642
+ */
643
+ export function partition<T, S extends T>(
644
+ predicate: (value: T, index: number, data: ReadonlyArray<T>) => value is S,
645
+ ): (data: ReadonlyArray<T>) => [Array<S>, Array<Exclude<T, S>>];
646
+ export function partition<T>(
647
+ predicate: (value: T, index: number, data: ReadonlyArray<T>) => boolean,
648
+ ): (data: ReadonlyArray<T>) => [Array<T>, Array<T>];
649
+
650
+ /**
651
+ * It returns an array containing two objects. The first object holds all properties of the input object for which the predicate returns true, while the second object holds those that do not.
652
+ */
653
+ export function partitionObject<T extends unknown, S extends T>(
654
+ predicate: (value: T, prop: string, obj: Record<string, T>) => value is S,
655
+ ): (obj: Record<string, T>) => [Record<string, S>, Record<string, Exclude<T, S>>];
656
+ export function partitionObject<T extends unknown>(
657
+ predicate: (value: T, prop: string, obj: Record<string, T>) => boolean,
658
+ ): (obj: Record<string, T>) => [Record<string, T>, Record<string, T>];
659
+
660
+ /**
661
+ * If `pathToSearch` is `'a.b'` then it will return `1` if `obj` is `{a:{b:1}}`.
662
+ *
663
+ * It will return `undefined`, if such path is not found.
664
+ */
665
+ export function path<S, K0 extends string & keyof S>(path: `${K0}`): (obj: S) => S[K0];
666
+ export function path<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(path: `${K0}.${K1}`): (obj: S) => S[K0][K1];
667
+ export function path<
668
+ S,
669
+ K0 extends keyof S,
670
+ K1 extends keyof S[K0],
671
+ K2 extends keyof S[K0][K1]
672
+ >(path: [K0, K1, K2]): (obj: S) => S[K0][K1][K2];
673
+ export function path<
674
+ S,
675
+ K0 extends string & keyof S,
676
+ K1 extends string & keyof S[K0],
677
+ K2 extends string & keyof S[K0][K1]
678
+ >(path: `${K0}.${K1}.${K2}`): (obj: S) => S[K0][K1][K2];
679
+ export function path<
680
+ S,
681
+ K0 extends keyof S,
682
+ K1 extends keyof S[K0],
683
+ K2 extends keyof S[K0][K1],
684
+ K3 extends keyof S[K0][K1][K2]
685
+ >(path: [K0, K1, K2, K3]): (obj: S) => S[K0][K1][K2][K3];
686
+ export function path<
687
+ S,
688
+ K0 extends string & keyof S,
689
+ K1 extends string & keyof S[K0],
690
+ K2 extends string & keyof S[K0][K1],
691
+ K3 extends string & keyof S[K0][K1][K2]
692
+ >(path: `${K0}.${K1}.${K2}.${K3}`): (obj: S) => S[K0][K1][K2][K3];
693
+ export function path<
694
+ S,
695
+ K0 extends keyof S,
696
+ K1 extends keyof S[K0],
697
+ K2 extends keyof S[K0][K1],
698
+ K3 extends keyof S[K0][K1][K2],
699
+ K4 extends keyof S[K0][K1][K2][K3]
700
+ >(path: [K0, K1, K2, K3, K4]): (obj: S) => S[K0][K1][K2][K3][K4];
701
+ export function path<
702
+ S,
703
+ K0 extends string & keyof S,
704
+ K1 extends string & keyof S[K0],
705
+ K2 extends string & keyof S[K0][K1],
706
+ K3 extends string & keyof S[K0][K1][K2],
707
+ K4 extends string & keyof S[K0][K1][K2][K3]
708
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}`): (obj: S) => S[K0][K1][K2][K3][K4];
709
+ export function path<
710
+ S,
711
+ K0 extends keyof S,
712
+ K1 extends keyof S[K0],
713
+ K2 extends keyof S[K0][K1],
714
+ K3 extends keyof S[K0][K1][K2],
715
+ K4 extends keyof S[K0][K1][K2][K3]
716
+ >(path: [K0, K1, K2, K3, K4], obj: S): S[K0][K1][K2][K3][K4];
717
+ export function path<
718
+ S,
719
+ K0 extends keyof S,
720
+ K1 extends keyof S[K0],
721
+ K2 extends keyof S[K0][K1],
722
+ K3 extends keyof S[K0][K1][K2],
723
+ K4 extends keyof S[K0][K1][K2][K3],
724
+ K5 extends keyof S[K0][K1][K2][K3][K4]
725
+ >(path: [K0, K1, K2, K3, K4, K5]): (obj: S) => S[K0][K1][K2][K3][K4][K5];
726
+ export function path<
727
+ S,
728
+ K0 extends string & keyof S,
729
+ K1 extends string & keyof S[K0],
730
+ K2 extends string & keyof S[K0][K1],
731
+ K3 extends string & keyof S[K0][K1][K2],
732
+ K4 extends string & keyof S[K0][K1][K2][K3],
733
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
734
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}`): (obj: S) => S[K0][K1][K2][K3][K4][K5];
735
+ export function path<
736
+ S,
737
+ K0 extends keyof S,
738
+ K1 extends keyof S[K0],
739
+ K2 extends keyof S[K0][K1],
740
+ K3 extends keyof S[K0][K1][K2],
741
+ K4 extends keyof S[K0][K1][K2][K3],
742
+ K5 extends keyof S[K0][K1][K2][K3][K4]
743
+ >(path: [K0, K1, K2, K3, K4, K5], obj: S): S[K0][K1][K2][K3][K4][K5];
744
+ export function path<
745
+ S,
746
+ K0 extends keyof S,
747
+ K1 extends keyof S[K0],
748
+ K2 extends keyof S[K0][K1],
749
+ K3 extends keyof S[K0][K1][K2],
750
+ K4 extends keyof S[K0][K1][K2][K3],
751
+ K5 extends keyof S[K0][K1][K2][K3][K4],
752
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
753
+ >(path: [K0, K1, K2, K3, K4, K5, K6]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6];
754
+ export function path<
755
+ S,
756
+ K0 extends string & keyof S,
757
+ K1 extends string & keyof S[K0],
758
+ K2 extends string & keyof S[K0][K1],
759
+ K3 extends string & keyof S[K0][K1][K2],
760
+ K4 extends string & keyof S[K0][K1][K2][K3],
761
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
762
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
763
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}`): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6];
764
+ export function path<
765
+ S,
766
+ K0 extends keyof S,
767
+ K1 extends keyof S[K0],
768
+ K2 extends keyof S[K0][K1],
769
+ K3 extends keyof S[K0][K1][K2],
770
+ K4 extends keyof S[K0][K1][K2][K3],
771
+ K5 extends keyof S[K0][K1][K2][K3][K4],
772
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
773
+ >(path: [K0, K1, K2, K3, K4, K5, K6], obj: S): S[K0][K1][K2][K3][K4][K5][K6];
774
+ export function path<
775
+ S,
776
+ K0 extends keyof S,
777
+ K1 extends keyof S[K0],
778
+ K2 extends keyof S[K0][K1],
779
+ K3 extends keyof S[K0][K1][K2],
780
+ K4 extends keyof S[K0][K1][K2][K3],
781
+ K5 extends keyof S[K0][K1][K2][K3][K4],
782
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
783
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6]
784
+ >(path: [K0, K1, K2, K3, K4, K5, K6, K7]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7];
785
+ export function path<
786
+ S,
787
+ K0 extends string & keyof S,
788
+ K1 extends string & keyof S[K0],
789
+ K2 extends string & keyof S[K0][K1],
790
+ K3 extends string & keyof S[K0][K1][K2],
791
+ K4 extends string & keyof S[K0][K1][K2][K3],
792
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
793
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
794
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
795
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}`): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7];
796
+ export function path<
797
+ S,
798
+ K0 extends keyof S,
799
+ K1 extends keyof S[K0],
800
+ K2 extends keyof S[K0][K1],
801
+ K3 extends keyof S[K0][K1][K2],
802
+ K4 extends keyof S[K0][K1][K2][K3],
803
+ K5 extends keyof S[K0][K1][K2][K3][K4],
804
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
805
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6],
806
+ K8 extends keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
807
+ >(path: [K0, K1, K2, K3, K4, K5, K6, K7, K8]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7][K8];
808
+ export function path<
809
+ S,
810
+ K0 extends string & keyof S,
811
+ K1 extends string & keyof S[K0],
812
+ K2 extends string & keyof S[K0][K1],
813
+ K3 extends string & keyof S[K0][K1][K2],
814
+ K4 extends string & keyof S[K0][K1][K2][K3],
815
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
816
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
817
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
818
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
819
+ >(path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}.${K8}`): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7][K8];
820
+ export function path<S, K0 extends keyof S>(path: [K0]): (obj: S) => S[K0];
821
+ export function path<S, K0 extends keyof S, K1 extends keyof S[K0]>(path: [K0, K1]): (obj: S) => S[K0][K1];
822
+ export function path<
823
+ S,
824
+ K0 extends keyof S,
825
+ K1 extends keyof S[K0],
826
+ K2 extends keyof S[K0][K1]
827
+ >(path: [K0, K1, K2]): (obj: S) => S[K0][K1][K2];
828
+ export function path<
829
+ S,
830
+ K0 extends keyof S,
831
+ K1 extends keyof S[K0],
832
+ K2 extends keyof S[K0][K1],
833
+ K3 extends keyof S[K0][K1][K2]
834
+ >(path: [K0, K1, K2, K3]): (obj: S) => S[K0][K1][K2][K3];
835
+ export function path<
836
+ S,
837
+ K0 extends keyof S,
838
+ K1 extends keyof S[K0],
839
+ K2 extends keyof S[K0][K1],
840
+ K3 extends keyof S[K0][K1][K2],
841
+ K4 extends keyof S[K0][K1][K2][K3]
842
+ >(path: [K0, K1, K2, K3, K4]): (obj: S) => S[K0][K1][K2][K3][K4];
843
+ export function path<
844
+ S,
845
+ K0 extends keyof S,
846
+ K1 extends keyof S[K0],
847
+ K2 extends keyof S[K0][K1],
848
+ K3 extends keyof S[K0][K1][K2],
849
+ K4 extends keyof S[K0][K1][K2][K3]
850
+ >(path: [K0, K1, K2, K3, K4], obj: S): S[K0][K1][K2][K3][K4];
851
+ export function path<
852
+ S,
853
+ K0 extends keyof S,
854
+ K1 extends keyof S[K0],
855
+ K2 extends keyof S[K0][K1],
856
+ K3 extends keyof S[K0][K1][K2],
857
+ K4 extends keyof S[K0][K1][K2][K3],
858
+ K5 extends keyof S[K0][K1][K2][K3][K4]
859
+ >(path: [K0, K1, K2, K3, K4, K5]): (obj: S) => S[K0][K1][K2][K3][K4][K5];
860
+ export function path<
861
+ S,
862
+ K0 extends keyof S,
863
+ K1 extends keyof S[K0],
864
+ K2 extends keyof S[K0][K1],
865
+ K3 extends keyof S[K0][K1][K2],
866
+ K4 extends keyof S[K0][K1][K2][K3],
867
+ K5 extends keyof S[K0][K1][K2][K3][K4]
868
+ >(path: [K0, K1, K2, K3, K4, K5], obj: S): S[K0][K1][K2][K3][K4][K5];
869
+ export function path<
870
+ S,
871
+ K0 extends keyof S,
872
+ K1 extends keyof S[K0],
873
+ K2 extends keyof S[K0][K1],
874
+ K3 extends keyof S[K0][K1][K2],
875
+ K4 extends keyof S[K0][K1][K2][K3],
876
+ K5 extends keyof S[K0][K1][K2][K3][K4],
877
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
878
+ >(path: [K0, K1, K2, K3, K4, K5, K6]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6];
879
+ export function path<
880
+ S,
881
+ K0 extends keyof S,
882
+ K1 extends keyof S[K0],
883
+ K2 extends keyof S[K0][K1],
884
+ K3 extends keyof S[K0][K1][K2],
885
+ K4 extends keyof S[K0][K1][K2][K3],
886
+ K5 extends keyof S[K0][K1][K2][K3][K4],
887
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5]
888
+ >(path: [K0, K1, K2, K3, K4, K5, K6], obj: S): S[K0][K1][K2][K3][K4][K5][K6];
889
+ export function path<
890
+ S,
891
+ K0 extends keyof S,
892
+ K1 extends keyof S[K0],
893
+ K2 extends keyof S[K0][K1],
894
+ K3 extends keyof S[K0][K1][K2],
895
+ K4 extends keyof S[K0][K1][K2][K3],
896
+ K5 extends keyof S[K0][K1][K2][K3][K4],
897
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
898
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6]
899
+ >(path: [K0, K1, K2, K3, K4, K5, K6, K7]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7];
900
+ export function path<
901
+ S,
902
+ K0 extends keyof S,
903
+ K1 extends keyof S[K0],
904
+ K2 extends keyof S[K0][K1],
905
+ K3 extends keyof S[K0][K1][K2],
906
+ K4 extends keyof S[K0][K1][K2][K3],
907
+ K5 extends keyof S[K0][K1][K2][K3][K4],
908
+ K6 extends keyof S[K0][K1][K2][K3][K4][K5],
909
+ K7 extends keyof S[K0][K1][K2][K3][K4][K5][K6],
910
+ K8 extends keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
911
+ >(path: [K0, K1, K2, K3, K4, K5, K6, K7, K8]): (obj: S) => S[K0][K1][K2][K3][K4][K5][K6][K7][K8];
912
+
913
+ export function pathSatisfies<S, K0 extends string & keyof S>(
914
+ predicate: (x: S[K0]) => boolean,
915
+ path: [K0]
916
+ ): (obj: S) => boolean;
917
+ export function pathSatisfies<S, K0 extends string & keyof S>(
918
+ predicate: (x: S[K0]) => boolean,
919
+ path: `${K0}`
920
+ ): (obj: S) => boolean;
921
+ export function pathSatisfies<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(
922
+ predicate: (x: S[K0][K1]) => boolean,
923
+ path: [K0, K1]
924
+ ): (obj: S) => boolean;
925
+ export function pathSatisfies<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(
926
+ predicate: (x: S[K0][K1]) => boolean,
927
+ path: `${K0}.${K1}`
928
+ ): (obj: S) => boolean;
929
+ export function pathSatisfies<
930
+ S,
931
+ K0 extends string & keyof S,
932
+ K1 extends string & keyof S[K0],
933
+ K2 extends string & keyof S[K0][K1]
934
+ >(
935
+ predicate: (x: S[K0][K1][K2]) => boolean,
936
+ path: [K0, K1, K2]
937
+ ): (obj: S) => boolean;
938
+ export function pathSatisfies<
939
+ S,
940
+ K0 extends string & keyof S,
941
+ K1 extends string & keyof S[K0],
942
+ K2 extends string & keyof S[K0][K1]
943
+ >(
944
+ predicate: (x: S[K0][K1][K2]) => boolean,
945
+ path: `${K0}.${K1}.${K2}`
946
+ ): (obj: S) => boolean;
947
+ export function pathSatisfies<
948
+ S,
949
+ K0 extends string & keyof S,
950
+ K1 extends string & keyof S[K0],
951
+ K2 extends string & keyof S[K0][K1],
952
+ K3 extends string & keyof S[K0][K1][K2]
953
+ >(
954
+ predicate: (x: S[K0][K1][K2][K3]) => boolean,
955
+ path: [K0, K1, K2, K3]
956
+ ): (obj: S) => boolean;
957
+ export function pathSatisfies<
958
+ S,
959
+ K0 extends string & keyof S,
960
+ K1 extends string & keyof S[K0],
961
+ K2 extends string & keyof S[K0][K1],
962
+ K3 extends string & keyof S[K0][K1][K2]
963
+ >(
964
+ predicate: (x: S[K0][K1][K2][K3]) => boolean,
965
+ path: `${K0}.${K1}.${K2}.${K3}`
966
+ ): (obj: S) => boolean;
967
+ export function pathSatisfies<
968
+ S,
969
+ K0 extends string & keyof S,
970
+ K1 extends string & keyof S[K0],
971
+ K2 extends string & keyof S[K0][K1],
972
+ K3 extends string & keyof S[K0][K1][K2],
973
+ K4 extends string & keyof S[K0][K1][K2][K3]
974
+ >(
975
+ predicate: (x: S[K0][K1][K2][K3][K4]) => boolean,
976
+ path: [K0, K1, K2, K3, K4]
977
+ ): (obj: S) => boolean;
978
+ export function pathSatisfies<
979
+ S,
980
+ K0 extends string & keyof S,
981
+ K1 extends string & keyof S[K0],
982
+ K2 extends string & keyof S[K0][K1],
983
+ K3 extends string & keyof S[K0][K1][K2],
984
+ K4 extends string & keyof S[K0][K1][K2][K3]
985
+ >(
986
+ predicate: (x: S[K0][K1][K2][K3][K4]) => boolean,
987
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}`
988
+ ): (obj: S) => boolean;
989
+ export function pathSatisfies<
990
+ S,
991
+ K0 extends string & keyof S,
992
+ K1 extends string & keyof S[K0],
993
+ K2 extends string & keyof S[K0][K1],
994
+ K3 extends string & keyof S[K0][K1][K2],
995
+ K4 extends string & keyof S[K0][K1][K2][K3],
996
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
997
+ >(
998
+ predicate: (x: S[K0][K1][K2][K3][K4][K5]) => boolean,
999
+ path: [K0, K1, K2, K3, K4, K5]
1000
+ ): (obj: S) => boolean;
1001
+ export function pathSatisfies<
1002
+ S,
1003
+ K0 extends string & keyof S,
1004
+ K1 extends string & keyof S[K0],
1005
+ K2 extends string & keyof S[K0][K1],
1006
+ K3 extends string & keyof S[K0][K1][K2],
1007
+ K4 extends string & keyof S[K0][K1][K2][K3],
1008
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
1009
+ >(
1010
+ predicate: (x: S[K0][K1][K2][K3][K4][K5]) => boolean,
1011
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}`
1012
+ ): (obj: S) => boolean;
1013
+ export function pathSatisfies<
1014
+ S,
1015
+ K0 extends string & keyof S,
1016
+ K1 extends string & keyof S[K0],
1017
+ K2 extends string & keyof S[K0][K1],
1018
+ K3 extends string & keyof S[K0][K1][K2],
1019
+ K4 extends string & keyof S[K0][K1][K2][K3],
1020
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1021
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
1022
+ >(
1023
+ predicate: (x: S[K0][K1][K2][K3][K4][K5][K6]) => boolean,
1024
+ path: [K0, K1, K2, K3, K4, K5, K6]
1025
+ ): (obj: S) => boolean;
1026
+ export function pathSatisfies<
1027
+ S,
1028
+ K0 extends string & keyof S,
1029
+ K1 extends string & keyof S[K0],
1030
+ K2 extends string & keyof S[K0][K1],
1031
+ K3 extends string & keyof S[K0][K1][K2],
1032
+ K4 extends string & keyof S[K0][K1][K2][K3],
1033
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1034
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
1035
+ >(
1036
+ predicate: (x: S[K0][K1][K2][K3][K4][K5][K6]) => boolean,
1037
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}`
1038
+ ): (obj: S) => boolean;
1039
+ export function pathSatisfies<
1040
+ S,
1041
+ K0 extends string & keyof S,
1042
+ K1 extends string & keyof S[K0],
1043
+ K2 extends string & keyof S[K0][K1],
1044
+ K3 extends string & keyof S[K0][K1][K2],
1045
+ K4 extends string & keyof S[K0][K1][K2][K3],
1046
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1047
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1048
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
1049
+ >(
1050
+ predicate: (x: S[K0][K1][K2][K3][K4][K5][K6][K7]) => boolean,
1051
+ path: [K0, K1, K2, K3, K4, K5, K6, K7]
1052
+ ): (obj: S) => boolean;
1053
+ export function pathSatisfies<
1054
+ S,
1055
+ K0 extends string & keyof S,
1056
+ K1 extends string & keyof S[K0],
1057
+ K2 extends string & keyof S[K0][K1],
1058
+ K3 extends string & keyof S[K0][K1][K2],
1059
+ K4 extends string & keyof S[K0][K1][K2][K3],
1060
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1061
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1062
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
1063
+ >(
1064
+ predicate: (x: S[K0][K1][K2][K3][K4][K5][K6][K7]) => boolean,
1065
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}`
1066
+ ): (obj: S) => boolean;
1067
+ export function pathSatisfies<
1068
+ S,
1069
+ K0 extends string & keyof S,
1070
+ K1 extends string & keyof S[K0],
1071
+ K2 extends string & keyof S[K0][K1],
1072
+ K3 extends string & keyof S[K0][K1][K2],
1073
+ K4 extends string & keyof S[K0][K1][K2][K3],
1074
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1075
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1076
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
1077
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
1078
+ >(
1079
+ predicate: (x: S[K0][K1][K2][K3][K4][K5][K6][K7][K8]) => boolean,
1080
+ path: [K0, K1, K2, K3, K4, K5, K6, K7, K8]
1081
+ ): (obj: S) => boolean;
1082
+ export function pathSatisfies<
1083
+ S,
1084
+ K0 extends string & keyof S,
1085
+ K1 extends string & keyof S[K0],
1086
+ K2 extends string & keyof S[K0][K1],
1087
+ K3 extends string & keyof S[K0][K1][K2],
1088
+ K4 extends string & keyof S[K0][K1][K2][K3],
1089
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1090
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1091
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
1092
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
1093
+ >(
1094
+ predicate: (x: S[K0][K1][K2][K3][K4][K5][K6][K7][K8]) => boolean,
1095
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}.${K8}`
1096
+ ): (obj: S) => boolean;
1097
+
1098
+ export function permutations<T>(list: T[]): T[][];
1099
+
1100
+ /**
1101
+ * It returns a partial copy of an `input` containing only `propsToPick` properties.
1102
+ *
1103
+ * `input` can be either an object or an array.
1104
+ *
1105
+ * String annotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.
1106
+ */
1107
+ export function pick<K extends PropertyKey>(propsToPick: K[]): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>>;
1108
+ export function pick<S extends string>(propsToPick: S): <T>(input: T) => MergeTypes<Pick<T, Exclude<keyof T, Exclude<keyof T, ElementOf<PickStringToPickPath<S>>>>>>;
1109
+
1110
+ /**
1111
+ * It performs left-to-right function composition, where first argument is the input for the chain of functions.
1112
+ *
1113
+ * This is huge difference from `Ramda.pipe` where input is passed like `R.pipe(...fns)(input)`.
1114
+ * Here we have `R.pipe(input, ...fns)`.
1115
+ *
1116
+ * It has much better TypeScript support than `Ramda.pipe` and this is the reason why `Rambda` goes in this direction.
1117
+ */
1118
+ export function pipe<A, B>(value: A, op1: (input: A) => B): B;
1119
+ export function pipe<A, B, C>(
1120
+ value: A,
1121
+ op1: (input: A) => B,
1122
+ op2: (input: B) => C,
1123
+ ): C;
1124
+ export function pipe<A, B, C, D>(
1125
+ value: A,
1126
+ op1: (input: A) => B,
1127
+ op2: (input: B) => C,
1128
+ op3: (input: C) => D,
1129
+ ): D;
1130
+ export function pipe<A, B, C, D, E>(
1131
+ value: A,
1132
+ op1: (input: A) => B,
1133
+ op2: (input: B) => C,
1134
+ op3: (input: C) => D,
1135
+ op4: (input: D) => E,
1136
+ ): E;
1137
+ export function pipe<A, B, C, D, E, F>(
1138
+ value: A,
1139
+ op1: (input: A) => B,
1140
+ op2: (input: B) => C,
1141
+ op3: (input: C) => D,
1142
+ op4: (input: D) => E,
1143
+ op5: (input: E) => F,
1144
+ ): F;
1145
+ export function pipe<A, B, C, D, E, F, G>(
1146
+ value: A,
1147
+ op1: (input: A) => B,
1148
+ op2: (input: B) => C,
1149
+ op3: (input: C) => D,
1150
+ op4: (input: D) => E,
1151
+ op5: (input: E) => F,
1152
+ op6: (input: F) => G,
1153
+ ): G;
1154
+ export function pipe<A, B, C, D, E, F, G, H>(
1155
+ value: A,
1156
+ op1: (input: A) => B,
1157
+ op2: (input: B) => C,
1158
+ op3: (input: C) => D,
1159
+ op4: (input: D) => E,
1160
+ op5: (input: E) => F,
1161
+ op6: (input: F) => G,
1162
+ op7: (input: G) => H,
1163
+ ): H;
1164
+ export function pipe<A, B, C, D, E, F, G, H, I>(
1165
+ value: A,
1166
+ op1: (input: A) => B,
1167
+ op2: (input: B) => C,
1168
+ op3: (input: C) => D,
1169
+ op4: (input: D) => E,
1170
+ op5: (input: E) => F,
1171
+ op6: (input: F) => G,
1172
+ op7: (input: G) => H,
1173
+ op8: (input: H) => I,
1174
+ ): I;
1175
+ export function pipe<A, B, C, D, E, F, G, H, I, J>(
1176
+ value: A,
1177
+ op1: (input: A) => B,
1178
+ op2: (input: B) => C,
1179
+ op3: (input: C) => D,
1180
+ op4: (input: D) => E,
1181
+ op5: (input: E) => F,
1182
+ op6: (input: F) => G,
1183
+ op7: (input: G) => H,
1184
+ op8: (input: H) => I,
1185
+ op9: (input: I) => J,
1186
+ ): J;
1187
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K>(
1188
+ value: A,
1189
+ op01: (input: A) => B,
1190
+ op02: (input: B) => C,
1191
+ op03: (input: C) => D,
1192
+ op04: (input: D) => E,
1193
+ op05: (input: E) => F,
1194
+ op06: (input: F) => G,
1195
+ op07: (input: G) => H,
1196
+ op08: (input: H) => I,
1197
+ op09: (input: I) => J,
1198
+ op10: (input: J) => K,
1199
+ ): K;
1200
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(
1201
+ value: A,
1202
+ op01: (input: A) => B,
1203
+ op02: (input: B) => C,
1204
+ op03: (input: C) => D,
1205
+ op04: (input: D) => E,
1206
+ op05: (input: E) => F,
1207
+ op06: (input: F) => G,
1208
+ op07: (input: G) => H,
1209
+ op08: (input: H) => I,
1210
+ op09: (input: I) => J,
1211
+ op10: (input: J) => K,
1212
+ op11: (input: K) => L,
1213
+ ): L;
1214
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(
1215
+ value: A,
1216
+ op01: (input: A) => B,
1217
+ op02: (input: B) => C,
1218
+ op03: (input: C) => D,
1219
+ op04: (input: D) => E,
1220
+ op05: (input: E) => F,
1221
+ op06: (input: F) => G,
1222
+ op07: (input: G) => H,
1223
+ op08: (input: H) => I,
1224
+ op09: (input: I) => J,
1225
+ op10: (input: J) => K,
1226
+ op11: (input: K) => L,
1227
+ op12: (input: L) => M,
1228
+ ): M;
1229
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(
1230
+ value: A,
1231
+ op01: (input: A) => B,
1232
+ op02: (input: B) => C,
1233
+ op03: (input: C) => D,
1234
+ op04: (input: D) => E,
1235
+ op05: (input: E) => F,
1236
+ op06: (input: F) => G,
1237
+ op07: (input: G) => H,
1238
+ op08: (input: H) => I,
1239
+ op09: (input: I) => J,
1240
+ op10: (input: J) => K,
1241
+ op11: (input: K) => L,
1242
+ op12: (input: L) => M,
1243
+ op13: (input: M) => N,
1244
+ ): N;
1245
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(
1246
+ value: A,
1247
+ op01: (input: A) => B,
1248
+ op02: (input: B) => C,
1249
+ op03: (input: C) => D,
1250
+ op04: (input: D) => E,
1251
+ op05: (input: E) => F,
1252
+ op06: (input: F) => G,
1253
+ op07: (input: G) => H,
1254
+ op08: (input: H) => I,
1255
+ op09: (input: I) => J,
1256
+ op10: (input: J) => K,
1257
+ op11: (input: K) => L,
1258
+ op12: (input: L) => M,
1259
+ op13: (input: M) => N,
1260
+ op14: (input: N) => O,
1261
+ ): O;
1262
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(
1263
+ value: A,
1264
+ op01: (input: A) => B,
1265
+ op02: (input: B) => C,
1266
+ op03: (input: C) => D,
1267
+ op04: (input: D) => E,
1268
+ op05: (input: E) => F,
1269
+ op06: (input: F) => G,
1270
+ op07: (input: G) => H,
1271
+ op08: (input: H) => I,
1272
+ op09: (input: I) => J,
1273
+ op10: (input: J) => K,
1274
+ op11: (input: K) => L,
1275
+ op12: (input: L) => M,
1276
+ op13: (input: M) => N,
1277
+ op14: (input: N) => O,
1278
+ op15: (input: O) => P,
1279
+ ): P;
1280
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(
1281
+ value: A,
1282
+ op01: (input: A) => B,
1283
+ op02: (input: B) => C,
1284
+ op03: (input: C) => D,
1285
+ op04: (input: D) => E,
1286
+ op05: (input: E) => F,
1287
+ op06: (input: F) => G,
1288
+ op07: (input: G) => H,
1289
+ op08: (input: H) => I,
1290
+ op09: (input: I) => J,
1291
+ op10: (input: J) => K,
1292
+ op11: (input: K) => L,
1293
+ op12: (input: L) => M,
1294
+ op13: (input: M) => N,
1295
+ op14: (input: N) => O,
1296
+ op15: (input: O) => P,
1297
+ op16: (input: P) => Q,
1298
+ ): Q;
1299
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(
1300
+ value: A,
1301
+ op01: (input: A) => B,
1302
+ op02: (input: B) => C,
1303
+ op03: (input: C) => D,
1304
+ op04: (input: D) => E,
1305
+ op05: (input: E) => F,
1306
+ op06: (input: F) => G,
1307
+ op07: (input: G) => H,
1308
+ op08: (input: H) => I,
1309
+ op09: (input: I) => J,
1310
+ op10: (input: J) => K,
1311
+ op11: (input: K) => L,
1312
+ op12: (input: L) => M,
1313
+ op13: (input: M) => N,
1314
+ op14: (input: N) => O,
1315
+ op15: (input: O) => P,
1316
+ op16: (input: P) => Q,
1317
+ op17: (input: Q) => R,
1318
+ ): R;
1319
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(
1320
+ value: A,
1321
+ op01: (input: A) => B,
1322
+ op02: (input: B) => C,
1323
+ op03: (input: C) => D,
1324
+ op04: (input: D) => E,
1325
+ op05: (input: E) => F,
1326
+ op06: (input: F) => G,
1327
+ op07: (input: G) => H,
1328
+ op08: (input: H) => I,
1329
+ op09: (input: I) => J,
1330
+ op10: (input: J) => K,
1331
+ op11: (input: K) => L,
1332
+ op12: (input: L) => M,
1333
+ op13: (input: M) => N,
1334
+ op14: (input: N) => O,
1335
+ op15: (input: O) => P,
1336
+ op16: (input: P) => Q,
1337
+ op17: (input: Q) => R,
1338
+ op18: (input: R) => S,
1339
+ ): S;
1340
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(
1341
+ value: A,
1342
+ op01: (input: A) => B,
1343
+ op02: (input: B) => C,
1344
+ op03: (input: C) => D,
1345
+ op04: (input: D) => E,
1346
+ op05: (input: E) => F,
1347
+ op06: (input: F) => G,
1348
+ op07: (input: G) => H,
1349
+ op08: (input: H) => I,
1350
+ op09: (input: I) => J,
1351
+ op10: (input: J) => K,
1352
+ op11: (input: K) => L,
1353
+ op12: (input: L) => M,
1354
+ op13: (input: M) => N,
1355
+ op14: (input: N) => O,
1356
+ op15: (input: O) => P,
1357
+ op16: (input: P) => Q,
1358
+ op17: (input: Q) => R,
1359
+ op18: (input: R) => S,
1360
+ op19: (input: S) => T,
1361
+ ): T;
1362
+ export function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(
1363
+ value: A,
1364
+ op01: (input: A) => B,
1365
+ op02: (input: B) => C,
1366
+ op03: (input: C) => D,
1367
+ op04: (input: D) => E,
1368
+ op05: (input: E) => F,
1369
+ op06: (input: F) => G,
1370
+ op07: (input: G) => H,
1371
+ op08: (input: H) => I,
1372
+ op09: (input: I) => J,
1373
+ op10: (input: J) => K,
1374
+ op11: (input: K) => L,
1375
+ op12: (input: L) => M,
1376
+ op13: (input: M) => N,
1377
+ op14: (input: N) => O,
1378
+ op15: (input: O) => P,
1379
+ op16: (input: P) => Q,
1380
+ op17: (input: Q) => R,
1381
+ op18: (input: R) => S,
1382
+ op19: (input: S) => T,
1383
+ op20: (input: T) => U,
1384
+ ): U;
1385
+
1386
+ /**
1387
+ * It accepts input as first argument and series of functions as next arguments. It is same as `R.pipe` but with support for asynchronous functions.
1388
+ */
1389
+ export function pipeAsync<A, B>(input: A, fn0: (x: Awaited<A>) => B) : B;
1390
+ export function pipeAsync<A, B, C>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C) : C;
1391
+ export function pipeAsync<A, B, C, D>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D) : D;
1392
+ export function pipeAsync<A, B, C, D, E>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E) : E;
1393
+ export function pipeAsync<A, B, C, D, E, F>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F) : F;
1394
+ export function pipeAsync<A, B, C, D, E, F, G>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G) : G;
1395
+ export function pipeAsync<A, B, C, D, E, F, G, H>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G, fn6: (x: Awaited<G>) => H) : H;
1396
+ export function pipeAsync<A, B, C, D, E, F, G, H, I>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G, fn6: (x: Awaited<G>) => H, fn7: (x: Awaited<H>) => I) : I;
1397
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J>(
1398
+ input: A,
1399
+ fn0: (x: Awaited<A>) => B,
1400
+ fn1: (x: Awaited<B>) => C,
1401
+ fn2: (x: Awaited<C>) => D,
1402
+ fn3: (x: Awaited<D>) => E,
1403
+ fn4: (x: Awaited<E>) => F,
1404
+ fn5: (x: Awaited<F>) => G,
1405
+ fn6: (x: Awaited<G>) => H,
1406
+ fn7: (x: Awaited<H>) => I,
1407
+ fn8: (x: Awaited<I>) => J,
1408
+ ) : J;
1409
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K>(
1410
+ input: A,
1411
+ fn0: (x: Awaited<A>) => B,
1412
+ fn1: (x: Awaited<B>) => C,
1413
+ fn2: (x: Awaited<C>) => D,
1414
+ fn3: (x: Awaited<D>) => E,
1415
+ fn4: (x: Awaited<E>) => F,
1416
+ fn5: (x: Awaited<F>) => G,
1417
+ fn6: (x: Awaited<G>) => H,
1418
+ fn7: (x: Awaited<H>) => I,
1419
+ fn8: (x: Awaited<I>) => J,
1420
+ fn9: (x: Awaited<J>) => K,
1421
+ ): K;
1422
+
1423
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L>(
1424
+ input: A,
1425
+ fn0: (x: Awaited<A>) => B,
1426
+ fn1: (x: Awaited<B>) => C,
1427
+ fn2: (x: Awaited<C>) => D,
1428
+ fn3: (x: Awaited<D>) => E,
1429
+ fn4: (x: Awaited<E>) => F,
1430
+ fn5: (x: Awaited<F>) => G,
1431
+ fn6: (x: Awaited<G>) => H,
1432
+ fn7: (x: Awaited<H>) => I,
1433
+ fn8: (x: Awaited<I>) => J,
1434
+ fn9: (x: Awaited<J>) => K,
1435
+ fn10: (x: Awaited<K>) => L,
1436
+ ): L;
1437
+
1438
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M>(
1439
+ input: A,
1440
+ fn0: (x: Awaited<A>) => B,
1441
+ fn1: (x: Awaited<B>) => C,
1442
+ fn2: (x: Awaited<C>) => D,
1443
+ fn3: (x: Awaited<D>) => E,
1444
+ fn4: (x: Awaited<E>) => F,
1445
+ fn5: (x: Awaited<F>) => G,
1446
+ fn6: (x: Awaited<G>) => H,
1447
+ fn7: (x: Awaited<H>) => I,
1448
+ fn8: (x: Awaited<I>) => J,
1449
+ fn9: (x: Awaited<J>) => K,
1450
+ fn10: (x: Awaited<K>) => L,
1451
+ fn11: (x: Awaited<L>) => M,
1452
+ ): M;
1453
+
1454
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(
1455
+ input: A,
1456
+ fn0: (x: Awaited<A>) => B,
1457
+ fn1: (x: Awaited<B>) => C,
1458
+ fn2: (x: Awaited<C>) => D,
1459
+ fn3: (x: Awaited<D>) => E,
1460
+ fn4: (x: Awaited<E>) => F,
1461
+ fn5: (x: Awaited<F>) => G,
1462
+ fn6: (x: Awaited<G>) => H,
1463
+ fn7: (x: Awaited<H>) => I,
1464
+ fn8: (x: Awaited<I>) => J,
1465
+ fn9: (x: Awaited<J>) => K,
1466
+ fn10: (x: Awaited<K>) => L,
1467
+ fn11: (x: Awaited<L>) => M,
1468
+ fn12: (x: Awaited<M>) => N,
1469
+ ): N;
1470
+
1471
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(
1472
+ input: A,
1473
+ fn0: (x: Awaited<A>) => B,
1474
+ fn1: (x: Awaited<B>) => C,
1475
+ fn2: (x: Awaited<C>) => D,
1476
+ fn3: (x: Awaited<D>) => E,
1477
+ fn4: (x: Awaited<E>) => F,
1478
+ fn5: (x: Awaited<F>) => G,
1479
+ fn6: (x: Awaited<G>) => H,
1480
+ fn7: (x: Awaited<H>) => I,
1481
+ fn8: (x: Awaited<I>) => J,
1482
+ fn9: (x: Awaited<J>) => K,
1483
+ fn10: (x: Awaited<K>) => L,
1484
+ fn11: (x: Awaited<L>) => M,
1485
+ fn12: (x: Awaited<M>) => N,
1486
+ fn13: (x: Awaited<N>) => O,
1487
+ ): O;
1488
+
1489
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(
1490
+ input: A,
1491
+ fn0: (x: Awaited<A>) => B,
1492
+ fn1: (x: Awaited<B>) => C,
1493
+ fn2: (x: Awaited<C>) => D,
1494
+ fn3: (x: Awaited<D>) => E,
1495
+ fn4: (x: Awaited<E>) => F,
1496
+ fn5: (x: Awaited<F>) => G,
1497
+ fn6: (x: Awaited<G>) => H,
1498
+ fn7: (x: Awaited<H>) => I,
1499
+ fn8: (x: Awaited<I>) => J,
1500
+ fn9: (x: Awaited<J>) => K,
1501
+ fn10: (x: Awaited<K>) => L,
1502
+ fn11: (x: Awaited<L>) => M,
1503
+ fn12: (x: Awaited<M>) => N,
1504
+ fn13: (x: Awaited<N>) => O,
1505
+ fn14: (x: Awaited<O>) => P,
1506
+ ): P;
1507
+
1508
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(
1509
+ input: A,
1510
+ fn0: (x: Awaited<A>) => B,
1511
+ fn1: (x: Awaited<B>) => C,
1512
+ fn2: (x: Awaited<C>) => D,
1513
+ fn3: (x: Awaited<D>) => E,
1514
+ fn4: (x: Awaited<E>) => F,
1515
+ fn5: (x: Awaited<F>) => G,
1516
+ fn6: (x: Awaited<G>) => H,
1517
+ fn7: (x: Awaited<H>) => I,
1518
+ fn8: (x: Awaited<I>) => J,
1519
+ fn9: (x: Awaited<J>) => K,
1520
+ fn10: (x: Awaited<K>) => L,
1521
+ fn11: (x: Awaited<L>) => M,
1522
+ fn12: (x: Awaited<M>) => N,
1523
+ fn13: (x: Awaited<N>) => O,
1524
+ fn14: (x: Awaited<O>) => P,
1525
+ fn15: (x: Awaited<P>) => Q,
1526
+ ): Q;
1527
+
1528
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(
1529
+ input: A,
1530
+ fn0: (x: Awaited<A>) => B,
1531
+ fn1: (x: Awaited<B>) => C,
1532
+ fn2: (x: Awaited<C>) => D,
1533
+ fn3: (x: Awaited<D>) => E,
1534
+ fn4: (x: Awaited<E>) => F,
1535
+ fn5: (x: Awaited<F>) => G,
1536
+ fn6: (x: Awaited<G>) => H,
1537
+ fn7: (x: Awaited<H>) => I,
1538
+ fn8: (x: Awaited<I>) => J,
1539
+ fn9: (x: Awaited<J>) => K,
1540
+ fn10: (x: Awaited<K>) => L,
1541
+ fn11: (x: Awaited<L>) => M,
1542
+ fn12: (x: Awaited<M>) => N,
1543
+ fn13: (x: Awaited<N>) => O,
1544
+ fn14: (x: Awaited<O>) => P,
1545
+ fn15: (x: Awaited<P>) => Q,
1546
+ fn16: (x: Awaited<Q>) => R,
1547
+ ): R;
1548
+
1549
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(
1550
+ input: A,
1551
+ fn0: (x: Awaited<A>) => B,
1552
+ fn1: (x: Awaited<B>) => C,
1553
+ fn2: (x: Awaited<C>) => D,
1554
+ fn3: (x: Awaited<D>) => E,
1555
+ fn4: (x: Awaited<E>) => F,
1556
+ fn5: (x: Awaited<F>) => G,
1557
+ fn6: (x: Awaited<G>) => H,
1558
+ fn7: (x: Awaited<H>) => I,
1559
+ fn8: (x: Awaited<I>) => J,
1560
+ fn9: (x: Awaited<J>) => K,
1561
+ fn10: (x: Awaited<K>) => L,
1562
+ fn11: (x: Awaited<L>) => M,
1563
+ fn12: (x: Awaited<M>) => N,
1564
+ fn13: (x: Awaited<N>) => O,
1565
+ fn14: (x: Awaited<O>) => P,
1566
+ fn15: (x: Awaited<P>) => Q,
1567
+ fn16: (x: Awaited<Q>) => R,
1568
+ fn17: (x: Awaited<R>) => S,
1569
+ ): S;
1570
+
1571
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(
1572
+ input: A,
1573
+ fn0: (x: Awaited<A>) => B,
1574
+ fn1: (x: Awaited<B>) => C,
1575
+ fn2: (x: Awaited<C>) => D,
1576
+ fn3: (x: Awaited<D>) => E,
1577
+ fn4: (x: Awaited<E>) => F,
1578
+ fn5: (x: Awaited<F>) => G,
1579
+ fn6: (x: Awaited<G>) => H,
1580
+ fn7: (x: Awaited<H>) => I,
1581
+ fn8: (x: Awaited<I>) => J,
1582
+ fn9: (x: Awaited<J>) => K,
1583
+ fn10: (x: Awaited<K>) => L,
1584
+ fn11: (x: Awaited<L>) => M,
1585
+ fn12: (x: Awaited<M>) => N,
1586
+ fn13: (x: Awaited<N>) => O,
1587
+ fn14: (x: Awaited<O>) => P,
1588
+ fn15: (x: Awaited<P>) => Q,
1589
+ fn16: (x: Awaited<Q>) => R,
1590
+ fn17: (x: Awaited<R>) => S,
1591
+ fn18: (x: Awaited<S>) => T,
1592
+ ): T;
1593
+
1594
+ export function pipeAsync<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(
1595
+ input: A,
1596
+ fn0: (x: Awaited<A>) => B,
1597
+ fn1: (x: Awaited<B>) => C,
1598
+ fn2: (x: Awaited<C>) => D,
1599
+ fn3: (x: Awaited<D>) => E,
1600
+ fn4: (x: Awaited<E>) => F,
1601
+ fn5: (x: Awaited<F>) => G,
1602
+ fn6: (x: Awaited<G>) => H,
1603
+ fn7: (x: Awaited<H>) => I,
1604
+ fn8: (x: Awaited<I>) => J,
1605
+ fn9: (x: Awaited<J>) => K,
1606
+ fn10: (x: Awaited<K>) => L,
1607
+ fn11: (x: Awaited<L>) => M,
1608
+ fn12: (x: Awaited<M>) => N,
1609
+ fn13: (x: Awaited<N>) => O,
1610
+ fn14: (x: Awaited<O>) => P,
1611
+ fn15: (x: Awaited<P>) => Q,
1612
+ fn16: (x: Awaited<Q>) => R,
1613
+ fn17: (x: Awaited<R>) => S,
1614
+ fn18: (x: Awaited<S>) => T,
1615
+ fn19: (x: Awaited<T>) => U,
1616
+ ): U;
1617
+
1618
+ /**
1619
+ * It returns list of the values of `property` taken from the all objects inside `list`.
1620
+ * Basically, this is `R.map(R.prop(property))`.
1621
+ */
1622
+ export function pluck<T, K extends keyof T>(property: K): (list: T[]) => T[K][];
1623
+
1624
+ /**
1625
+ * It adds element `x` at the beginning of `list`.
1626
+ */
1627
+ export function prepend<T>(xToPrepend: T, iterable: T[]): T[];
1628
+ export function prepend<T>(xToPrepend: T): (iterable: T[]) => T[];
1629
+
1630
+ /**
1631
+ * It returns the value of property `propToFind` in `obj`.
1632
+ *
1633
+ * If there is no such property, it returns `undefined`.
1634
+ */
1635
+ export function prop<K extends PropertyKey>(prop: K): <U extends { [P in K]?: unknown }>(obj: U) => U[K];
1636
+ export function prop<K extends keyof U, U>(prop: K, obj: U): U[K];
1637
+
1638
+ /**
1639
+ * It returns true if `obj` has property `propToFind` and its value is equal to `valueToMatch`.
1640
+ */
1641
+ export function propEq<T>(val: T): {
1642
+ <K extends PropertyKey>(name: K): (obj: Record<K, T>) => boolean;
1643
+ <K extends PropertyKey>(name: K, obj: Record<K, T>): boolean;
1644
+ };
1645
+ export function propEq<T, K extends PropertyKey>(val: T, name: K): (obj: Record<K, T>) => boolean;
1646
+ export function propEq<K extends keyof U, U>(val: U[K], name: K, obj: U): boolean;
1647
+
1648
+ /**
1649
+ * It returns either `defaultValue` or the value of `property` in `obj`.
1650
+ */
1651
+ export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>>) => T;
1652
+
1653
+ /**
1654
+ * It returns `true` if the object property satisfies a given predicate.
1655
+ */
1656
+ export function propSatisfies<T>(predicate: (x: T) => boolean, property: string): (obj: Record<PropertyKey, T>) => boolean;
1657
+
1658
+ /**
1659
+ * It returns list of numbers between `startInclusive` to `endExclusive` markers.
1660
+ * If `start` is greater than `end`, then the result will be in descending order.
1661
+ */
1662
+ export function range(startInclusive: number): (endExclusive: number) => number[];
1663
+
1664
+ export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult): (list: T[]) => TResult;
1665
+
1666
+ /**
1667
+ * It has the opposite effect of `R.filter`.
1668
+ */
1669
+ export function reject<T>(
1670
+ predicate: (value: T) => boolean,
1671
+ list: T[],
1672
+ ): T[];
1673
+ export function reject<T>(
1674
+ predicate: BooleanConstructor,
1675
+ ): (list: readonly T[]) => ("" | null | undefined | false | 0)[];
1676
+ export function reject<T>(
1677
+ predicate: BooleanConstructor,
1678
+ ): (list: T[]) => ("" | null | undefined | false | 0)[];
1679
+ export function reject<T>(
1680
+ predicate: (value: T) => boolean,
1681
+ ): (list: T[]) => T[];
1682
+
1683
+ /**
1684
+ * Same as `R.filterObject` but it returns the object with properties that do not satisfy the predicate function.
1685
+ */
1686
+ export function rejectObject<T extends object>(
1687
+ valueMapper: (
1688
+ value: EnumerableStringKeyedValueOf<T>,
1689
+ key: EnumerableStringKeyOf<T>,
1690
+ data: T,
1691
+ ) => boolean,
1692
+ ): <U extends T>(data: T) => U;
1693
+
1694
+ /**
1695
+ * It replaces `strOrRegex` found in `str` with `replacer`.
1696
+ */
1697
+ export function replace(strOrRegex: RegExp | string, replacer: RegExp | string): (str: string) => string;
1698
+
1699
+ /**
1700
+ * It returns a randomized copy of array.
1701
+ */
1702
+ export function shuffle<T>(list: T[]): T[];
1703
+
1704
+ /**
1705
+ * It returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to return only `-1`, `0` or `1`.
1706
+ */
1707
+ export function sort<T>(sortFn: (a: T, b: T) => number): (list: T[]) => T[];
1708
+
1709
+ /**
1710
+ * It returns copy of `list` sorted by `sortFn` function, where `sortFn` function returns a value to compare, i.e. it doesn't need to return only `-1`, `0` or `1`.
1711
+ */
1712
+ export function sortBy<T>(sortFn: (x: T) => Ord): (list: T[]) => T[];
1713
+
1714
+ export function sortByDescending<T>(sortFn: (a: T, b: T) => number): (list: T[]) => T[];
1715
+
1716
+ /**
1717
+ * It sorts `list` by the value of `path` property.
1718
+ */
1719
+ export function sortByPath<S, K0 extends string & keyof S>(
1720
+ path: [K0]
1721
+ ): (list: S[]) => S[];
1722
+ export function sortByPath<S, K0 extends string & keyof S>(
1723
+ path: `${K0}`
1724
+ ): (list: S[]) => S[];
1725
+ export function sortByPath<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(
1726
+ path: [K0, K1]
1727
+ ): (list: S[]) => S[];
1728
+ export function sortByPath<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(
1729
+ path: `${K0}.${K1}`
1730
+ ): (list: S[]) => S[];
1731
+ export function sortByPath<
1732
+ S,
1733
+ K0 extends string & keyof S,
1734
+ K1 extends string & keyof S[K0],
1735
+ K2 extends string & keyof S[K0][K1]
1736
+ >(
1737
+ path: [K0, K1, K2]
1738
+ ): (list: S[]) => S[];
1739
+ export function sortByPath<
1740
+ S,
1741
+ K0 extends string & keyof S,
1742
+ K1 extends string & keyof S[K0],
1743
+ K2 extends string & keyof S[K0][K1]
1744
+ >(
1745
+ path: `${K0}.${K1}.${K2}`
1746
+ ): (list: S[]) => S[];
1747
+ export function sortByPath<
1748
+ S,
1749
+ K0 extends string & keyof S,
1750
+ K1 extends string & keyof S[K0],
1751
+ K2 extends string & keyof S[K0][K1],
1752
+ K3 extends string & keyof S[K0][K1][K2]
1753
+ >(
1754
+ path: [K0, K1, K2, K3]
1755
+ ): (list: S[]) => S[];
1756
+ export function sortByPath<
1757
+ S,
1758
+ K0 extends string & keyof S,
1759
+ K1 extends string & keyof S[K0],
1760
+ K2 extends string & keyof S[K0][K1],
1761
+ K3 extends string & keyof S[K0][K1][K2]
1762
+ >(
1763
+ path: `${K0}.${K1}.${K2}.${K3}`
1764
+ ): (list: S[]) => S[];
1765
+ export function sortByPath<
1766
+ S,
1767
+ K0 extends string & keyof S,
1768
+ K1 extends string & keyof S[K0],
1769
+ K2 extends string & keyof S[K0][K1],
1770
+ K3 extends string & keyof S[K0][K1][K2],
1771
+ K4 extends string & keyof S[K0][K1][K2][K3]
1772
+ >(
1773
+ path: [K0, K1, K2, K3, K4]
1774
+ ): (list: S[]) => S[];
1775
+ export function sortByPath<
1776
+ S,
1777
+ K0 extends string & keyof S,
1778
+ K1 extends string & keyof S[K0],
1779
+ K2 extends string & keyof S[K0][K1],
1780
+ K3 extends string & keyof S[K0][K1][K2],
1781
+ K4 extends string & keyof S[K0][K1][K2][K3]
1782
+ >(
1783
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}`
1784
+ ): (list: S[]) => S[];
1785
+ export function sortByPath<
1786
+ S,
1787
+ K0 extends string & keyof S,
1788
+ K1 extends string & keyof S[K0],
1789
+ K2 extends string & keyof S[K0][K1],
1790
+ K3 extends string & keyof S[K0][K1][K2],
1791
+ K4 extends string & keyof S[K0][K1][K2][K3],
1792
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
1793
+ >(
1794
+ path: [K0, K1, K2, K3, K4, K5]
1795
+ ): (list: S[]) => S[];
1796
+ export function sortByPath<
1797
+ S,
1798
+ K0 extends string & keyof S,
1799
+ K1 extends string & keyof S[K0],
1800
+ K2 extends string & keyof S[K0][K1],
1801
+ K3 extends string & keyof S[K0][K1][K2],
1802
+ K4 extends string & keyof S[K0][K1][K2][K3],
1803
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
1804
+ >(
1805
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}`
1806
+ ): (list: S[]) => S[];
1807
+ export function sortByPath<
1808
+ S,
1809
+ K0 extends string & keyof S,
1810
+ K1 extends string & keyof S[K0],
1811
+ K2 extends string & keyof S[K0][K1],
1812
+ K3 extends string & keyof S[K0][K1][K2],
1813
+ K4 extends string & keyof S[K0][K1][K2][K3],
1814
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1815
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
1816
+ >(
1817
+ path: [K0, K1, K2, K3, K4, K5, K6]
1818
+ ): (list: S[]) => S[];
1819
+ export function sortByPath<
1820
+ S,
1821
+ K0 extends string & keyof S,
1822
+ K1 extends string & keyof S[K0],
1823
+ K2 extends string & keyof S[K0][K1],
1824
+ K3 extends string & keyof S[K0][K1][K2],
1825
+ K4 extends string & keyof S[K0][K1][K2][K3],
1826
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1827
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
1828
+ >(
1829
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}`
1830
+ ): (list: S[]) => S[];
1831
+ export function sortByPath<
1832
+ S,
1833
+ K0 extends string & keyof S,
1834
+ K1 extends string & keyof S[K0],
1835
+ K2 extends string & keyof S[K0][K1],
1836
+ K3 extends string & keyof S[K0][K1][K2],
1837
+ K4 extends string & keyof S[K0][K1][K2][K3],
1838
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1839
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1840
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
1841
+ >(
1842
+ path: [K0, K1, K2, K3, K4, K5, K6, K7]
1843
+ ): (list: S[]) => S[];
1844
+ export function sortByPath<
1845
+ S,
1846
+ K0 extends string & keyof S,
1847
+ K1 extends string & keyof S[K0],
1848
+ K2 extends string & keyof S[K0][K1],
1849
+ K3 extends string & keyof S[K0][K1][K2],
1850
+ K4 extends string & keyof S[K0][K1][K2][K3],
1851
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1852
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1853
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
1854
+ >(
1855
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}`
1856
+ ): (list: S[]) => S[];
1857
+ export function sortByPath<
1858
+ S,
1859
+ K0 extends string & keyof S,
1860
+ K1 extends string & keyof S[K0],
1861
+ K2 extends string & keyof S[K0][K1],
1862
+ K3 extends string & keyof S[K0][K1][K2],
1863
+ K4 extends string & keyof S[K0][K1][K2][K3],
1864
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1865
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1866
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
1867
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
1868
+ >(
1869
+ path: [K0, K1, K2, K3, K4, K5, K6, K7, K8]
1870
+ ): (list: S[]) => S[];
1871
+ export function sortByPath<
1872
+ S,
1873
+ K0 extends string & keyof S,
1874
+ K1 extends string & keyof S[K0],
1875
+ K2 extends string & keyof S[K0][K1],
1876
+ K3 extends string & keyof S[K0][K1][K2],
1877
+ K4 extends string & keyof S[K0][K1][K2][K3],
1878
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1879
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
1880
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
1881
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
1882
+ >(
1883
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}.${K8}`
1884
+ ): (list: S[]) => S[];
1885
+
1886
+ export function sortByPathDescending<S, K0 extends string & keyof S>(
1887
+ path: [K0]
1888
+ ): (list: S[]) => S[];
1889
+ export function sortByPathDescending<S, K0 extends string & keyof S>(
1890
+ path: `${K0}`
1891
+ ): (list: S[]) => S[];
1892
+ export function sortByPathDescending<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(
1893
+ path: [K0, K1]
1894
+ ): (list: S[]) => S[];
1895
+ export function sortByPathDescending<S, K0 extends string & keyof S, K1 extends string & keyof S[K0]>(
1896
+ path: `${K0}.${K1}`
1897
+ ): (list: S[]) => S[];
1898
+ export function sortByPathDescending<
1899
+ S,
1900
+ K0 extends string & keyof S,
1901
+ K1 extends string & keyof S[K0],
1902
+ K2 extends string & keyof S[K0][K1]
1903
+ >(
1904
+ path: [K0, K1, K2]
1905
+ ): (list: S[]) => S[];
1906
+ export function sortByPathDescending<
1907
+ S,
1908
+ K0 extends string & keyof S,
1909
+ K1 extends string & keyof S[K0],
1910
+ K2 extends string & keyof S[K0][K1]
1911
+ >(
1912
+ path: `${K0}.${K1}.${K2}`
1913
+ ): (list: S[]) => S[];
1914
+ export function sortByPathDescending<
1915
+ S,
1916
+ K0 extends string & keyof S,
1917
+ K1 extends string & keyof S[K0],
1918
+ K2 extends string & keyof S[K0][K1],
1919
+ K3 extends string & keyof S[K0][K1][K2]
1920
+ >(
1921
+ path: [K0, K1, K2, K3]
1922
+ ): (list: S[]) => S[];
1923
+ export function sortByPathDescending<
1924
+ S,
1925
+ K0 extends string & keyof S,
1926
+ K1 extends string & keyof S[K0],
1927
+ K2 extends string & keyof S[K0][K1],
1928
+ K3 extends string & keyof S[K0][K1][K2]
1929
+ >(
1930
+ path: `${K0}.${K1}.${K2}.${K3}`
1931
+ ): (list: S[]) => S[];
1932
+ export function sortByPathDescending<
1933
+ S,
1934
+ K0 extends string & keyof S,
1935
+ K1 extends string & keyof S[K0],
1936
+ K2 extends string & keyof S[K0][K1],
1937
+ K3 extends string & keyof S[K0][K1][K2],
1938
+ K4 extends string & keyof S[K0][K1][K2][K3]
1939
+ >(
1940
+ path: [K0, K1, K2, K3, K4]
1941
+ ): (list: S[]) => S[];
1942
+ export function sortByPathDescending<
1943
+ S,
1944
+ K0 extends string & keyof S,
1945
+ K1 extends string & keyof S[K0],
1946
+ K2 extends string & keyof S[K0][K1],
1947
+ K3 extends string & keyof S[K0][K1][K2],
1948
+ K4 extends string & keyof S[K0][K1][K2][K3]
1949
+ >(
1950
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}`
1951
+ ): (list: S[]) => S[];
1952
+ export function sortByPathDescending<
1953
+ S,
1954
+ K0 extends string & keyof S,
1955
+ K1 extends string & keyof S[K0],
1956
+ K2 extends string & keyof S[K0][K1],
1957
+ K3 extends string & keyof S[K0][K1][K2],
1958
+ K4 extends string & keyof S[K0][K1][K2][K3],
1959
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
1960
+ >(
1961
+ path: [K0, K1, K2, K3, K4, K5]
1962
+ ): (list: S[]) => S[];
1963
+ export function sortByPathDescending<
1964
+ S,
1965
+ K0 extends string & keyof S,
1966
+ K1 extends string & keyof S[K0],
1967
+ K2 extends string & keyof S[K0][K1],
1968
+ K3 extends string & keyof S[K0][K1][K2],
1969
+ K4 extends string & keyof S[K0][K1][K2][K3],
1970
+ K5 extends string & keyof S[K0][K1][K2][K3][K4]
1971
+ >(
1972
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}`
1973
+ ): (list: S[]) => S[];
1974
+ export function sortByPathDescending<
1975
+ S,
1976
+ K0 extends string & keyof S,
1977
+ K1 extends string & keyof S[K0],
1978
+ K2 extends string & keyof S[K0][K1],
1979
+ K3 extends string & keyof S[K0][K1][K2],
1980
+ K4 extends string & keyof S[K0][K1][K2][K3],
1981
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1982
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
1983
+ >(
1984
+ path: [K0, K1, K2, K3, K4, K5, K6]
1985
+ ): (list: S[]) => S[];
1986
+ export function sortByPathDescending<
1987
+ S,
1988
+ K0 extends string & keyof S,
1989
+ K1 extends string & keyof S[K0],
1990
+ K2 extends string & keyof S[K0][K1],
1991
+ K3 extends string & keyof S[K0][K1][K2],
1992
+ K4 extends string & keyof S[K0][K1][K2][K3],
1993
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
1994
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5]
1995
+ >(
1996
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}`
1997
+ ): (list: S[]) => S[];
1998
+ export function sortByPathDescending<
1999
+ S,
2000
+ K0 extends string & keyof S,
2001
+ K1 extends string & keyof S[K0],
2002
+ K2 extends string & keyof S[K0][K1],
2003
+ K3 extends string & keyof S[K0][K1][K2],
2004
+ K4 extends string & keyof S[K0][K1][K2][K3],
2005
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
2006
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
2007
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
2008
+ >(
2009
+ path: [K0, K1, K2, K3, K4, K5, K6, K7]
2010
+ ): (list: S[]) => S[];
2011
+ export function sortByPathDescending<
2012
+ S,
2013
+ K0 extends string & keyof S,
2014
+ K1 extends string & keyof S[K0],
2015
+ K2 extends string & keyof S[K0][K1],
2016
+ K3 extends string & keyof S[K0][K1][K2],
2017
+ K4 extends string & keyof S[K0][K1][K2][K3],
2018
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
2019
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
2020
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6]
2021
+ >(
2022
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}`
2023
+ ): (list: S[]) => S[];
2024
+ export function sortByPathDescending<
2025
+ S,
2026
+ K0 extends string & keyof S,
2027
+ K1 extends string & keyof S[K0],
2028
+ K2 extends string & keyof S[K0][K1],
2029
+ K3 extends string & keyof S[K0][K1][K2],
2030
+ K4 extends string & keyof S[K0][K1][K2][K3],
2031
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
2032
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
2033
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
2034
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
2035
+ >(
2036
+ path: [K0, K1, K2, K3, K4, K5, K6, K7, K8]
2037
+ ): (list: S[]) => S[];
2038
+ export function sortByPathDescending<
2039
+ S,
2040
+ K0 extends string & keyof S,
2041
+ K1 extends string & keyof S[K0],
2042
+ K2 extends string & keyof S[K0][K1],
2043
+ K3 extends string & keyof S[K0][K1][K2],
2044
+ K4 extends string & keyof S[K0][K1][K2][K3],
2045
+ K5 extends string & keyof S[K0][K1][K2][K3][K4],
2046
+ K6 extends string & keyof S[K0][K1][K2][K3][K4][K5],
2047
+ K7 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6],
2048
+ K8 extends string & keyof S[K0][K1][K2][K3][K4][K5][K6][K7]
2049
+ >(
2050
+ path: `${K0}.${K1}.${K2}.${K3}.${K4}.${K5}.${K6}.${K7}.${K8}`
2051
+ ): (list: S[]) => S[];
2052
+
2053
+ /**
2054
+ * It returns a sorted version of `input` object.
2055
+ */
2056
+ export function sortObject<T, K extends string & keyof T>(predicate: (aProp: string, bProp: string, aValue: T[K], bValue: T[K]) => number): (obj: T) => T;
2057
+ export function sortObject<T>(predicate: (aProp: string, bProp: string) => number): (obj: T) => T;
2058
+
2059
+ export function sortWith<T>(fns: Array<(a: T, b: T) => number>): (list: T[]) => T[];
2060
+
2061
+ export function split(separator: string | RegExp): (str: string) => string[];
2062
+
2063
+ /**
2064
+ * It splits `input` into slices of `sliceLength`.
2065
+ */
2066
+ export function splitEvery<T>(sliceLength: number): (input: T[]) => (T[])[];
2067
+
2068
+ /**
2069
+ * It returns a merged list of `x` and `y` with all equal elements removed.
2070
+ *
2071
+ * `R.equals` is used to determine equality.
2072
+ */
2073
+ export function symmetricDifference<T>(x: T[]): <T>(y: T[]) => T[];
2074
+
2075
+ /**
2076
+ * It returns all but the first element of `input`.
2077
+ */
2078
+ export function tail<T extends unknown[]>(input: T): T extends [any, ...infer U] ? U : [...T];
2079
+ export function tail(input: string): string;
2080
+
2081
+ /**
2082
+ * It returns the first `howMany` elements of `input`.
2083
+ */
2084
+ export function take<T>(howMany: number): {
2085
+ (input: string): string;
2086
+ (input: T[]): T[];
2087
+ (input: readonly T[]): T[];
2088
+ };
2089
+
2090
+ /**
2091
+ * It returns the last `howMany` elements of `input`.
2092
+ */
2093
+ export function takeLast<T>(howMany: number): {
2094
+ (input: string): string;
2095
+ (input: T[]): T[];
2096
+ (input: readonly T[]): T[];
2097
+ };
2098
+
2099
+ export function takeLastWhile<T>(predicate: (x: T) => boolean): (input: T[]) => T[];
2100
+ export function takeLastWhile<T>(predicate: (x: T, index: number) => boolean): (list: T[]) => T[];
2101
+
2102
+ export function takeWhile<T>(predicate: (x: T, index: number) => boolean): (list: T[]) => T[];
2103
+ export function takeWhile<T>(predicate: (x: T) => boolean): (input: T[]) => T[];
2104
+
2105
+ /**
2106
+ * It applies function `fn` to input `x` and returns `x`.
2107
+ *
2108
+ * One use case is debugging in the middle of `R.pipe` chain.
2109
+ */
2110
+ export function tap<T>(fn: (x: T) => void): (input: T) => T;
2111
+
2112
+ /**
2113
+ * It determines whether `str` matches `regExpression`.
2114
+ */
2115
+ export function test(regExpression: RegExp): (str: string) => boolean;
2116
+
2117
+ /**
2118
+ * It returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result.
2119
+ */
2120
+ export function tryCatch<T, U>(
2121
+ fn: (input: T) => U,
2122
+ fallback: U
2123
+ ): (input: T) => U;
2124
+
2125
+ /**
2126
+ * It accepts any input and it returns its type.
2127
+ */
2128
+ export function type(x: any): RambdaTypes;
2129
+
2130
+ /**
2131
+ * It takes two lists and return a new list containing a merger of both list with removed duplicates.
2132
+ *
2133
+ * `R.equals` is used to compare for duplication.
2134
+ */
2135
+ export function union<T>(x: T[]): (y: T[]) => T[];
2136
+
2137
+ /**
2138
+ * It returns a new array containing only one copy of each element of `list`.
2139
+ *
2140
+ * `R.equals` is used to determine equality.
2141
+ */
2142
+ export function uniq<T>(list: T[]): T[];
2143
+
2144
+ /**
2145
+ * It applies uniqueness to input list based on function that defines what to be used for comparison between elements.
2146
+ *
2147
+ * `R.equals` is used to determine equality.
2148
+ */
2149
+ export function uniqBy<T, U>(fn: (x: T) => U): (list: T[]) => T[];
2150
+
2151
+ /**
2152
+ * It returns a new array containing only one copy of each element in `list` according to `predicate` function.
2153
+ *
2154
+ * This predicate should return true, if two elements are equal.
2155
+ */
2156
+ export function uniqWith<T>(predicate: (x: T, y: T) => boolean): (list: T[]) => T[];
2157
+
2158
+ /**
2159
+ * The method returns function that will be called with argument `input`.
2160
+ *
2161
+ * If `predicate(input)` returns `false`, then the end result will be the outcome of `whenFalse(input)`.
2162
+ *
2163
+ * In the other case, the final output will be the `input` itself.
2164
+ */
2165
+ export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U): (x: T) => T | U;
2166
+ export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T): (x: T) => T;
2167
+
2168
+ /**
2169
+ * It takes an object and a property name. The method will return a list of objects, where each object is a shallow copy of the input object, but with the property array unwound.
2170
+ */
2171
+ export function unwind<S extends string>(prop: S): <T extends Record<S, readonly any[]>>(obj: T) => Array<MergeTypes<Omit<T, S> & { [K in S]: T[S][number] }>>;
2172
+
2173
+ /**
2174
+ * It returns a copy of `list` with updated element at `index` with `newValue`.
2175
+ */
2176
+ export function update<T>(index: number, newValue: T): (list: T[]) => T[];
2177
+
2178
+ /**
2179
+ * It pass `input` to `predicate` function and if the result is `true`, it will return the result of `whenTrueFn(input)`.
2180
+ * If the `predicate` returns `false`, then it will simply return `input`.
2181
+ */
2182
+ export function when<T, U extends T>(predicate: (x: T) => x is U, whenTrueFn: (x: U) => T): (input: T) => T;
2183
+ export function when<T>(predicate: (x: T) => boolean, whenTrueFn: (x: T) => T): (input: T) => T;
2184
+ export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (x: T) => U): (input: T) => T | U;
2185
+
2186
+ /**
2187
+ * It will return a new array containing tuples of equally positions items from both `x` and `y` lists.
2188
+ *
2189
+ * The returned list will be truncated to match the length of the shortest supplied list.
2190
+ */
2191
+ export function zip<K>(x: K[]): <V>(y: V[]) => KeyValuePair<K, V>[];
2192
+
2193
+ export function zipWith<T, U, TResult>(
2194
+ fn: (x: T, y: U) => TResult,
2195
+ list1: readonly T[],
2196
+ ): (list2: readonly U[]) => TResult[];