Type alias Merged<T1, T2>

Merged<T1, T2>: _MergeResult<T1, T2>

This type represents the result of a merge of two Record<string, any> types T1 and T2, using the following rules: a) If there are no conflicts between T1 and T2, then Merged<T1, T2> equals T1 & T2 b) If there's a conflict between T1 and T2, then Merged<T1, T2> equals { conflicts1: ConflictsFromT1; conflicts2: ConflictsFromT2 } & NoConflicts<T1, T2>

Here are some examples:

   Merged<{
a: string;
}, {
b: number;
c: string;
}> = {
a: string;
b: number;
c: string;
}

Merged<{
a: string;
}, {
a: number;
c: string;
}> = {
conflicts1: {
a: string;
};
conflicts2: {
a: number;
};
c: string;
}
   Merged<{
conflicts1: {
a: string;
};
conflicts2: {
a: number;
};
c: string;
}, {
a: boolean;
c: boolean;
}> = {
conflicts1: {
conflicts1: {
a: string;
};
conflicts2: {
a: number;
};
c: string;
};
conflicts2: {
c: boolean;
};
a: boolean;
}

Type Parameters

  • T1 extends Record<string, any>

  • T2 extends Record<string, any>

Generated using TypeDoc