UNPKG

1.72 kBTypeScriptView Raw
1import { Iteration } from '../Iteration/Iteration';
2import { IterationOf } from '../Iteration/IterationOf';
3import { Pos } from '../Iteration/Pos';
4import { Next } from '../Iteration/Next';
5import { Length } from '../List/Length';
6import { Cast } from '../Any/Cast';
7import { List } from '../List/List';
8import { Extends } from '../Any/Extends';
9import { Depth } from './_Internal';
10import { Patch } from './Patch';
11import { BuiltIn } from '../Misc/BuiltIn';
12/**
13 * @hidden
14 */
15declare type __PatchAll<O extends object, Os extends List<object>, depth extends Depth, ignore extends object, fill extends any, I extends Iteration = IterationOf<0>> = {
16 0: __PatchAll<Patch<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 _PatchAll<O extends object, Os extends List<object>, depth extends Depth, ignore extends object, fill extends any> = __PatchAll<O, Os, depth, ignore, fill> extends infer X ? Cast<X, object> : never;
23/**
24 * [[Patch]] a list of [[Object]]s into `O`. Patches 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 patch
28 * @param depth (?=`'flat'`) 'deep' to do it deeply
29 * @param ignore (?=`BuiltIn`) types not to merge
30 * @param fill (?=`never`) types of `O` to be replaced with ones of `O1`
31 * @returns [[Object]]
32 * @example
33 * ```ts
34 * ```
35 */
36export declare type PatchAll<O extends object, Os extends List<object>, depth extends Depth = 'flat', ignore extends object = BuiltIn, fill extends any = never> = O extends unknown ? Os extends unknown ? _PatchAll<O, Os, depth, ignore, fill> : never : never;
37export {};