Type Alias Merge<Object1, Object2>

Merges two object types into new type

Type Parameters

  • Object1

    Object to merge into

  • Object2

    Object to merge and override keys from Object1

New object type with keys from Object1 and Object2. If a key exists in both Object1 and Object2, the key from Object2 will be used.

type Result = Merge<{ foo: string }, { foo: number; bar: string }>
// ^? type Result = { foo: number; bar: string }