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
|
baseY: number
|
||||||
) => {
|
) => {
|
||||||
file.penpotFile.createRect({
|
file.penpotFile.createRect({
|
||||||
|
type: Symbol.for('rect'),
|
||||||
name: node.name,
|
name: node.name,
|
||||||
x: node.x + baseX,
|
x: node.x + baseX,
|
||||||
y: node.y + baseY,
|
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 */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import { CircleShape } from './types/circle/circleShape';
|
import { CircleShape } from './types/circle/circleShape';
|
||||||
|
import { RectShape } from './types/rect/rectShape';
|
||||||
import { TextShape } from './types/text/textShape';
|
import { TextShape } from './types/text/textShape';
|
||||||
|
|
||||||
export interface PenpotFile {
|
export interface PenpotFile {
|
||||||
|
@ -11,7 +12,7 @@ export interface PenpotFile {
|
||||||
closeArtboard(): void;
|
closeArtboard(): void;
|
||||||
addGroup(group: any): void;
|
addGroup(group: any): void;
|
||||||
closeGroup(): void;
|
closeGroup(): void;
|
||||||
createRect(rect: any): void;
|
createRect(rect: RectShape): void;
|
||||||
createCircle(circle: CircleShape): void;
|
createCircle(circle: CircleShape): void;
|
||||||
createText(options: TextShape): void;
|
createText(options: TextShape): void;
|
||||||
createImage(image: any): void;
|
createImage(image: any): void;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export type CircleAttributes = {
|
export type CircleAttributes = {
|
||||||
id?: string;
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
id?: any;
|
||||||
type: symbol;
|
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