0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-20 14:32:31 -05:00
penpot-exporter-figma-plugin/ui-src/parser/libraries/UiTextLibraries.ts

20 lines
500 B
TypeScript
Raw Normal View History

import { TypographyStyle } from '@ui/lib/types/shapes/textShape';
class UiTextLibraries {
private libraries: Map<string, TypographyStyle> = new Map();
public register(id: string, textStyle: TypographyStyle) {
this.libraries.set(id, textStyle);
}
public get(id: string): TypographyStyle | undefined {
return this.libraries.get(id);
}
public all(): TypographyStyle[] {
return Array.from(this.libraries.values());
}
}
export const uiTextLibraries = new UiTextLibraries();