0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00

start adding options

This commit is contained in:
Jordi Sala Morales 2024-04-09 18:44:29 +00:00
parent eb2315e50b
commit 6dfe4dd582
No known key found for this signature in database
GPG key ID: C5127140107F55FD
4 changed files with 59 additions and 3 deletions

View file

@ -54,7 +54,7 @@ export const createPenpotText = (
type: 'paragraph-set',
children: [
{
lineHeight: node.lineHeight,
// lineHeight: node.lineHeight,
fontStyle: 'normal',
children: children,
textTransform: translateTextTransform(node),

View file

@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { TextOptions } from './types/textOptions';
export interface PenpotFile {
asMap(): any;
export(): void;
addPage(name: string): void;
addPage(name: string, options?: object): void;
closePage(): void;
addArtboard(artboard: any): void;
closeArtboard(): void;
@ -11,7 +12,7 @@ export interface PenpotFile {
closeGroup(): void;
createRect(rect: any): void;
createCircle(circle: any): void;
createText(text: any): void;
createText(options: TextOptions): void;
createImage(image: any): void;
}

6
src/ui/lib/types/baseOptions.d.ts vendored Normal file
View file

@ -0,0 +1,6 @@
export type BaseOptions = {
x: number;
y: number;
width: number;
height: number;
};

49
src/ui/lib/types/textOptions.d.ts vendored Normal file
View file

@ -0,0 +1,49 @@
import { BaseOptions } from './baseOptions';
export type TextOptions = BaseOptions & {
name: string;
rotation: number;
type: symbol;
content: {
type: 'root';
key?: string;
children?: {
type: 'paragraph-set';
key?: string;
children: {
type: 'paragraph';
key?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fills?: any;
fontFamily?: string;
fontSize?: string;
fontStyle?: string;
fontWeight?: string;
direction?: string;
textDecoration?: string;
textTransform?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typographyRefId?: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typographyRefFile?: any;
children: {
text: string;
key?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fills?: any;
fontFamily?: string;
fontSize?: string;
fontStyle?: string;
fontWeight?: string;
direction?: string;
textDecoration?: string;
textTransform?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typographyRefId?: any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typographyRefFile?: any;
}[];
}[];
}[];
};
};