typescript exlide code example
Example 1: typescript pick
type TodoPreview = Pick<Todo, "title" | "completed">;
Example 2: typescript utility types merge interfaces
interface A {
x: string
}
interface B extends Omit<A, 'x'> {
x: number
}
type TodoPreview = Pick<Todo, "title" | "completed">;
interface A {
x: string
}
interface B extends Omit<A, 'x'> {
x: number
}