1 | export type RambdaTypes = "Object" | "Number" | "Boolean" | "String" | "Null" | "Array" | "RegExp" | "NaN" | "Function" | "Undefined" | "Async" | "Promise" | "Symbol" | "Set" | "Error";
|
2 |
|
3 | export type IndexedIterator<T, U> = (x: T, i: number) => U;
|
4 | export type Iterator<T, U> = (x: T) => U;
|
5 | export type ObjectIterator<T, U> = (x: T, prop: string, inputObj: Dictionary<T>) => U;
|
6 | type Ord = number | string | boolean | Date;
|
7 | type Path = string | readonly (number | string)[];
|
8 | type Predicate<T> = (x: T) => boolean;
|
9 | export type IndexedPredicate<T> = (x: T, i: number) => boolean;
|
10 | export type ObjectPredicate<T> = (x: T, prop: string, inputObj: Dictionary<T>) => boolean;
|
11 | export type RamdaPath = readonly (number | string)[];
|
12 | type CondPair<T extends readonly any[], R> = readonly [(...val: T) => boolean, (...val: T) => R]
|
13 |
|
14 | type ValueOfRecord<R> =
|
15 | R extends Record<any, infer T>
|
16 | ? T
|
17 | : never;
|
18 |
|
19 | interface KeyValuePair<K, V> extends Array<K | V> {
|
20 | readonly 0: K;
|
21 | readonly 1: V;
|
22 | }
|
23 |
|
24 | export interface Lens {
|
25 | <T, U>(obj: T): U;
|
26 | set<T, U>(str: string, obj: T): U;
|
27 | }
|
28 |
|
29 | type Arity1Fn = (x: any) => any;
|
30 | type Arity2Fn = (x: any, y: any) => any;
|
31 |
|
32 | type Pred = (...x: readonly any[]) => boolean;
|
33 | type SafePred<T> = (...x: readonly T[]) => boolean;
|
34 |
|
35 | export interface Dictionary<T> {readonly [index: string]: T}
|
36 | type Partial<T> = { readonly [P in keyof T]?: T[P]};
|
37 |
|
38 | type Evolvable<E extends Evolver> = { readonly [P in keyof E]?: Evolved<E[P]>;
|
39 | };
|
40 |
|
41 | type Evolver<T extends Evolvable<any> = any> = { readonly [key in keyof Partial<T>]: ((value: T[key]) => T[key]) | (T[key] extends Evolvable<any> ? Evolver<T[key]> : never);
|
42 | };
|
43 |
|
44 | type Evolve<O extends Evolvable<E>, E extends Evolver> = { readonly [P in keyof O]: P extends keyof E
|
45 | ? EvolveValue<O[P], E[P]>
|
46 | : O[P];
|
47 | };
|
48 |
|
49 | type Evolved<A> =
|
50 | A extends (value: infer V) => any
|
51 | ? V
|
52 | : A extends Evolver
|
53 | ? Evolvable<A>
|
54 | : never;
|
55 |
|
56 | type EvolveNestedValue<O, E extends Evolver> =
|
57 | O extends object
|
58 | ? O extends Evolvable<E>
|
59 | ? Evolve<O, E>
|
60 | : never
|
61 | : never;
|
62 |
|
63 | type EvolveValue<V, E> =
|
64 | E extends (value: V) => any
|
65 | ? ReturnType<E>
|
66 | : E extends Evolver
|
67 | ? EvolveNestedValue<V, E>
|
68 | : never;
|
69 |
|
70 | interface AssocPartialOne<K extends keyof any> {
|
71 | <T>(val: T): <U>(obj: U) => Record<K, T> & U;
|
72 | <T, U>(val: T, obj: U): Record<K, T> & U;
|
73 | }
|
74 |
|
75 |
|
76 |
|
77 | type Func<T> = (input: any) => T;
|
78 | type VoidInputFunc<T> = () => T;
|
79 | type Fn<In, Out> = (x: In) => Out;
|
80 | type SortObjectPredicate<T> = (aProp: string, bProp: string, aValue: T, bValue: T) => number;
|
81 |
|
82 | type IdentityFunction<T> = (x: T) => T;
|
83 |
|
84 | interface Filter<T> {
|
85 | (list: readonly T[]): readonly T[];
|
86 | (obj: Dictionary<T>): Dictionary<T>;
|
87 | }
|
88 |
|
89 | type ArgumentTypes<T> = T extends (...args: infer U) => infer R ? U : never;
|
90 | type isfn<T> = (x: any, y: any) => T;
|
91 |
|
92 | interface Switchem<T> {
|
93 | readonly is: isfn<Switchem<T>>;
|
94 | readonly default: IdentityFunction<T>;
|
95 | }
|
96 |
|
97 | interface Schema {
|
98 | readonly [key: string]: any;
|
99 | }
|
100 |
|
101 | interface SchemaAsync {
|
102 | readonly [key: string]: Promise<boolean>;
|
103 | }
|
104 |
|
105 | interface IsValid {
|
106 | readonly input: object;
|
107 | readonly schema: Schema;
|
108 | }
|
109 |
|
110 | interface IsValidAsync {
|
111 | readonly input: object;
|
112 | readonly schema: Schema | SchemaAsync;
|
113 | }
|
114 |
|
115 | type ProduceRules<Output,K extends keyof Output, Input> = { readonly [P in K]: (input: Input) => Output[P];
|
116 | };
|
117 | type ProduceAsyncRules<Output,K extends keyof Output, Input> = { readonly [P in K]: (input: Input) => Promise<Output[P]>;
|
118 | };
|
119 | type ProduceAsyncRule<Input> = (input: Input) => Promise<any>;
|
120 | type Async<T> = (x: any) => Promise<T>;
|
121 | type AsyncIterable<T, K> = (x: T) => Promise<K>;
|
122 | type AsyncIterableIndexed<T, K> = (x: T, i: number) => Promise<K>;
|
123 | type AsyncPredicate<T> = (x: T) => Promise<boolean>;
|
124 | type AsyncPredicateIndexed<T> = (x: T, i: number) => Promise<boolean>;
|
125 | type AsyncWithProp<T> = (x: any, prop?: string) => Promise<T>;
|
126 |
|
127 | type ApplyDiffUpdate = {readonly op:'update', readonly path: string, readonly value: any};
|
128 | type ApplyDiffAdd = {readonly op:'add', readonly path: string, readonly value: any};
|
129 | type ApplyDiffRemove = {readonly op:'remove', readonly path: string};
|
130 | type ApplyDiffRule = ApplyDiffUpdate | ApplyDiffAdd | ApplyDiffRemove;
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | export function add(a: number, b: number): number;
|
137 | export function add(a: number): (b: number) => number;
|
138 |
|
139 |
|
140 |
|
141 |
|
142 | export function adjust<T>(index: number, replaceFn: (x: T) => T, list: readonly T[]): readonly T[];
|
143 | export function adjust<T>(index: number, replaceFn: (x: T) => T): (list: readonly T[]) => readonly T[];
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | export function all<T>(predicate: (x: T) => boolean, list: readonly T[]): boolean;
|
149 | export function all<T>(predicate: (x: T) => boolean): (list: readonly T[]) => boolean;
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | export function allPass<T>(predicates: readonly ((x: T) => boolean)[]): (input: T) => boolean;
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | export function always<T>(x: T): (...args: readonly unknown[]) => T;
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | export function and<T, U>(x: T, y: U): T | U;
|
165 | export function and<T>(x: T): <U>(y: U) => T | U;
|
166 |
|
167 |
|
168 |
|
169 |
|
170 | export function or<T, U>(a: T, b: U): T | U;
|
171 | export function or<T>(a: T): <U>(b: U) => T | U;
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | export function any<T>(predicate: (x: T) => boolean, list: readonly T[]): boolean;
|
177 | export function any<T>(predicate: (x: T) => boolean): (list: readonly T[]) => boolean;
|
178 |
|
179 |
|
180 |
|
181 |
|
182 | export function anyPass<T>(predicates: readonly SafePred<T>[]): SafePred<T>;
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | export function append<T>(x: T, list: readonly T[]): readonly T[];
|
188 | export function append<T>(x: T): <T>(list: readonly T[]) => readonly T[];
|
189 |
|
190 | export function applySpec<Spec extends Record<string, (...args: readonly any[]) => any>>(
|
191 | spec: Spec
|
192 | ): (
|
193 | ...args: Parameters<ValueOfRecord<Spec>>
|
194 | ) => { readonly [Key in keyof Spec]: ReturnType<Spec[Key]> };
|
195 | export function applySpec<T>(spec: any): (...args: readonly any[]) => T;
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | export function assoc<T, U, K extends string>(prop: K, val: T, obj: U): Record<K, T> & Omit<U, K>;
|
201 | export function assoc<T, K extends string>(prop: K, val: T): <U>(obj: U) => Record<K, T> & Omit<U, K>;
|
202 | export function assoc<K extends string>(prop: K): AssocPartialOne<K>;
|
203 |
|
204 |
|
205 |
|
206 |
|
207 | export function assocPath<Output>(path: Path, newValue: any, obj: object): Output;
|
208 | export function assocPath<Output>(path: Path, newValue: any): (obj: object) => Output;
|
209 | export function assocPath<Output>(path: Path): (newValue: any) => (obj: object) => Output;
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | export function both(pred1: Pred, pred2: Pred): Pred;
|
217 | export function both<T>(pred1: Predicate<T>, pred2: Predicate<T>): Predicate<T>;
|
218 | export function both<T>(pred1: Predicate<T>): (pred2: Predicate<T>) => Predicate<T>;
|
219 | export function both(pred1: Pred): (pred2: Pred) => Pred;
|
220 |
|
221 |
|
222 |
|
223 |
|
224 | export function chain<T, U>(fn: (n: T) => readonly U[], list: readonly T[]): readonly U[];
|
225 | export function chain<T, U>(fn: (n: T) => readonly U[]): (list: readonly T[]) => readonly U[];
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 | export function clamp(min: number, max: number, input: number): number;
|
235 | export function clamp(min: number, max: number): (input: number) => number;
|
236 |
|
237 |
|
238 |
|
239 |
|
240 | export function clone<T>(input: T): T;
|
241 | export function clone<T>(input: readonly T[]): readonly T[];
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 | export function complement<T extends readonly any[]>(predicate: (...args: T) => unknown): (...args: T) => boolean;
|
249 |
|
250 |
|
251 |
|
252 |
|
253 | export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
|
254 | ...func: readonly [
|
255 | fnLast: (a: any) => TResult,
|
256 | ...func: ReadonlyArray<(a: any) => any>,
|
257 | f7: (a: R6) => R7,
|
258 | f6: (a: R5) => R6,
|
259 | f5: (a: R4) => R5,
|
260 | f4: (a: R3) => R4,
|
261 | f3: (a: R2) => R3,
|
262 | f2: (a: R1) => R2,
|
263 | f1: (...args: TArgs) => R1
|
264 | ]
|
265 | ): (...args: TArgs) => TResult;
|
266 | export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
|
267 | f7: (a: R6) => R7,
|
268 | f6: (a: R5) => R6,
|
269 | f5: (a: R4) => R5,
|
270 | f4: (a: R3) => R4,
|
271 | f3: (a: R2) => R3,
|
272 | f2: (a: R1) => R2,
|
273 | f1: (...args: TArgs) => R1
|
274 | ): (...args: TArgs) => R7;
|
275 | export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7>(
|
276 | f7: (a: R6) => R7,
|
277 | f6: (a: R5) => R6,
|
278 | f5: (a: R4) => R5,
|
279 | f4: (a: R3) => R4,
|
280 | f3: (a: R2) => R3,
|
281 | f2: (a: R1) => R2,
|
282 | f1: (...args: TArgs) => R1
|
283 | ): (...args: TArgs) => R7;
|
284 | export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6>(
|
285 | f6: (a: R5) => R6,
|
286 | f5: (a: R4) => R5,
|
287 | f4: (a: R3) => R4,
|
288 | f3: (a: R2) => R3,
|
289 | f2: (a: R1) => R2,
|
290 | f1: (...args: TArgs) => R1
|
291 | ): (...args: TArgs) => R6;
|
292 | export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5>(
|
293 | f5: (a: R4) => R5,
|
294 | f4: (a: R3) => R4,
|
295 | f3: (a: R2) => R3,
|
296 | f2: (a: R1) => R2,
|
297 | f1: (...args: TArgs) => R1
|
298 | ): (...args: TArgs) => R5;
|
299 | export function compose<TArgs extends readonly any[], R1, R2, R3, R4>(
|
300 | f4: (a: R3) => R4,
|
301 | f3: (a: R2) => R3,
|
302 | f2: (a: R1) => R2,
|
303 | f1: (...args: TArgs) => R1
|
304 | ): (...args: TArgs) => R4;
|
305 | export function compose<TArgs extends readonly any[], R1, R2, R3>(
|
306 | f3: (a: R2) => R3,
|
307 | f2: (a: R1) => R2,
|
308 | f1: (...args: TArgs) => R1
|
309 | ): (...args: TArgs) => R3;
|
310 | export function compose<TArgs extends readonly any[], R1, R2>(
|
311 | f2: (a: R1) => R2,
|
312 | f1: (...args: TArgs) => R1
|
313 | ): (...args: TArgs) => R2;
|
314 | export function compose<TArgs extends readonly any[], R1>(
|
315 | f1: (...args: TArgs) => R1
|
316 | ): (...args: TArgs) => R1;
|
317 |
|
318 |
|
319 |
|
320 |
|
321 | export function concat<T>(x: readonly T[], y: readonly T[]): readonly T[];
|
322 | export function concat<T>(x: readonly T[]): (y: readonly T[]) => readonly T[];
|
323 | export function concat(x: string, y: string): string;
|
324 | export function concat(x: string): (y: string) => string;
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 | export function cond<T extends readonly any[], R>(conditions: ReadonlyArray<CondPair<T, R>>): (...args: T) => R;
|
336 |
|
337 |
|
338 |
|
339 |
|
340 | export function converge(after: ((...a: readonly any[]) => any), fns: readonly ((...x: readonly any[]) => any)[]): (...y: readonly any[]) => any;
|
341 |
|
342 |
|
343 |
|
344 |
|
345 | export function curry(fn: (...args: readonly any[]) => any): (...a: readonly any[]) => any;
|
346 |
|
347 |
|
348 |
|
349 |
|
350 | export function curryN(length: number, fn: (...args: readonly any[]) => any): (...a: readonly any[]) => any;
|
351 |
|
352 |
|
353 |
|
354 |
|
355 | export function dec(x: number): number;
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 | export function defaultTo<T>(defaultValue: T, input: T | null | undefined): T;
|
363 | export function defaultTo<T>(defaultValue: T): (input: T | null | undefined) => T;
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 | export function difference<T>(a: readonly T[], b: readonly T[]): readonly T[];
|
371 | export function difference<T>(a: readonly T[]): (b: readonly T[]) => readonly T[];
|
372 |
|
373 |
|
374 |
|
375 |
|
376 | export function dissoc<T extends object, K extends keyof T>(prop: K, obj: T): Omit<T, K>;
|
377 | export function dissoc<K extends string | number>(prop: K): <T extends object>(obj: T) => Omit<T, K>;
|
378 |
|
379 | export function divide(x: number, y: number): number;
|
380 | export function divide(x: number): (y: number) => number;
|
381 |
|
382 |
|
383 |
|
384 |
|
385 | export function drop<T>(howMany: number, input: readonly T[]): readonly T[];
|
386 | export function drop(howMany: number, input: string): string;
|
387 | export function drop<T>(howMany: number): {
|
388 | <T>(input: readonly T[]): readonly T[];
|
389 | (input: string): string;
|
390 | };
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | export function dropLast<T>(howMany: number, input: readonly T[]): readonly T[];
|
396 | export function dropLast(howMany: number, input: string): string;
|
397 | export function dropLast<T>(howMany: number): {
|
398 | <T>(input: readonly T[]): readonly T[];
|
399 | (input: string): string;
|
400 | };
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 | export function either(firstPredicate: Pred, secondPredicate: Pred): Pred;
|
408 | export function either<T>(firstPredicate: Predicate<T>, secondPredicate: Predicate<T>): Predicate<T>;
|
409 | export function either<T>(firstPredicate: Predicate<T>): (secondPredicate: Predicate<T>) => Predicate<T>;
|
410 | export function either(firstPredicate: Pred): (secondPredicate: Pred) => Pred;
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 | export function endsWith(target: string, iterable: string): boolean;
|
417 | export function endsWith(target: string): (iterable: string) => boolean;
|
418 | export function endsWith<T>(target: readonly T[], list: readonly T[]): boolean;
|
419 | export function endsWith<T>(target: readonly T[]): (list: readonly T[]) => boolean;
|
420 |
|
421 |
|
422 |
|
423 |
|
424 | export function equals<T>(x: T, y: T): boolean;
|
425 | export function equals<T>(x: T): (y: T) => boolean;
|
426 |
|
427 | export function F(): boolean;
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | export function filter<T>(predicate: Predicate<T>): (input: readonly T[]) => readonly T[];
|
433 | export function filter<T>(predicate: Predicate<T>, input: readonly T[]): readonly T[];
|
434 | export function filter<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;
|
435 | export function filter<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 | export function find<T>(predicate: (x: T) => boolean, list: readonly T[]): T | undefined;
|
443 | export function find<T>(predicate: (x: T) => boolean): (list: readonly T[]) => T | undefined;
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 | export function findIndex<T>(predicate: (x: T) => boolean, list: readonly T[]): number;
|
451 | export function findIndex<T>(predicate: (x: T) => boolean): (list: readonly T[]) => number;
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 | export function findLast<T>(fn: (x: T) => boolean, list: readonly T[]): T | undefined;
|
459 | export function findLast<T>(fn: (x: T) => boolean): (list: readonly T[]) => T | undefined;
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 | export function findLastIndex<T>(predicate: (x: T) => boolean, list: readonly T[]): number;
|
467 | export function findLastIndex<T>(predicate: (x: T) => boolean): (list: readonly T[]) => number;
|
468 |
|
469 |
|
470 |
|
471 |
|
472 | export function flatten<T>(list: readonly any[]): readonly T[];
|
473 |
|
474 |
|
475 |
|
476 |
|
477 | export function flip<T, U, TResult>(fn: (arg0: T, arg1: U) => TResult): (arg1: U, arg0?: T) => TResult;
|
478 |
|
479 |
|
480 |
|
481 |
|
482 | export function forEach<T>(fn: Iterator<T, void>, list: readonly T[]): readonly T[];
|
483 | export function forEach<T>(fn: Iterator<T, void>): (list: readonly T[]) => readonly T[];
|
484 | export function forEach<T>(fn: ObjectIterator<T, void>, list: Dictionary<T>): Dictionary<T>;
|
485 | export function forEach<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<T>;
|
486 |
|
487 |
|
488 |
|
489 |
|
490 | export function fromPairs<V>(listOfPairs: readonly (readonly [number, V])[]): { readonly [index: number]: V };
|
491 | export function fromPairs<V>(listOfPairs: readonly (readonly [string, V])[]): { readonly [index: string]: V };
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | export function groupBy<T>(groupFn: (x: T) => string, list: readonly T[]): { readonly [index: string]: readonly T[] };
|
497 | export function groupBy<T>(groupFn: (x: T) => string): (list: readonly T[]) => { readonly [index: string]: readonly T[] };
|
498 | export function groupBy<T, U>(groupFn: (x: T) => string, list: readonly T[]): U;
|
499 | export function groupBy<T, U>(groupFn: (x: T) => string): (list: readonly T[]) => U;
|
500 |
|
501 |
|
502 |
|
503 |
|
504 | export function groupWith<T>(compareFn: (x: T, y: T) => boolean): (input: readonly T[]) => readonly (readonly T[])[];
|
505 | export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: readonly T[]): readonly (readonly T[])[];
|
506 | export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: string): readonly string[];
|
507 |
|
508 |
|
509 |
|
510 |
|
511 | export function has<T>(prop: string, obj: T): boolean;
|
512 | export function has(prop: string): <T>(obj: T) => boolean;
|
513 |
|
514 |
|
515 |
|
516 |
|
517 | export function hasPath<T>(
|
518 | path: string | readonly string[],
|
519 | input: object
|
520 | ): boolean;
|
521 | export function hasPath<T>(
|
522 | path: string | readonly string[]
|
523 | ): (input: object) => boolean;
|
524 |
|
525 |
|
526 |
|
527 |
|
528 | export function head(input: string): string;
|
529 | export function head(emptyList: readonly []): undefined;
|
530 | export function head<T>(input: readonly T[]): T | undefined;
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 | export function identical<T>(x: T, y: T): boolean;
|
538 | export function identical<T>(x: T): (y: T) => boolean;
|
539 |
|
540 |
|
541 |
|
542 |
|
543 | export function identity<T>(input: T): T;
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | export function ifElse<TArgs extends readonly any[], TOnTrueResult, TOnFalseResult>(fn: (...args: TArgs) => boolean, onTrue: (...args: TArgs) => TOnTrueResult, onFalse: (...args: TArgs) => TOnFalseResult): (...args: TArgs) => TOnTrueResult | TOnFalseResult;
|
551 |
|
552 |
|
553 |
|
554 |
|
555 | export function inc(x: number): number;
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 | export function includes(valueToFind: string, input: readonly string[] | string): boolean;
|
563 | export function includes(valueToFind: string): (input: readonly string[] | string) => boolean;
|
564 | export function includes<T>(valueToFind: T, input: readonly T[]): boolean;
|
565 | export function includes<T>(valueToFind: T): (input: readonly T[]) => boolean;
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 | export function indexBy<T, K extends string | number = string>(condition: (key: T) => K, list: readonly T[]): { readonly [key in K]: T };
|
575 | export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K, list: readonly T[]): { readonly [key in NonNullable<K>]?: T };
|
576 | export function indexBy<T, K extends string | number = string>(condition: (key: T) => K): (list: readonly T[]) => { readonly [key in K]: T };
|
577 | export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K | undefined): (list: readonly T[]) => { readonly [key in NonNullable<K>]?: T };
|
578 | export function indexBy<T>(condition: string, list: readonly T[]): { readonly [key: string]: T };
|
579 | export function indexBy<T>(condition: string): (list: readonly T[]) => { readonly [key: string]: T };
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 | export function indexOf<T>(valueToFind: T, list: readonly T[]): number;
|
587 | export function indexOf<T>(valueToFind: T): (list: readonly T[]) => number;
|
588 |
|
589 |
|
590 |
|
591 |
|
592 | export function init<T>(input: readonly T[]): readonly T[];
|
593 | export function init(input: string): string;
|
594 |
|
595 |
|
596 |
|
597 |
|
598 | export function intersection<T>(listA: readonly T[], listB: readonly T[]): readonly T[];
|
599 | export function intersection<T>(listA: readonly T[]): (listB: readonly T[]) => readonly T[];
|
600 |
|
601 |
|
602 |
|
603 |
|
604 | export function intersperse<T>(separator: T, list: readonly T[]): readonly T[];
|
605 | export function intersperse<T>(separator: T): (list: readonly T[]) => readonly T[];
|
606 |
|
607 |
|
608 |
|
609 |
|
610 | export function is<C extends () => any>(targetPrototype: C, val: any): val is ReturnType<C>;
|
611 | export function is<C extends new () => any>(targetPrototype: C, val: any): val is InstanceType<C>;
|
612 | export function is<C extends () => any>(targetPrototype: C): (val: any) => val is ReturnType<C>;
|
613 | export function is<C extends new () => any>(targetPrototype: C): (val: any) => val is InstanceType<C>;
|
614 |
|
615 |
|
616 |
|
617 |
|
618 | export function isEmpty<T>(x: T): boolean;
|
619 |
|
620 |
|
621 |
|
622 |
|
623 | export function isNil(x: any): x is null | undefined;
|
624 |
|
625 |
|
626 |
|
627 |
|
628 | export function join<T>(glue: string, list: readonly T[]): string;
|
629 | export function join<T>(glue: string): (list: readonly T[]) => string;
|
630 |
|
631 |
|
632 |
|
633 |
|
634 | export function keys<T extends object>(x: T): readonly (keyof T)[];
|
635 | export function keys<T>(x: T): readonly string[];
|
636 |
|
637 |
|
638 |
|
639 |
|
640 | export function last(str: string): string;
|
641 | export function last(emptyList: readonly []): undefined;
|
642 | export function last<T extends any>(list: readonly T[]): T | undefined;
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 | export function lastIndexOf<T>(target: T, list: readonly T[]): number;
|
652 | export function lastIndexOf<T>(target: T): (list: readonly T[]) => number;
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | export function length<T>(input: readonly T[]): number;
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 | export function lens<T, U, V>(getter: (s: T) => U, setter: (a: U, s: T) => V): Lens;
|
667 |
|
668 |
|
669 |
|
670 |
|
671 | export function lensIndex(index: number): Lens;
|
672 |
|
673 |
|
674 |
|
675 |
|
676 | export function lensPath(path: RamdaPath): Lens;
|
677 | export function lensPath(path: string): Lens;
|
678 |
|
679 |
|
680 |
|
681 |
|
682 | export function lensProp(prop: string): {
|
683 | <T, U>(obj: T): U;
|
684 | set<T, U, V>(val: T, obj: U): V;
|
685 | };
|
686 |
|
687 |
|
688 |
|
689 |
|
690 | export function over<T>(lens: Lens, fn: Arity1Fn, value: T): T;
|
691 | export function over<T>(lens: Lens, fn: Arity1Fn, value: readonly T[]): readonly T[];
|
692 | export function over(lens: Lens, fn: Arity1Fn): <T>(value: T) => T;
|
693 | export function over(lens: Lens, fn: Arity1Fn): <T>(value: readonly T[]) => readonly T[];
|
694 | export function over(lens: Lens): <T>(fn: Arity1Fn, value: T) => T;
|
695 | export function over(lens: Lens): <T>(fn: Arity1Fn, value: readonly T[]) => readonly T[];
|
696 |
|
697 |
|
698 |
|
699 |
|
700 | export function set<T, U>(lens: Lens, replacer: U, obj: T): T;
|
701 | export function set<U>(lens: Lens, replacer: U): <T>(obj: T) => T;
|
702 | export function set(lens: Lens): <T, U>(replacer: U, obj: T) => T;
|
703 |
|
704 |
|
705 |
|
706 |
|
707 | export function view<T, U>(lens: Lens): (target: T) => U;
|
708 | export function view<T, U>(lens: Lens, target: T): U;
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 | export function map<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;
|
716 | export function map<T, U>(fn: Iterator<T, U>, iterable: readonly T[]): readonly U[];
|
717 | export function map<T, U>(fn: Iterator<T, U>): (iterable: readonly T[]) => readonly U[];
|
718 | export function map<T, U, S>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
|
719 | export function map<T>(fn: Iterator<T, T>): (iterable: readonly T[]) => readonly T[];
|
720 | export function map<T>(fn: Iterator<T, T>, iterable: readonly T[]): readonly T[];
|
721 |
|
722 |
|
723 |
|
724 |
|
725 | export function mapObjIndexed<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;
|
726 | export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;
|
727 | export function mapObjIndexed<T>(fn: ObjectIterator<T, T>): (iterable: Dictionary<T>) => Dictionary<T>;
|
728 | export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
|
729 |
|
730 |
|
731 |
|
732 |
|
733 | export function match(regExpression: RegExp, str: string): readonly string[];
|
734 | export function match(regExpression: RegExp): (str: string) => readonly string[];
|
735 |
|
736 |
|
737 |
|
738 |
|
739 | export function mathMod(x: number, y: number): number;
|
740 | export function mathMod(x: number): (y: number) => number;
|
741 |
|
742 |
|
743 |
|
744 |
|
745 | export function max<T extends Ord>(x: T, y: T): T;
|
746 | export function max<T extends Ord>(x: T): (y: T) => T;
|
747 |
|
748 |
|
749 |
|
750 |
|
751 | export function maxBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;
|
752 | export function maxBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;
|
753 | export function maxBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;
|
754 |
|
755 |
|
756 |
|
757 |
|
758 | export function mean(list: readonly number[]): number;
|
759 |
|
760 |
|
761 |
|
762 |
|
763 | export function median(list: readonly number[]): number;
|
764 |
|
765 |
|
766 |
|
767 |
|
768 | export function merge<A, B>(target: A, newProps: B): A & B
|
769 | export function merge<Output>(target: any): (newProps: any) => Output;
|
770 |
|
771 | /**
|
772 | * It merges all objects of `list` array sequentially and returns the result.
|
773 | */
|
774 | export function mergeAll<T>(list: readonly object[]): T;
|
775 | export function mergeAll(list: readonly object[]): object;
|
776 |
|
777 | /**
|
778 | * Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:
|
779 | *
|
780 | * - and both values are objects, the two values will be recursively merged
|
781 | * - otherwise the value from the second object will be used.
|
782 | */
|
783 | export function mergeDeepRight<Output>(target: object, newProps: object): Output;
|
784 | export function mergeDeepRight<Output>(target: object): (newProps: object) => Output;
|
785 |
|
786 | /**
|
787 | * Same as `R.merge`, but in opposite direction.
|
788 | */
|
789 | export function mergeLeft<Output>(newProps: object, target: object): Output;
|
790 | export function mergeLeft<Output>(newProps: object): (target: object) => Output;
|
791 |
|
792 | /**
|
793 | * It returns the lesser value between `x` and `y`.
|
794 | */
|
795 | export function min<T extends Ord>(x: T, y: T): T;
|
796 | export function min<T extends Ord>(x: T): (y: T) => T;
|
797 |
|
798 | /**
|
799 | * It returns the lesser value between `x` and `y` according to `compareFn` function.
|
800 | */
|
801 | export function minBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;
|
802 | export function minBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;
|
803 | export function minBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;
|
804 |
|
805 | /**
|
806 | * Curried version of `x%y`.
|
807 | */
|
808 | export function modulo(x: number, y: number): number;
|
809 | export function modulo(x: number): (y: number) => number;
|
810 |
|
811 |
|
812 |
|
813 |
|
814 | export function move<T>(fromIndex: number, toIndex: number, list: readonly T[]): readonly T[];
|
815 | export function move(fromIndex: number, toIndex: number): <T>(list: readonly T[]) => readonly T[];
|
816 | export function move(fromIndex: number): {
|
817 | <T>(toIndex: number, list: readonly T[]): readonly T[];
|
818 | (toIndex: number): <T>(list: readonly T[]) => readonly T[];
|
819 | };
|
820 |
|
821 |
|
822 |
|
823 |
|
824 | export function multiply(x: number, y: number): number;
|
825 | export function multiply(x: number): (y: number) => number;
|
826 |
|
827 | export function negate(x: number): number;
|
828 |
|
829 |
|
830 |
|
831 |
|
832 | export function none<T>(predicate: (x: T) => boolean, list: readonly T[]): boolean;
|
833 | export function none<T>(predicate: (x: T) => boolean): (list: readonly T[]) => boolean;
|
834 |
|
835 |
|
836 |
|
837 |
|
838 | export function not(input: any): boolean;
|
839 |
|
840 |
|
841 |
|
842 |
|
843 | export function nth<T>(index: number, list: readonly T[]): T | undefined;
|
844 | export function nth(index: number): <T>(list: readonly T[]) => T | undefined;
|
845 |
|
846 |
|
847 |
|
848 |
|
849 | export function objOf<T, K extends string>(key: K, value: T): Record<K, T>;
|
850 | export function objOf<K extends string>(key: K): <T>(value: T) => Record<K, T>;
|
851 |
|
852 |
|
853 |
|
854 |
|
855 | export function once<T extends (...args: readonly any[]) => any>(func: T): T;
|
856 |
|
857 |
|
858 |
|
859 |
|
860 | export function omit<T, K extends string>(propsToOmit: readonly K[], obj: T): Omit<T, K>;
|
861 | export function omit<K extends string>(propsToOmit: readonly K[]): <T>(obj: T) => Omit<T, K>;
|
862 | export function omit<T, U>(propsToOmit: string, obj: T): U;
|
863 | export function omit<T, U>(propsToOmit: string): (obj: T) => U;
|
864 | export function omit<T>(propsToOmit: string, obj: object): T;
|
865 | export function omit<T>(propsToOmit: string): (obj: object) => T;
|
866 |
|
867 | export function of<T>(x: T): readonly T[];
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 | export function partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: readonly [V0]): (x1: V1) => T;
|
876 | export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: readonly [V0, V1]): (x2: V2) => T;
|
877 | export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: readonly [V0]): (x1: V1, x2: V2) => T;
|
878 | export function partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: readonly [V0, V1, V2]): (x2: V3) => T;
|
879 | export function partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: readonly [V0, V1]): (x2: V2, x3: V3) => T;
|
880 | export function partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: readonly [V0]): (x1: V1, x2: V2, x3: V3) => T;
|
881 | export function partial<T>(fn: (...a: readonly any[]) => T, args: readonly any[]): (...x: readonly any[]) => T;
|
882 |
|
883 |
|
884 |
|
885 |
|
886 | export function partition<T>(
|
887 | predicate: Predicate<T>,
|
888 | input: readonly T[]
|
889 | ): readonly [readonly T[], readonly T[]];
|
890 | export function partition<T>(
|
891 | predicate: Predicate<T>
|
892 | ): (input: readonly T[]) => readonly [readonly T[], readonly T[]];
|
893 | export function partition<T>(
|
894 | predicate: (x: T, prop?: string) => boolean,
|
895 | input: { readonly [key: string]: T}
|
896 | ): readonly [{ readonly [key: string]: T}, { readonly [key: string]: T}];
|
897 | export function partition<T>(
|
898 | predicate: (x: T, prop?: string) => boolean
|
899 | ): (input: { readonly [key: string]: T}) => readonly [{ readonly [key: string]: T}, { readonly [key: string]: T}];
|
900 |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 | export function path<Input, T>(pathToSearch: Path, obj: Input): T | undefined;
|
907 | export function path<T>(pathToSearch: Path, obj: any): T | undefined;
|
908 | export function path<T>(pathToSearch: Path): (obj: any) => T | undefined;
|
909 | export function path<Input, T>(pathToSearch: Path): (obj: Input) => T | undefined;
|
910 |
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 | export function pathEq(pathToSearch: Path, target: any, input: any): boolean;
|
917 | export function pathEq(pathToSearch: Path, target: any): (input: any) => boolean;
|
918 | export function pathEq(pathToSearch: Path): (target: any) => (input: any) => boolean;
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 | export function paths<Input, T>(pathsToSearch: readonly Path[], obj: Input): readonly (T | undefined)[];
|
926 | export function paths<Input, T>(pathsToSearch: readonly Path[]): (obj: Input) => readonly (T | undefined)[];
|
927 | export function paths<T>(pathsToSearch: readonly Path[], obj: any): readonly (T | undefined)[];
|
928 | export function paths<T>(pathsToSearch: readonly Path[]): (obj: any) => readonly (T | undefined)[];
|
929 |
|
930 |
|
931 |
|
932 |
|
933 | export function pathOr<T>(defaultValue: T, pathToSearch: Path, obj: any): T;
|
934 | export function pathOr<T>(defaultValue: T, pathToSearch: Path): (obj: any) => T;
|
935 | export function pathOr<T>(defaultValue: T): (pathToSearch: Path) => (obj: any) => T;
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 |
|
944 | export function pick<T, K extends string | number | symbol>(propsToPick: readonly K[], input: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
|
945 | export function pick<K extends string | number | symbol>(propsToPick: readonly K[]): <T>(input: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;
|
946 | export function pick<T, U>(propsToPick: string, input: T): U;
|
947 | export function pick<T, U>(propsToPick: string): (input: T) => U;
|
948 | export function pick<T>(propsToPick: string, input: object): T;
|
949 | export function pick<T>(propsToPick: string): (input: object) => T;
|
950 |
|
951 |
|
952 |
|
953 |
|
954 | export function pickAll<T, U>(propsToPick: readonly string[], input: T): U;
|
955 | export function pickAll<T, U>(propsToPick: readonly string[]): (input: T) => U;
|
956 | export function pickAll<T, U>(propsToPick: string, input: T): U;
|
957 | export function pickAll<T, U>(propsToPick: string): (input: T) => U;
|
958 |
|
959 |
|
960 |
|
961 |
|
962 | export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
|
963 | ...funcs: readonly [
|
964 | f1: (...args: TArgs) => R1,
|
965 | f2: (a: R1) => R2,
|
966 | f3: (a: R2) => R3,
|
967 | f4: (a: R3) => R4,
|
968 | f5: (a: R4) => R5,
|
969 | f6: (a: R5) => R6,
|
970 | f7: (a: R6) => R7,
|
971 | ...func: ReadonlyArray<(a: any) => any>,
|
972 | fnLast: (a: any) => TResult
|
973 | ]
|
974 | ): (...args: TArgs) => TResult;
|
975 | export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7>(
|
976 | f1: (...args: TArgs) => R1,
|
977 | f2: (a: R1) => R2,
|
978 | f3: (a: R2) => R3,
|
979 | f4: (a: R3) => R4,
|
980 | f5: (a: R4) => R5,
|
981 | f6: (a: R5) => R6,
|
982 | f7: (a: R6) => R7
|
983 | ): (...args: TArgs) => R7;
|
984 | export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6>(
|
985 | f1: (...args: TArgs) => R1,
|
986 | f2: (a: R1) => R2,
|
987 | f3: (a: R2) => R3,
|
988 | f4: (a: R3) => R4,
|
989 | f5: (a: R4) => R5,
|
990 | f6: (a: R5) => R6
|
991 | ): (...args: TArgs) => R6;
|
992 | export function pipe<TArgs extends readonly any[], R1, R2, R3, R4, R5>(
|
993 | f1: (...args: TArgs) => R1,
|
994 | f2: (a: R1) => R2,
|
995 | f3: (a: R2) => R3,
|
996 | f4: (a: R3) => R4,
|
997 | f5: (a: R4) => R5
|
998 | ): (...args: TArgs) => R5;
|
999 | export function pipe<TArgs extends readonly any[], R1, R2, R3, R4>(
|
1000 | f1: (...args: TArgs) => R1,
|
1001 | f2: (a: R1) => R2,
|
1002 | f3: (a: R2) => R3,
|
1003 | f4: (a: R3) => R4
|
1004 | ): (...args: TArgs) => R4;
|
1005 | export function pipe<TArgs extends readonly any[], R1, R2, R3>(
|
1006 | f1: (...args: TArgs) => R1,
|
1007 | f2: (a: R1) => R2,
|
1008 | f3: (a: R2) => R3
|
1009 | ): (...args: TArgs) => R3;
|
1010 | export function pipe<TArgs extends readonly any[], R1, R2>(
|
1011 | f1: (...args: TArgs) => R1,
|
1012 | f2: (a: R1) => R2
|
1013 | ): (...args: TArgs) => R2;
|
1014 | export function pipe<TArgs extends readonly any[], R1>(
|
1015 | f1: (...args: TArgs) => R1
|
1016 | ): (...args: TArgs) => R1;
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 | export function pluck<K extends keyof T, T>(property: K, list: readonly T[]): readonly T[K][];
|
1022 | export function pluck<T>(property: number, list: readonly { readonly [k: number]: T }[]): readonly T[];
|
1023 | export function pluck<P extends string>(property: P): <T>(list: readonly Record<P, T>[]) => readonly T[];
|
1024 | export function pluck(property: number): <T>(list: readonly { readonly [k: number]: T }[]) => readonly T[];
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 | export function prepend<T>(x: T, input: readonly T[]): readonly T[];
|
1030 | export function prepend<T>(x: T): (input: readonly T[]) => readonly T[];
|
1031 |
|
1032 | export function product(list: readonly number[]): number;
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 | export function prop<P extends keyof T, T>(propToFind: P, obj: T): T[P];
|
1040 | export function prop<P extends string | number>(p: P): <T>(propToFind: Record<P, T>) => T;
|
1041 | export function prop<P extends keyof T, T>(p: P): (propToFind: Record<P, T>) => T;
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 | export function propEq<K extends string | number>(propToFind: K, valueToMatch: any, obj: Record<K, any>): boolean;
|
1047 | export function propEq<K extends string | number>(propToFind: K, valueToMatch: any): (obj: Record<K, any>) => boolean;
|
1048 | export function propEq<K extends string | number>(propToFind: K): {
|
1049 | (valueToMatch: any, obj: Record<K, any>): boolean;
|
1050 | (valueToMatch: any): (obj: Record<K, any>) => boolean;
|
1051 | };
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 | export function propIs<C extends (...args: readonly any[]) => any, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, ReturnType<C>>;
|
1057 | export function propIs<C extends new (...args: readonly any[]) => any, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, InstanceType<C>>;
|
1058 | export function propIs<C extends (...args: readonly any[]) => any, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, ReturnType<C>>;
|
1059 | export function propIs<C extends new (...args: readonly any[]) => any, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, InstanceType<C>>;
|
1060 | export function propIs<C extends (...args: readonly any[]) => any>(type: C): {
|
1061 | <K extends keyof any>(name: K, obj: any): obj is Record<K, ReturnType<C>>;
|
1062 | <K extends keyof any>(name: K): (obj: any) => obj is Record<K, ReturnType<C>>;
|
1063 | };
|
1064 | export function propIs<C extends new (...args: readonly any[]) => any>(type: C): {
|
1065 | <K extends keyof any>(name: K, obj: any): obj is Record<K, InstanceType<C>>;
|
1066 | <K extends keyof any>(name: K): (obj: any) => obj is Record<K, InstanceType<C>>;
|
1067 | };
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 | export function propOr<T, P extends string>(defaultValue: T, property: P, obj: Partial<Record<P, T>> | undefined): T;
|
1073 | export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>> | undefined) => T;
|
1074 | export function propOr<T>(defaultValue: T): {
|
1075 | <P extends string>(property: P, obj: Partial<Record<P, T>> | undefined): T;
|
1076 | <P extends string>(property: P): (obj: Partial<Record<P, T>> | undefined) => T;
|
1077 | }
|
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 | export function range(startInclusive: number, endExclusive: number): readonly number[];
|
1083 | export function range(startInclusive: number): (endExclusive: number) => readonly number[];
|
1084 |
|
1085 | export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult, list: readonly T[]): TResult;
|
1086 | export function reduce<T, TResult>(reducer: (prev: TResult, current: T) => TResult, initialValue: TResult, list: readonly T[]): TResult;
|
1087 | export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i?: number) => TResult): (initialValue: TResult, list: readonly T[]) => TResult;
|
1088 | export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i?: number) => TResult, initialValue: TResult): (list: readonly T[]) => TResult;
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 | export function reject<T>(predicate: Predicate<T>, list: readonly T[]): readonly T[];
|
1094 | export function reject<T>(predicate: Predicate<T>): (list: readonly T[]) => readonly T[];
|
1095 | export function reject<T>(predicate: Predicate<T>, obj: Dictionary<T>): Dictionary<T>;
|
1096 | export function reject<T, U>(predicate: Predicate<T>): (obj: Dictionary<T>) => Dictionary<T>;
|
1097 |
|
1098 | export function repeat<T>(x: T): (timesToRepeat: number) => readonly T[];
|
1099 | export function repeat<T>(x: T, timesToRepeat: number): readonly T[];
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 | export function replace(strOrRegex: RegExp | string, replacer: string, str: string): string;
|
1105 | export function replace(strOrRegex: RegExp | string, replacer: string): (str: string) => string;
|
1106 | export function replace(strOrRegex: RegExp | string): (replacer: string) => (str: string) => string;
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 | export function reverse<T>(input: readonly T[]): readonly T[];
|
1112 | export function reverse(input: string): string;
|
1113 |
|
1114 | export function slice(from: number, to: number, input: string): string;
|
1115 | export function slice<T>(from: number, to: number, input: readonly T[]): readonly T[];
|
1116 | export function slice(from: number, to: number): {
|
1117 | (input: string): string;
|
1118 | <T>(input: readonly T[]): readonly T[];
|
1119 | };
|
1120 | export function slice(from: number): {
|
1121 | (to: number, input: string): string;
|
1122 | <T>(to: number, input: readonly T[]): readonly T[];
|
1123 | };
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 | export function sort<T>(sortFn: (a: T, b: T) => number, list: readonly T[]): readonly T[];
|
1129 | export function sort<T>(sortFn: (a: T, b: T) => number): (list: readonly T[]) => readonly T[];
|
1130 |
|
1131 |
|
1132 |
|
1133 |
|
1134 | export function sortBy<T>(sortFn: (a: T) => Ord, list: readonly T[]): readonly T[];
|
1135 | export function sortBy<T>(sortFn: (a: T) => Ord): (list: readonly T[]) => readonly T[];
|
1136 | export function sortBy(sortFn: (a: any) => Ord): <T>(list: readonly T[]) => readonly T[];
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 | export function split(separator: string | RegExp): (str: string) => readonly string[];
|
1142 | export function split(separator: string | RegExp, str: string): readonly string[];
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 | export function splitEvery<T>(sliceLength: number, input: readonly T[]): readonly (readonly T[])[];
|
1148 | export function splitEvery(sliceLength: number, input: string): readonly string[];
|
1149 | export function splitEvery(sliceLength: number): {
|
1150 | (input: string): readonly string[];
|
1151 | <T>(input: readonly T[]): readonly (readonly T[])[];
|
1152 | };
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 | export function startsWith(target: string, str: string): boolean;
|
1159 | export function startsWith(target: string): (str: string) => boolean;
|
1160 | export function startsWith<T>(target: readonly T[], list: readonly T[]): boolean;
|
1161 | export function startsWith<T>(target: readonly T[]): (list: readonly T[]) => boolean;
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 | export function subtract(x: number, y: number): number;
|
1167 | export function subtract(x: number): (y: number) => number;
|
1168 |
|
1169 | export function sum(list: readonly number[]): number;
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 | export function symmetricDifference<T>(x: readonly T[], y: readonly T[]): readonly T[];
|
1177 | export function symmetricDifference<T>(x: readonly T[]): <T>(y: readonly T[]) => readonly T[];
|
1178 |
|
1179 | export function T(): boolean;
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 | export function tail<T>(input: readonly T[]): readonly T[];
|
1185 | export function tail(input: string): string;
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 | export function take<T>(howMany: number, input: readonly T[]): readonly T[];
|
1191 | export function take(howMany: number, input: string): string;
|
1192 | export function take<T>(howMany: number): {
|
1193 | <T>(input: readonly T[]): readonly T[];
|
1194 | (input: string): string;
|
1195 | };
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 | export function takeLast<T>(howMany: number, input: readonly T[]): readonly T[];
|
1201 | export function takeLast(howMany: number, input: string): string;
|
1202 | export function takeLast<T>(howMany: number): {
|
1203 | <T>(input: readonly T[]): readonly T[];
|
1204 | (input: string): string;
|
1205 | };
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 | export function tap<T>(fn: (x: T) => void, input: T): T;
|
1213 | export function tap<T>(fn: (x: T) => void): (input: T) => T;
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 | export function test(regExpression: RegExp): (str: string) => boolean;
|
1219 | export function test(regExpression: RegExp, str: string): boolean;
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 | export function times<T>(fn: (i: number) => T, howMany: number): readonly T[];
|
1227 | export function times<T>(fn: (i: number) => T): (howMany: number) => readonly T[];
|
1228 |
|
1229 | export function toLower<S extends string>(str: S): Lowercase<S>;
|
1230 | export function toLower(str: string): string;
|
1231 |
|
1232 | export function toUpper<S extends string>(str: S): Uppercase<S>;
|
1233 | export function toUpper(str: string): string;
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 | export function toPairs<O extends object, K extends Extract<keyof O, string | number>>(obj: O): ReadonlyArray<{ readonly [key in K]: readonly [`${key}`, O[key]] }[K]>;
|
1239 | export function toPairs<S>(obj: Record<string | number, S>): ReadonlyArray<readonly [string, S]>;
|
1240 |
|
1241 | export function toString(x: unknown): string;
|
1242 |
|
1243 | export function transpose<T>(list: readonly (readonly T[])[]): readonly (readonly T[])[];
|
1244 |
|
1245 | export function trim(str: string): string;
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 | export function tryCatch<T, U>(
|
1251 | fn: (input: T) => U,
|
1252 | fallback: U
|
1253 | ): (input: T) => U;
|
1254 | export function tryCatch<T, U>(
|
1255 | fn: (input: T) => U,
|
1256 | fallback: (input: T) => U
|
1257 | ): (input: T) => U;
|
1258 | export function tryCatch<T>(
|
1259 | fn: (input: any) => Promise<any>,
|
1260 | fallback: T
|
1261 | ): (input: any) => Promise<T>;
|
1262 | export function tryCatch<T>(
|
1263 | fn: (input: any) => Promise<any>,
|
1264 | fallback: (input: any) => Promise<any>,
|
1265 | ): (input: any) => Promise<T>;
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 | export function type(x: any): RambdaTypes;
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 | export function union<T>(x: readonly T[], y: readonly T[]): readonly T[];
|
1278 | export function union<T>(x: readonly T[]): (y: readonly T[]) => readonly T[];
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 | export function uniq<T>(list: readonly T[]): readonly T[];
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 | export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean, list: readonly T[]): readonly T[];
|
1293 | export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean): (list: readonly T[]) => readonly T[];
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 | export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U, x: T): T | U;
|
1303 | export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U): (x: T) => T | U;
|
1304 | export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T, x: T): T;
|
1305 | export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T): (x: T) => T;
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 | export function update<T>(index: number, newValue: T, list: readonly T[]): readonly T[];
|
1311 | export function update<T>(index: number, newValue: T): (list: readonly T[]) => readonly T[];
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 | export function values<T extends object, K extends keyof T>(obj: T): readonly T[K][];
|
1317 |
|
1318 | export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T | U;
|
1319 | export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U): (input: T) => T | U;
|
1320 | export function when<T, U>(predicate: (x: T) => boolean): ((whenTrueFn: (a: T) => U) => (input: T) => T | U);
|
1321 |
|
1322 |
|
1323 |
|
1324 |
|
1325 | export function where<T, U>(conditions: T, input: U): boolean;
|
1326 | export function where<T>(conditions: T): <U>(input: U) => boolean;
|
1327 | export function where<ObjFunc2, U>(conditions: ObjFunc2, input: U): boolean;
|
1328 | export function where<ObjFunc2>(conditions: ObjFunc2): <U>(input: U) => boolean;
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 | export function whereEq<T, U>(condition: T, input: U): boolean;
|
1336 | export function whereEq<T>(condition: T): <U>(input: U) => boolean;
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 | export function without<T>(matchAgainst: readonly T[], source: readonly T[]): readonly T[];
|
1344 | export function without<T>(matchAgainst: readonly T[]): (source: readonly T[]) => readonly T[];
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 | export function xor(x: boolean, y: boolean): boolean;
|
1350 | export function xor(y: boolean): (y: boolean) => boolean;
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 | export function zip<K, V>(x: readonly K[], y: readonly V[]): readonly KeyValuePair<K, V>[];
|
1358 | export function zip<K>(x: readonly K[]): <V>(y: readonly V[]) => readonly KeyValuePair<K, V>[];
|
1359 |
|
1360 |
|
1361 |
|
1362 |
|
1363 | export function zipObj<T, K extends string>(keys: readonly K[], values: readonly T[]): { readonly [P in K]: T };
|
1364 | export function zipObj<K extends string>(keys: readonly K[]): <T>(values: readonly T[]) => { readonly [P in K]: T };
|
1365 | export function zipObj<T, K extends number>(keys: readonly K[], values: readonly T[]): { readonly [P in K]: T };
|
1366 | export function zipObj<K extends number>(keys: readonly K[]): <T>(values: readonly T[]) => { readonly [P in K]: T };
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 | export function props<P extends string, T>(propsToPick: readonly P[], obj: Record<P, T>): readonly T[];
|
1372 | export function props<P extends string>(propsToPick: readonly P[]): <T>(obj: Record<P, T>) => readonly T[];
|
1373 | export function props<P extends string, T>(propsToPick: readonly P[]): (obj: Record<P, T>) => readonly T[];
|
1374 |
|
1375 | export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: readonly T[], list2: readonly U[]): readonly TResult[];
|
1376 | export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: readonly T[]): (list2: readonly U[]) => readonly TResult[];
|
1377 | export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult): (list1: readonly T[], list2: readonly U[]) => readonly TResult[];
|
1378 |
|
1379 |
|
1380 |
|
1381 |
|
1382 | export function splitAt<T>(index: number, input: readonly T[]): readonly [readonly T[], readonly T[]];
|
1383 | export function splitAt(index: number, input: string): readonly [string, string];
|
1384 | export function splitAt(index: number): {
|
1385 | <T>(input: readonly T[]): readonly [readonly T[], readonly T[]];
|
1386 | (input: string): readonly [string, string];
|
1387 | };
|
1388 |
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 | export function splitWhen<T, U>(predicate: Predicate<T>, list: readonly U[]): readonly (readonly U[])[];
|
1395 | export function splitWhen<T>(predicate: Predicate<T>): <U>(list: readonly U[]) => readonly (readonly U[])[];
|
1396 |
|
1397 | export function takeLastWhile(predicate: (x: string) => boolean, input: string): string;
|
1398 | export function takeLastWhile(predicate: (x: string) => boolean): (input: string) => string;
|
1399 | export function takeLastWhile<T>(predicate: (x: T) => boolean, input: readonly T[]): readonly T[];
|
1400 | export function takeLastWhile<T>(predicate: (x: T) => boolean): <T>(input: readonly T[]) => readonly T[];
|
1401 |
|
1402 |
|
1403 |
|
1404 |
|
1405 | export function evolve<T, U>(rules: readonly ((x: T) => U)[], list: readonly T[]): readonly U[];
|
1406 | export function evolve<T, U>(rules: readonly ((x: T) => U)[]) : (list: readonly T[]) => readonly U[];
|
1407 | export function evolve<E extends Evolver, V extends Evolvable<E>>(rules: E, obj: V): Evolve<V, E>;
|
1408 | export function evolve<E extends Evolver>(rules: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
|
1409 |
|
1410 | export function dropLastWhile(predicate: (x: string) => boolean, iterable: string): string;
|
1411 | export function dropLastWhile(predicate: (x: string) => boolean): (iterable: string) => string;
|
1412 | export function dropLastWhile<T>(predicate: (x: T) => boolean, iterable: readonly T[]): readonly T[];
|
1413 | export function dropLastWhile<T>(predicate: (x: T) => boolean): <T>(iterable: readonly T[]) => readonly T[];
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 | export function dropRepeats<T>(list: readonly T[]): readonly T[];
|
1419 |
|
1420 | export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean, list: readonly T[]): readonly T[];
|
1421 | export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean): (list: readonly T[]) => readonly T[];
|
1422 |
|
1423 | export function dropWhile(fn: Predicate<string>, iterable: string): string;
|
1424 | export function dropWhile(fn: Predicate<string>): (iterable: string) => string;
|
1425 | export function dropWhile<T>(fn: Predicate<T>, iterable: readonly T[]): readonly T[];
|
1426 | export function dropWhile<T>(fn: Predicate<T>): (iterable: readonly T[]) => readonly T[];
|
1427 |
|
1428 | export function takeWhile(fn: Predicate<string>, iterable: string): string;
|
1429 | export function takeWhile(fn: Predicate<string>): (iterable: string) => string;
|
1430 | export function takeWhile<T>(fn: Predicate<T>, iterable: readonly T[]): readonly T[];
|
1431 | export function takeWhile<T>(fn: Predicate<T>): (iterable: readonly T[]) => readonly T[];
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 | export function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;
|
1437 | export function eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;
|
1438 | export function eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
|
1439 |
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 | export function unapply<T = any>(fn: (args: readonly any[]) => T): (...args: readonly any[]) => T;
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 | export function apply<T = any>(fn: (...args: readonly any[]) => T, args: readonly any[]): T;
|
1453 | export function apply<T = any>(fn: (...args: readonly any[]) => T): (args: readonly any[]) => T;
|
1454 |
|
1455 |
|
1456 |
|
1457 |
|
1458 | export function bind<F extends (...args: readonly any[]) => any, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;
|
1459 | export function bind<F extends (...args: readonly any[]) => any, T>(fn: F): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
|