mirror of
https://github.com/vercel/next-learn.git
synced 2026-07-08 14:35:16 +00:00
* Run create-next-app * Add READMEs * Remove stuff we don't need * Add dummy data * Add types for dummy data * Add dummy routes * Remove unused CSS * Split dummy data and definitions
24 lines
539 B
TypeScript
24 lines
539 B
TypeScript
// This file contains type definitions for you data.
|
|
// These describe the shape of the data, and what data type each property should accept.
|
|
|
|
export type User = {
|
|
id: number
|
|
name: string
|
|
email: string
|
|
password: string
|
|
}
|
|
|
|
export type Customer = {
|
|
id: number
|
|
name: string
|
|
email: string
|
|
}
|
|
|
|
export type Invoice = {
|
|
id: number
|
|
customerId: number
|
|
amount: number
|
|
status: "pending" | "paid" // In TypeScript, this is called a string union type.
|
|
// It means that the "status" property can only be one of the two strings.
|
|
}
|