mirror of
https://github.com/vercel/next-learn.git
synced 2026-06-29 15:44:27 +00:00
* Rename file and add data fetches for overview page * Rename calculations.ts to utils.ts * Update code to match course * Add temporary calculation * Fix error * Move types to data fetching file * Add error handling * Parallelize data fetches * Add skeletons * Add delayed data request * Fix ts errors * Code for chapter 8 * Fix error * Clean up --------- Co-authored-by: Stephanie Dietz <49788645+StephDietz@users.noreply.github.com>
40 lines
798 B
TypeScript
40 lines
798 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;
|
|
image_url: string;
|
|
};
|
|
|
|
export type Invoice = {
|
|
id: number;
|
|
customer_id: number;
|
|
amount: number;
|
|
// In TypeScript, this is called a string union type.
|
|
// It means that the "status" property can only be one of the two strings: 'pending' or 'paid'.
|
|
status: 'pending' | 'paid';
|
|
date: string;
|
|
};
|
|
|
|
export type LatestInvoice = {
|
|
id: number;
|
|
name: string;
|
|
image_url: string;
|
|
email: string;
|
|
amount: string;
|
|
};
|
|
|
|
export type Revenue = {
|
|
month: string;
|
|
revenue: number;
|
|
};
|