UNPKG

423 BTypeScriptView Raw
1import { At } from '../Any/At';
2import { Key } from '../Any/Key';
3/**
4 * Make the fields of `O` union the ones of `O1`
5 * @param O to union from
6 * @param O1 to union with
7 * @param K (?=`Key`) to chose fields
8 * @returns [[Object]]
9 * @example
10 * ```ts
11 * ```
12 */
13export declare type Unionize<O extends object, O1 extends object, K extends Key = Key> = {
14 [P in keyof O]: P extends K ? O[P] | At<O1, P> : O[P];
15} & {};