/**
 * @example
 * ```ts
 * interface BaseType = {
 *  a: string; b: number
 * };
 *
 * interface BiggerType extends BaseType = {
 * c: string[]
 * }
 * type Bar = BiggerType;
 * // Bar = BiggerType
 *
 * type Bar = Prettify<BiggerType>;
 * // Bar = { a: string; b:  number; c: string[]; }
 * ```
 */
export type Prettify<T> = {
	[K in keyof T]: T[K];
} & {};
//

export type PrettifyR<T> = T extends object
	? T extends infer O
		? { [K in keyof O]: PrettifyR<O[K]> }
		: never
	: T;

/**
 * @example
 * ```ts
 * interface BaseType = {
 * a: string; b: number
 * };
 *
 * interface NewType  = {
 * a: number
 * }
 *
 * type Bar = Override<BaseType, NewType>;
 * // Bar = { a: number; b: number; }
 *
 * ```
 * */
export type Override<Type, NewType> = Omit<Type, keyof NewType> & NewType;
