export type DrawTool = 'select' | 'line' | 'rect' | 'paint';

export type BackgroundMode = 'grid' | 'plain';

export type DrawLine = {
  id: string;
  type: 'line';
  groupId?: string | null;
  x1: number;
  y1: number;
  x2: number;
  y2: number;
  orientation: 'horizontal' | 'vertical';
  label: string;
};

export type DrawRect = {
  id: string;
  type: 'rect';
  groupId?: string | null;
  x: number;
  y: number;
  width: number;
  height: number;
  label: string;
  fillColor?: string | null;
};

export type DrawRegion = {
  id: string;
  type: 'region';
  regionKey: string;
  label: string;
  fillColor?: string | null;
};

export type DrawableShape = DrawLine | DrawRect;

export type DrawShape = DrawableShape | DrawRegion;

export type LayoutDrawDocument = {
  backgroundMode: BackgroundMode;
  shapes: DrawShape[];
};

export type SavedLayoutDrawRecord = {
  id: string;
  name: string;
  createdAt: string;
  updatedAt: string;
  backgroundMode: BackgroundMode;
  shapes: DrawShape[];
};

export type SavedLayoutDrawComponentRecord = {
  id: string;
  name: string;
  category: string;
  createdAt: string;
  updatedAt: string;
  shapes: DrawableShape[];
};
