mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-20 14:32:31 -05:00
20 lines
500 B
TypeScript
20 lines
500 B
TypeScript
|
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();
|