mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
add image
This commit is contained in:
parent
d341eb3fbe
commit
2a246e448e
4 changed files with 21 additions and 2 deletions
|
@ -7,6 +7,7 @@ export const createPenpotImage = (
|
|||
baseY: number
|
||||
) => {
|
||||
file.penpotFile.createImage({
|
||||
type: Symbol.for('image'),
|
||||
name: node.name,
|
||||
x: node.x + baseX,
|
||||
y: node.y + baseY,
|
||||
|
|
4
src/ui/lib/penpot.d.ts
vendored
4
src/ui/lib/penpot.d.ts
vendored
|
@ -1,4 +1,5 @@
|
|||
import { CircleShape } from './types/circle/circleShape';
|
||||
import { ImageShape } from './types/image/imageShape';
|
||||
import { RectShape } from './types/rect/rectShape';
|
||||
import { TextShape } from './types/text/textShape';
|
||||
|
||||
|
@ -17,8 +18,7 @@ export interface PenpotFile {
|
|||
createRect(rect: RectShape): void;
|
||||
createCircle(circle: CircleShape): void;
|
||||
createText(options: TextShape): void;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
createImage(image: any): void;
|
||||
createImage(image: ImageShape): void;
|
||||
}
|
||||
|
||||
export function createFile(name: string): PenpotFile;
|
||||
|
|
14
src/ui/lib/types/image/imageAttributes.d.ts
vendored
Normal file
14
src/ui/lib/types/image/imageAttributes.d.ts
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
export type ImageAttributes = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
id?: any;
|
||||
type: symbol;
|
||||
// TODO: Investigate where it comes from
|
||||
dataUri?: string;
|
||||
metadata: {
|
||||
width: number;
|
||||
height: number;
|
||||
mtype?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
id?: any;
|
||||
};
|
||||
};
|
4
src/ui/lib/types/image/imageShape.d.ts
vendored
Normal file
4
src/ui/lib/types/image/imageShape.d.ts
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { Shape } from '../shape';
|
||||
import { ImageAttributes } from './imageAttributes';
|
||||
|
||||
export type ImageShape = Shape & ImageAttributes;
|
Loading…
Reference in a new issue