Type alias ReplaceType<Input, Keys, NewType>

ReplaceType<Input, Keys, NewType>: Omit<Input, Keys> & ReadOnlyRecord<NewType, Keys>

Replaces the type of some keys in given Input.

Example

type User = { name: string; age: number };
type ReallyOldUser = ReplaceType<User, "age", bigint>;

Type Parameters

  • Input

  • Keys extends keyof Input

  • NewType