Effectively Using Type Assertions
type Person = {
name: string;
age: number;
};
const ppl: Person[] = await fetch("/api/people").then((res) => res.json());
type Person = {
name: string;
age: number;
};
const ppl: Person[] = await fetch("/api/people").then((res) => res.json());