mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-05 06:10:52 -05:00
24 lines
462 B
TypeScript
24 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();
|