mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
3094f05e98
* Optimize images before generating zip file * add changelog * refactor * fix lint
21 lines
474 B
TypeScript
21 lines
474 B
TypeScript
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();
|