[d24f17c] | 1 | import { Iteration } from '../Iteration/Iteration';
|
---|
| 2 | import { IterationOf } from '../Iteration/IterationOf';
|
---|
| 3 | import { Merge } from './Merge';
|
---|
| 4 | import { Pos } from '../Iteration/Pos';
|
---|
| 5 | import { Next } from '../Iteration/Next';
|
---|
| 6 | import { Length } from '../List/Length';
|
---|
| 7 | import { Cast } from '../Any/Cast';
|
---|
| 8 | import { List } from '../List/List';
|
---|
| 9 | import { Extends } from '../Any/Extends';
|
---|
| 10 | import { Depth } from './_Internal';
|
---|
| 11 | import { BuiltIn } from '../Misc/BuiltIn';
|
---|
| 12 | /**
|
---|
| 13 | * @hidden
|
---|
| 14 | */
|
---|
| 15 | declare type __Assign<O extends object, Os extends List<object>, depth extends Depth, ignore extends object, fill extends any, I extends Iteration = IterationOf<0>> = {
|
---|
| 16 | 0: __Assign<Merge<Os[Pos<I>], O, depth, ignore, fill>, Os, depth, ignore, fill, Next<I>>;
|
---|
| 17 | 1: O;
|
---|
| 18 | }[Extends<Pos<I>, Length<Os>>];
|
---|
| 19 | /**
|
---|
| 20 | * @hidden
|
---|
| 21 | */
|
---|
| 22 | export declare type _Assign<O extends object, Os extends List<object>, depth extends Depth, ignore extends object, fill extends any> = __Assign<O, Os, depth, ignore, fill> extends infer X ? Cast<X, object> : never;
|
---|
| 23 | /**
|
---|
| 24 | * Assign a list of [[Object]] into `O` with [[Merge]]. Merges from right to
|
---|
| 25 | * left, first items get overridden by the next ones (last-in overrides).
|
---|
| 26 | * @param O to assign to
|
---|
| 27 | * @param Os to assign
|
---|
| 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 | */
|
---|
| 36 | export declare type Assign<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 ? _Assign<O, Os, depth, ignore, fill> : never : never;
|
---|
| 37 | export {};
|
---|