mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
a58f9e913d
* wip * color library * fixes * fixes * fixes * fixes * changeset * fixes * fixes * fixes * fixes
21 lines
519 B
TypeScript
21 lines
519 B
TypeScript
class StyleLibrary {
|
|
private styles: Map<string, PaintStyle | undefined> = new Map();
|
|
|
|
public register(id: string, styles?: PaintStyle | undefined) {
|
|
this.styles.set(id, styles);
|
|
}
|
|
|
|
public get(id: string): PaintStyle | undefined {
|
|
return this.styles.get(id);
|
|
}
|
|
|
|
public has(id: string): boolean {
|
|
return this.styles.has(id);
|
|
}
|
|
|
|
public all(): Record<string, PaintStyle | undefined> {
|
|
return Object.fromEntries(this.styles.entries());
|
|
}
|
|
}
|
|
|
|
export const styleLibrary = new StyleLibrary();
|