class ImageLibrary { private images: Record = {}; public register(hash: string, image: Image | null) { this.images[hash] = image; } public get(hash: string): Image | null | undefined { return this.images[hash]; } public all(): Record { return this.images; } public init(images: Record): void { this.images = images; } } export const imagesLibrary = new ImageLibrary();