mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-02 21:00:12 -05:00
add rect
This commit is contained in:
parent
5ba81d3282
commit
222dbaa5fc
5 changed files with 14 additions and 2 deletions
|
@ -8,6 +8,7 @@ export const createPenpotRectangle = (
|
|||
baseY: number
|
||||
) => {
|
||||
file.penpotFile.createRect({
|
||||
type: Symbol.for('rect'),
|
||||
name: node.name,
|
||||
x: node.x + baseX,
|
||||
y: node.y + baseY,
|
||||
|
|
3
src/ui/lib/penpot.d.ts
vendored
3
src/ui/lib/penpot.d.ts
vendored
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { CircleShape } from './types/circle/circleShape';
|
||||
import { RectShape } from './types/rect/rectShape';
|
||||
import { TextShape } from './types/text/textShape';
|
||||
|
||||
export interface PenpotFile {
|
||||
|
@ -11,7 +12,7 @@ export interface PenpotFile {
|
|||
closeArtboard(): void;
|
||||
addGroup(group: any): void;
|
||||
closeGroup(): void;
|
||||
createRect(rect: any): void;
|
||||
createRect(rect: RectShape): void;
|
||||
createCircle(circle: CircleShape): void;
|
||||
createText(options: TextShape): void;
|
||||
createImage(image: any): void;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export type CircleAttributes = {
|
||||
id?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
id?: any;
|
||||
type: symbol;
|
||||
};
|
||||
|
|
5
src/ui/lib/types/rect/rectAttributes.d.ts
vendored
Normal file
5
src/ui/lib/types/rect/rectAttributes.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
export type RectAttributes = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
id?: any;
|
||||
type: symbol;
|
||||
};
|
4
src/ui/lib/types/rect/rectShape.d.ts
vendored
Normal file
4
src/ui/lib/types/rect/rectShape.d.ts
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { Shape } from '../shape';
|
||||
import { RectAttributes } from './rectAttributes';
|
||||
|
||||
export type RectShape = Shape & RectAttributes;
|
Loading…
Reference in a new issue