@flex-development/tutils
Version:
TypeScript utilities
16 lines (15 loc) • 465 B
text/typescript
/**
* @file Type Definitions - Overwrite
* @module tutils/types/Overwrite
*/
import type ObjectPlain from './object-plain.cjs';
/**
* Replaces existing properties in `Obj` with those in `DTO`.
*
* @template Obj - Object to update
* @template DTO - Object to update with
*/
declare type Overwrite<Obj extends ObjectPlain, DTO extends ObjectPlain> = {
[K in keyof Obj]: K extends keyof DTO ? DTO[K] : Obj[K];
} & {};
export { type Overwrite as default };