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:
parent
24318395fe
commit
588b565811
1 changed files with 8 additions and 5 deletions
13
libs/plugin-types/index.d.ts
vendored
13
libs/plugin-types/index.d.ts
vendored
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue