TypeScript 7 · Types
Define an object type
Describe the shape of an object with an interface.
interface User {
id: number;
name: string;
email?: string;
}
Official TypeScript 7 documentation
TypeScript 7 · Types
Describe the shape of an object with an interface.
interface User {
id: number;
name: string;
email?: string;
}
Official TypeScript 7 documentation
Was this page helpful?