import { ComponentItem } from './component.types';
export interface ScreenItem {
  id: number;
  name: string;
  password?: string;
  screenId: number;
  screenName: string;
  deletedAt?: Date;
  groupId?: null | number;
  thumb: null | string | number;
  apps: number[];
  share: string;
  shareToken?: string;
  shareInfo?: {
    title: string;
    description: string;
    thumb: string;
  };
  expiredAt?: Date;
  updatedAt: Date;
  createdAt: Date;
}

export interface ScreenConfig {
  id: number;
  name: string;
  panelId: number | null;
  mobileId: number | null;
  leftBarWidth: number;
  isShowAlert: boolean;
  isShowLoading: boolean;
  lines: {
    h: number[];
    v: number[];
  };
  components: ComponentItem[];
  config: any[];
  layers: Layers;
  thumb: null | string;
  tenantId: number;
  share?: string;
  sharePassword?: string;
  shareToken?: string;
  shareInfo?: {
    title: string;
    description: string;
    thumb: string;
  };
}

export type recycleItems = any[];

export type Layers = {
  id: number | string;
  moduleName: string;
  name: string;
  show?: boolean;
  lock?: boolean;
  collapsed?: boolean;
  hideDefault?: boolean;
  mountAnimation?: {
    opacityOpen: boolean;
    timingFunction: TimingFunction;
    type: 'none' | 'slide' | 'slideSmall' | 'wipe';
  };
  movable?: boolean;
  topKey?: string;
  topOffset?: number;
  transform?: {
    open: boolean;
  };
  transitionDeley?: number;
  transitionTime?: number;
  transitionTimingFunction: TimingFunction;
  components?: Layers;
}[];

export interface ScreensById {
  [k: number]: ScreenConfig;
}
