0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/plugin-src/ImageLibrary.ts

22 lines
474 B
TypeScript
Raw Normal View History

class ImageLibrary {
private images: Record<string, Image | null> = {};
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<string, Image | null> {
return this.images;
}
public init(images: Record<string, Image | null>): void {
this.images = images;
}
}
export const imagesLibrary = new ImageLibrary();