mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-21 23:12:35 -05:00
improve types
This commit is contained in:
parent
4724c97441
commit
1b29448831
8 changed files with 9 additions and 20 deletions
|
@ -5,7 +5,6 @@ import { BoolContent } from './boolContent';
|
|||
export const BOOL_TYPE: unique symbol = Symbol.for('bool');
|
||||
|
||||
export type BoolAttributes = {
|
||||
id?: Uuid;
|
||||
type: 'bool' | typeof BOOL_TYPE;
|
||||
shapes?: Uuid[];
|
||||
boolType: string; // @TODO: in Penpot this is of type :keyword. check if it makes sense
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import { Uuid } from '@ui/lib/types/utils/uuid';
|
||||
|
||||
export const CIRCLE_TYPE: unique symbol = Symbol.for('circle');
|
||||
|
||||
export type CircleAttributes = {
|
||||
type: 'circle' | typeof CIRCLE_TYPE;
|
||||
id?: Uuid;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,6 @@ export const FRAME_TYPE: unique symbol = Symbol.for('frame');
|
|||
|
||||
export type FrameAttributes = {
|
||||
type: 'frame' | typeof FRAME_TYPE;
|
||||
id?: Uuid;
|
||||
shapes?: Uuid[];
|
||||
fileThumbnail?: boolean;
|
||||
hideFillOnExport?: boolean;
|
||||
|
|
|
@ -4,6 +4,5 @@ export const GROUP_TYPE: unique symbol = Symbol.for('group');
|
|||
|
||||
export type GroupAttributes = {
|
||||
type: 'group' | typeof GROUP_TYPE;
|
||||
id?: Uuid;
|
||||
shapes?: Uuid[];
|
||||
};
|
||||
|
|
|
@ -3,7 +3,6 @@ import { Uuid } from '@ui/lib/types/utils/uuid';
|
|||
export const IMAGE_TYPE: unique symbol = Symbol.for('image');
|
||||
|
||||
export type ImageAttributes = {
|
||||
id?: Uuid;
|
||||
type: 'image' | typeof IMAGE_TYPE;
|
||||
dataUri?: string;
|
||||
metadata: {
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import { Uuid } from '@ui/lib/types/utils/uuid';
|
||||
|
||||
export const RECT_TYPE: unique symbol = Symbol.for('rect');
|
||||
|
||||
export type RectAttributes = {
|
||||
type: 'rect' | typeof RECT_TYPE;
|
||||
id?: Uuid;
|
||||
};
|
||||
|
|
|
@ -3,15 +3,17 @@ import { Point } from '@ui/lib/types/utils/point';
|
|||
import { Selrect } from '@ui/lib/types/utils/selrect';
|
||||
import { Uuid } from '@ui/lib/types/utils/uuid';
|
||||
|
||||
export const FRAME_TYPE: unique symbol = Symbol.for('frame');
|
||||
export const GROUP_TYPE: unique symbol = Symbol.for('group');
|
||||
export const BOOL_TYPE: unique symbol = Symbol.for('bool');
|
||||
export const RECT_TYPE: unique symbol = Symbol.for('rect');
|
||||
import { BOOL_TYPE } from '../bool/boolAttributes';
|
||||
import { CIRCLE_TYPE } from '../circle/circleAttributes';
|
||||
import { FRAME_TYPE } from '../frame/frameAttributes';
|
||||
import { GROUP_TYPE } from '../group/groupAttributes';
|
||||
import { IMAGE_TYPE } from '../image/imageAttributes';
|
||||
import { RECT_TYPE } from '../rect/rectAttributes';
|
||||
import { TEXT_TYPE } from '../text/textAttributes';
|
||||
|
||||
// @TODO: Move to its own file once we support all the shapes
|
||||
export const PATH_TYPE: unique symbol = Symbol.for('path');
|
||||
export const TEXT_TYPE: unique symbol = Symbol.for('text');
|
||||
export const CIRCLE_TYPE: unique symbol = Symbol.for('circle');
|
||||
export const SVG_RAW_TYPE: unique symbol = Symbol.for('svg-raw');
|
||||
export const IMAGE_TYPE: unique symbol = Symbol.for('image');
|
||||
|
||||
export type ShapeBaseAttributes = {
|
||||
id?: Uuid;
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
import { Uuid } from '@ui/lib/types/utils/uuid';
|
||||
|
||||
import { TextContent } from './textContent';
|
||||
|
||||
export const TEXT_TYPE: unique symbol = Symbol.for('text');
|
||||
|
||||
export type TextAttributes = {
|
||||
id?: Uuid;
|
||||
type: 'text' | typeof TEXT_TYPE;
|
||||
content?: TextContent;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue