mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-02-01 12:01:14 -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 {
|
export interface PenpotLibraryColor extends PenpotLibraryElement {
|
||||||
color?: string;
|
color?: string;
|
||||||
opacity?: number;
|
opacity?: number;
|
||||||
|
gradient?: PenpotGradient;
|
||||||
|
image?: PenpotImageData;
|
||||||
|
|
||||||
asFill(): PenpotFill;
|
asFill(): PenpotFill;
|
||||||
asStroke(): PenpotStroke;
|
asStroke(): PenpotStroke;
|
||||||
|
@ -433,17 +435,18 @@ export interface PenpotLibraryTypography extends PenpotLibraryElement {
|
||||||
applyToTextRange(shape: PenpotShape): void;
|
applyToTextRange(shape: PenpotShape): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PenpotLibraryComponent = {
|
export interface PenpotLibraryComponent extends PenpotLibraryElement {
|
||||||
name: string;
|
instance(): PenpotShape;
|
||||||
};
|
}
|
||||||
|
|
||||||
export type PenpotLibrary = {
|
export type PenpotLibrary = {
|
||||||
colors: PenpotLibraryColor[];
|
colors: PenpotLibraryColor[];
|
||||||
typographies: PenpotLibraryTypography[];
|
typographies: PenpotLibraryTypography[];
|
||||||
components: PenpotLibraryComponent[];
|
components: PenpotLibraryComponent[];
|
||||||
|
|
||||||
// createColor(): PenpotLibraryColor;
|
createColor(): PenpotLibraryColor;
|
||||||
// createTypography(): PenpotLibraryTypography;
|
createTypography(): PenpotLibraryTypography;
|
||||||
|
createComponent(shapes: PenpotShape[]): PenpotLibraryComponent;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type PenpotLibraryContext = {
|
export type PenpotLibraryContext = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue