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:
parent
eb2315e50b
commit
6dfe4dd582
4 changed files with 59 additions and 3 deletions
|
@ -54,7 +54,7 @@ export const createPenpotText = (
|
|||
type: 'paragraph-set',
|
||||
children: [
|
||||
{
|
||||
lineHeight: node.lineHeight,
|
||||
// lineHeight: node.lineHeight,
|
||||
fontStyle: 'normal',
|
||||
children: children,
|
||||
textTransform: translateTextTransform(node),
|
||||
|
|
5
src/ui/lib/penpot.d.ts
vendored
5
src/ui/lib/penpot.d.ts
vendored
|
@ -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
6
src/ui/lib/types/baseOptions.d.ts
vendored
Normal 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
49
src/ui/lib/types/textOptions.d.ts
vendored
Normal 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;
|
||||
}[];
|
||||
}[];
|
||||
}[];
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue