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

24 lines
526 B
TypeScript
Raw Normal View History

import { ImageColor } from '@ui/lib/types/utils/imageColor';
class ImageLibrary {
private images: Record<string, ImageColor> = {};
public register(hash: string, image: ImageColor) {
this.images[hash] = image;
}
public get(hash: string): ImageColor | undefined {
return this.images[hash];
}
public all(): Record<string, ImageColor> {
return this.images;
}
public init(images: Record<string, ImageColor>): void {
this.images = images;
}
}
export const imagesLibrary = new ImageLibrary();