Utility Type

Partial

interface Todo {
  title: string;
  desc: string;
}

type Test = Partial<Todo>
// {title?:string; desc?:string}

Required

interface Props {
  a?: number;
  b?: string;
}

type Test = Required<Props>

// {a:number; b: string}

Record

Omit

Last updated

Was this helpful?