UNPKG

1.14 kBTypeScriptView Raw
1import { isNonNullObject } from "./objects.js";
2export type TupleToIntersection<T extends any[]> = T extends [infer A] ? A : T extends [infer A, infer B] ? A & B : T extends [infer A, infer B, infer C] ? A & B & C : T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : T extends (infer U)[] ? U : any;
3export declare function mergeDeep<T extends any[]>(...sources: T): TupleToIntersection<T>;
4export declare function mergeDeepArray<T>(sources: T[]): T;
5export type ReconcilerFunction<TContextArgs extends any[]> = (this: DeepMerger<TContextArgs>, target: Record<string | number, any>, source: Record<string | number, any>, property: string | number, ...context: TContextArgs) => any;
6export declare class DeepMerger<TContextArgs extends any[]> {
7 private reconciler;
8 constructor(reconciler?: ReconcilerFunction<TContextArgs>);
9 merge(target: any, source: any, ...context: TContextArgs): any;
10 isObject: typeof isNonNullObject;
11 private pastCopies;
12 shallowCopyForMerge<T>(value: T): T;
13}
14//# sourceMappingURL=mergeDeep.d.ts.map
\No newline at end of file