123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import { Category } from "./enums";
- interface DamageLogger {
- (reason: string): void;
- }
- interface Book {
- author: string,
- available: boolean,
- category: Category;
- id: number,
- pages?: number,
- title: string,
- markDamaged?: DamageLogger,
- }
- interface Person {
- name: string;
- email: string;
- }
- interface Author extends Person {
- numBooksPublished: number;
- }
- interface Librarian extends Person {
- department: string,
- assistCustomer: (custName: string) => void,
- }
- interface Inventory<T> {
- getNewestItem: () => T;
- addItem: (newItem: T) => void;
- getAllItems: () => Array<T>;
- }
- // let bookInventory: Inventory<Book>;
- // (snip...populate bookInventory)
- // let allBooks: Books = bookInventory.getAllItems();
- export {
- Author,
- Book,
- DamageLogger as Logger,
- Inventory,
- Librarian,
- }
|