31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import type { Rect, Size, Transform } from "@core/geometry";
|
|
import type { TextStyle } from "@core/text-layer";
|
|
|
|
export type InputLayerId = string;
|
|
export type InputArtboardId = string;
|
|
|
|
type InputBaseLayer = {
|
|
id: InputLayerId;
|
|
name?: string;
|
|
visible: boolean;
|
|
locked: boolean;
|
|
opacity?: number;
|
|
transform: Transform;
|
|
layerMask?: { maskLayerId: InputLayerId };
|
|
clippingMask?: { maskLayerId: InputLayerId };
|
|
};
|
|
|
|
export type InputLayer =
|
|
| (InputBaseLayer & { type: "group"; children: InputLayer[] })
|
|
| (InputBaseLayer & { type: "adjustment" })
|
|
| (InputBaseLayer & { type: "text"; content: string; style: TextStyle })
|
|
| (InputBaseLayer & { type: "image" | "raster"; assetId: string });
|
|
|
|
export type InputDocument = {
|
|
id?: string;
|
|
name?: string;
|
|
version?: number;
|
|
assets: Array<{ id: string; name?: string; mimeType?: string; source?: string; intrinsicSize: Size }>;
|
|
artboards: Array<{ id: InputArtboardId; name?: string; backgroundColor?: string; visible: boolean; locked: boolean; bounds: Rect; layers: InputLayer[] }>;
|
|
};
|