import type { TemplateResult } from '@design.estate/dees-element';

export type CellHeightUnit = 'px' | 'em' | 'rem' | 'auto';

export interface DashboardMarginObject {
  top?: number;
  right?: number;
  bottom?: number;
  left?: number;
}

export type DashboardMargin = number | DashboardMarginObject;

export interface DashboardResolvedMargins {
  horizontal: number;
  vertical: number;
  top: number;
  right: number;
  bottom: number;
  left: number;
}

export interface DashboardLayoutItem {
  id: string;
  x: number;
  y: number;
  w: number;
  h: number;
}

export interface DashboardWidget extends DashboardLayoutItem {
  minW?: number;
  minH?: number;
  maxW?: number;
  maxH?: number;
  content: TemplateResult | string;
  title?: string;
  icon?: string;
  noMove?: boolean;
  noResize?: boolean;
  locked?: boolean;
  autoPosition?: boolean;
}

export type LayoutDirection = 'vertical' | 'horizontal';

export interface GridCellMetrics {
  containerWidth: number;
  cellWidthPx: number;
  marginHorizontalPx: number;
  cellHeightPx: number;
  marginVerticalPx: number;
}
