|
@@ -1,4 +1,4 @@
|
|
-import {Book} from './interfaces';
|
|
|
|
|
|
+import {Book, DamageLogger} from './interfaces';
|
|
import {Category} from "./enums";
|
|
import {Category} from "./enums";
|
|
|
|
|
|
function GetAllBooks(): Book[] {
|
|
function GetAllBooks(): Book[] {
|
|
@@ -75,8 +75,8 @@ function CreateCustomer(name: string, age?: number, city?: string) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-function CreateCustomerId(name: string, id: number): string {
|
|
|
|
- return name + id;
|
|
|
|
|
|
+function CreateCustomerId(chars: string, nums: number): string {
|
|
|
|
+ return chars + nums;
|
|
}
|
|
}
|
|
|
|
|
|
function GetBookTitlesByCategory(categoryFilter: Category = Category.Fiction): Array<string> {
|
|
function GetBookTitlesByCategory(categoryFilter: Category = Category.Fiction): Array<string> {
|
|
@@ -153,5 +153,8 @@ let myBook: Book = {
|
|
markDamaged: reason => console.log(`Damaged: ${reason}.`),
|
|
markDamaged: reason => console.log(`Damaged: ${reason}.`),
|
|
};
|
|
};
|
|
|
|
|
|
-PrintBook(myBook);
|
|
|
|
-myBook.markDamaged('Missing back cover');
|
|
|
|
|
|
+// PrintBook(myBook);
|
|
|
|
+// myBook.markDamaged('Torn back cover');
|
|
|
|
+
|
|
|
|
+let logDamage: DamageLogger = reason => console.log(`Damage reported: ${reason}.`);
|
|
|
|
+logDamage('Coffee stains');
|