Add the following interface to mediaman.ts:
interface MediaManView {
getNewBookCollectionName(): string;
renderBookCollection(bookCollection:
Readonly<MediaCollection<Book>>): void;
displayErrorMessage(message: string): void;
clearBookCollections(): void;
removeBookCollection(identifier: string): void;
getNewBookDetails(collectionIdentifier: string): { error?: string,
book?: Readonly<Book> };
renderBook(collectionIdentifier: string, book: Readonly<Book>):
void;
removeBook(collectionIdentifier: string, bookIdentifier: string):
void;
clearNewBookCollectionForm(collectionIdentifier: string): void;
}
As in the previous chapter, the different view methods will hide internal details for the controller, which will simply use the view implementation as a black box. Again...