Files
next-learn/dashboard/15-final/app/lib/definitions.ts
Delba de Oliveira 24bcb816e5 Add code for chapters 7-8 (#164)
* 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>
2023-09-19 12:55:02 -05:00

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;
};