This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
export type LayerType = 'background' | 'group' | 'image' | 'vector' | 'text' | 'sticker' | 'brush';
|
||||
export type AdjustmentName = 'brightness' | 'contrast' | 'shadows' | 'highlights' | 'temperature' | 'hue' | 'saturation' | 'vignette' | 'sharpen' | 'grain';
|
||||
|
||||
export interface Transform { x: number; y: number; scaleX: number; scaleY: number; rotation: number }
|
||||
export interface CanvasSpec { width: number; height: number; background: string }
|
||||
export interface ToolBinding { layerIds?: string[]; tags?: string[] }
|
||||
export interface DocumentBindings { tools?: Record<string, ToolBinding>; [key: string]: unknown }
|
||||
export interface PosterLayer {
|
||||
id: string; type: LayerType; name: string; visible: boolean; locked: boolean; opacity: number;
|
||||
blendMode: GlobalCompositeOperation; transform: Transform; effects: unknown[]; tags: string[];
|
||||
children?: PosterLayer[]; [key: string]: unknown;
|
||||
}
|
||||
export interface PosterDocument {
|
||||
schema: 'entroia.poster-document'; version: 1; id: string; seed: string; canvas: CanvasSpec;
|
||||
layers: PosterLayer[]; bindings: DocumentBindings; meta: Record<string, unknown> & { title: string; createdAt: string };
|
||||
}
|
||||
export interface CreateDocumentOptions {
|
||||
id?: string; seed?: string; width?: number; height?: number; background?: string;
|
||||
layers?: PosterLayer[]; bindings?: DocumentBindings; title?: string; meta?: Record<string, unknown>;
|
||||
}
|
||||
export interface LayerProps {
|
||||
id?: string; name?: string; visible?: boolean; locked?: boolean; opacity?: number;
|
||||
blendMode?: GlobalCompositeOperation; transform?: Transform; effects?: unknown[]; tags?: string[];
|
||||
children?: PosterLayer[]; [key: string]: unknown;
|
||||
}
|
||||
export interface CatalogItem { id: string | number; tags?: string[]; [key: string]: unknown }
|
||||
export interface CatalogQuery { all?: string[]; any?: string[]; none?: string[] }
|
||||
export type LayoutSlot = readonly [number, number, number, number];
|
||||
export interface LayoutPreset { id: string; count: number; tags: string[]; slots: readonly LayoutSlot[] }
|
||||
export interface BrushPreset { id: string; engine: 'stroke' | 'texture' | 'particles' | 'stamp'; [key: string]: string | number | undefined }
|
||||
export interface TextBackgroundStyle {
|
||||
paddingX?: number; paddingY?: number; resizeMode?: string; fill?: string; shape?: string;
|
||||
assetId?: string; capInsets?: { left: number; right: number; top: number; bottom: number };
|
||||
}
|
||||
export interface DecoratedTextStyle {
|
||||
documentSeed?: string; layerId?: string; maxAngle?: number; rotationMode?: 'position' | 'glyph';
|
||||
letterSpacing?: number; lineHeight?: number; fontSize?: number; background?: TextBackgroundStyle;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
export interface GlyphRun { glyph: string; index: number; x: number; width: number; rotation: number }
|
||||
export interface DecoratedTextLayout {
|
||||
glyphs: GlyphRun[]; width: number;
|
||||
background: (TextBackgroundStyle & { width: number; height: number; resizeMode: string; paddingX: number; paddingY: number }) | null;
|
||||
}
|
||||
export interface LayoutBox { index: number; x: number; y: number; width: number; height: number; mask: unknown }
|
||||
export interface ValidationResult { valid: boolean; errors: string[] }
|
||||
Reference in New Issue
Block a user