0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-21 06:02:34 -05:00

feat: add support for component in libraries

This commit is contained in:
alonso.torres 2024-06-03 11:46:28 +02:00 committed by Alonso Torres
parent 24318395fe
commit 588b565811

View file

@ -413,6 +413,8 @@ export interface PenpotLibraryElement {
export interface PenpotLibraryColor extends PenpotLibraryElement {
color?: string;
opacity?: number;
gradient?: PenpotGradient;
image?: PenpotImageData;
asFill(): PenpotFill;
asStroke(): PenpotStroke;
@ -433,17 +435,18 @@ export interface PenpotLibraryTypography extends PenpotLibraryElement {
applyToTextRange(shape: PenpotShape): void;
}
export type PenpotLibraryComponent = {
name: string;
};
export interface PenpotLibraryComponent extends PenpotLibraryElement {
instance(): PenpotShape;
}
export type PenpotLibrary = {
colors: PenpotLibraryColor[];
typographies: PenpotLibraryTypography[];
components: PenpotLibraryComponent[];
// createColor(): PenpotLibraryColor;
// createTypography(): PenpotLibraryTypography;
createColor(): PenpotLibraryColor;
createTypography(): PenpotLibraryTypography;
createComponent(shapes: PenpotShape[]): PenpotLibraryComponent;
};
export type PenpotLibraryContext = {