UNPKG

929 BTypeScriptView Raw
1import { Merge as OMerge } from '../Object/Merge';
2import { List } from './List';
3import { Depth } from '../Object/_Internal';
4import { BuiltIn } from '../Misc/BuiltIn';
5import { Cast } from '../Any/Cast';
6/**
7 * Accurately merge the fields of `L` with the ones of `L1`. It is
8 * equivalent to the spread operator in JavaScript. [[Union]]s and [[Optional]]
9 * fields will be handled gracefully.
10 *
11 * (⚠️ needs `--strictNullChecks` enabled)
12 * @param L to complete
13 * @param L1 to copy from
14 * @param depth (?=`'flat'`) 'deep' to do it deeply
15 * @param ignore (?=`BuiltIn`) types not to merge
16 * @param fill (?=`undefined`) types of `O` to be replaced with ones of `O1`
17 * @returns [[List]]
18 * @example
19 * ```ts
20 * ```
21 */
22export declare type Merge<L extends List, L1 extends List, depth extends Depth = 'flat', ignore extends object = BuiltIn, fill extends any = undefined> = Cast<OMerge<L, L1, depth, ignore, fill>, List>;