mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 21:53:27 -05:00
e8270cfd54
* refactor * fixes * rename libraries * refactor libraries * fixes
23 lines
476 B
TypeScript
23 lines
476 B
TypeScript
import { ImageColor } from '@ui/lib/types/utils/imageColor';
|
|
|
|
class Images {
|
|
private images: Map<string, ImageColor> = new Map();
|
|
|
|
public register(id: string, image: ImageColor) {
|
|
this.images.set(id, image);
|
|
}
|
|
|
|
public get(id: string): ImageColor | undefined {
|
|
return this.images.get(id);
|
|
}
|
|
|
|
public all(): ImageColor[] {
|
|
return Array.from(this.images.values());
|
|
}
|
|
|
|
public init() {
|
|
this.images.clear();
|
|
}
|
|
}
|
|
|
|
export const images = new Images();
|