mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-08 16:00:27 -05:00
feat: fix problems with types
This commit is contained in:
parent
ec38707aca
commit
859843d230
1 changed files with 39 additions and 20 deletions
59
libs/plugin-types/index.d.ts
vendored
59
libs/plugin-types/index.d.ts
vendored
|
@ -58,11 +58,11 @@ export interface PenpotStroke {
|
||||||
strokeAlignment?: 'center' | 'inner' | 'outer';
|
strokeAlignment?: 'center' | 'inner' | 'outer';
|
||||||
strokeCapStart?: PenpotStrokeCap;
|
strokeCapStart?: PenpotStrokeCap;
|
||||||
strokeCapEnd?: PenpotStrokeCap;
|
strokeCapEnd?: PenpotStrokeCap;
|
||||||
strokeColorGradient: PenpotGradient;
|
strokeColorGradient?: PenpotGradient;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PenpotColor {
|
export interface PenpotColor {
|
||||||
id: string;
|
id?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
path?: string;
|
path?: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
|
@ -74,21 +74,21 @@ export interface PenpotColor {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PenpotShadow {
|
export interface PenpotShadow {
|
||||||
id: string;
|
id?: string;
|
||||||
style: 'drop-shadow' | 'inner-shadow';
|
style?: 'drop-shadow' | 'inner-shadow';
|
||||||
offsetX: number;
|
offsetX?: number;
|
||||||
offsetY: number;
|
offsetY?: number;
|
||||||
blur: number;
|
blur?: number;
|
||||||
spread: number;
|
spread?: number;
|
||||||
hidden: boolean;
|
hidden?: boolean;
|
||||||
color: PenpotColor;
|
color?: PenpotColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PenpotBlur {
|
export interface PenpotBlur {
|
||||||
id: string;
|
id?: string;
|
||||||
type: 'layer-blur';
|
type?: 'layer-blur';
|
||||||
value: number;
|
value?: number;
|
||||||
hidden: boolean;
|
hidden?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PenpotFrameGuideColumnParams {
|
export interface PenpotFrameGuideColumnParams {
|
||||||
|
@ -237,7 +237,7 @@ export interface PenpotShapeBase {
|
||||||
| 'luminosity';
|
| 'luminosity';
|
||||||
|
|
||||||
shadows: PenpotShadow[];
|
shadows: PenpotShadow[];
|
||||||
blur: PenpotBlur;
|
blur?: PenpotBlur;
|
||||||
exports: PenpotExport;
|
exports: PenpotExport;
|
||||||
|
|
||||||
// Relative positions
|
// Relative positions
|
||||||
|
@ -285,6 +285,7 @@ export interface PenpotShapeBase {
|
||||||
};
|
};
|
||||||
|
|
||||||
resize(width: number, height: number): void;
|
resize(width: number, height: number): void;
|
||||||
|
|
||||||
clone(): PenpotShape;
|
clone(): PenpotShape;
|
||||||
remove(): void;
|
remove(): void;
|
||||||
}
|
}
|
||||||
|
@ -392,17 +393,35 @@ export interface EventsMap {
|
||||||
|
|
||||||
export type PenpotTheme = 'light' | 'dark';
|
export type PenpotTheme = 'light' | 'dark';
|
||||||
|
|
||||||
export type PenpotLibraryColor = {
|
export interface PenpotLibraryElement {
|
||||||
|
id: string;
|
||||||
|
libraryId: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
path: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PenpotLibraryColor extends PenpotLibraryElement {
|
||||||
color?: string;
|
color?: string;
|
||||||
opacity?: number;
|
opacity?: number;
|
||||||
|
|
||||||
asFill(): PenpotFill;
|
asFill(): PenpotFill;
|
||||||
asStroke(): PenpotStroke;
|
asStroke(): PenpotStroke;
|
||||||
};
|
}
|
||||||
|
|
||||||
export type PenpotLibraryTypography = {
|
export interface PenpotLibraryTypography extends PenpotLibraryElement {
|
||||||
name: string;
|
fontId: string;
|
||||||
};
|
fontFamily: string;
|
||||||
|
fontVariantId: string;
|
||||||
|
fontSize: string;
|
||||||
|
fontWeight: string;
|
||||||
|
fontStyle: string;
|
||||||
|
lineHeight: string;
|
||||||
|
letterSpacing: string;
|
||||||
|
textTransform: string;
|
||||||
|
|
||||||
|
applyToText(shape: PenpotShape): void;
|
||||||
|
applyToTextRange(shape: PenpotShape): void;
|
||||||
|
}
|
||||||
|
|
||||||
export type PenpotLibraryComponent = {
|
export type PenpotLibraryComponent = {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
Loading…
Reference in a new issue