typescript extend pick code example
Example 1: typescript record
interface PageInfo {
title: string;
}
type Page = "home" | "about" | "contact";
const nav: Record<Page, PageInfo> = {
about: { title: "about" },
contact: { title: "contact" },
home: { title: "home" },
};
nav.about;
// ^ = Could not get LSP result: v.a>bTry
Example 2: typescript pick
type TodoPreview = Pick<Todo, "title" | "completed">;