mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 21:53:27 -05:00
3094f05e98
* Optimize images before generating zip file * add changelog * refactor * fix lint
23 lines
462 B
TypeScript
23 lines
462 B
TypeScript
import { ImageColor } from '@ui/lib/types/utils/imageColor';
|
|
|
|
class UiImages {
|
|
private images: Record<string, ImageColor> = {};
|
|
|
|
public register(id: string, image: ImageColor) {
|
|
this.images[id] = image;
|
|
}
|
|
|
|
public get(id: string): ImageColor | undefined {
|
|
return this.images[id];
|
|
}
|
|
|
|
public all(): ImageColor[] {
|
|
return Object.values(this.images);
|
|
}
|
|
|
|
public init() {
|
|
this.images = {};
|
|
}
|
|
}
|
|
|
|
export const uiImages = new UiImages();
|