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/ui-src/parser/libraries/Images.ts
Alex Sánchez e8270cfd54
Refactor (#188)
* refactor

* fixes

* rename libraries

* refactor libraries

* fixes
2024-06-25 17:12:20 +02:00

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();