UNPKG

1.72 kBTypeScriptView Raw
1import { Iteration } from '../Iteration/Iteration';
2import { IterationOf } from '../Iteration/IterationOf';
3import { Merge } from './Merge';
4import { Pos } from '../Iteration/Pos';
5import { Next } from '../Iteration/Next';
6import { Length } from '../List/Length';
7import { Cast } from '../Any/Cast';
8import { List } from '../List/List';
9import { Extends } from '../Any/Extends';
10import { Depth } from './_Internal';
11import { BuiltIn } from '../Misc/BuiltIn';
12/**
13 * @hidden
14 */
15declare type __MergeAll<O extends object, Os extends List<object>, depth extends Depth, ignore extends object, fill extends any, I extends Iteration = IterationOf<0>> = {
16 0: __MergeAll<Merge<O, Os[Pos<I>], depth, ignore, fill>, Os, depth, ignore, fill, Next<I>>;
17 1: O;
18}[Extends<Pos<I>, Length<Os>>];
19/**
20 * @hidden
21 */
22export declare type _MergeAll<O extends object, Os extends List<object>, depth extends Depth, ignore extends object, fill extends any> = __MergeAll<O, Os, depth, ignore, fill> extends infer X ? Cast<X, object> : never;
23/**
24 * [[Merge]] a list of [[Object]]s into `O`. Merges from left to right, first
25 * items get completed by the next ones (last-in completes).
26 * @param O to start with
27 * @param Os to merge
28 * @param depth (?=`'flat'`) 'deep' to do it deeply
29 * @param ignore (?=`BuiltIn`) types not to merge
30 * @param fill (?=`undefined`) types of `O` to be replaced with ones of `O1`
31 * @returns [[Object]]
32 * @example
33 * ```ts
34 * ```
35 */
36export declare type MergeAll<O extends object, Os extends List<object>, depth extends Depth = 'flat', ignore extends object = BuiltIn, fill extends any = undefined> = O extends unknown ? Os extends unknown ? _MergeAll<O, Os, depth, ignore, fill> : never : never;
37export {};