export interface Theme {
  id: number;
  name: string;
  moduleName: string;
  isDefault: boolean;
  from: string;
  published: boolean;
  thumb: string;
  updatedAt: string;
  version: string;
}

export interface ThemeDetail extends Theme {
  config: any[];
}

export type Themes = Theme[];

export enum Type {
  SYSTEM = 1, //官网
  USER //用户自定义
}

export enum Status {
  CancelTask, //非锁定状态
  StartTask //任务执行状态
}
export interface PatchScreensTheme {
  themeId?: number;
  screenId: number;
  status: Status;
}

export interface SeriesGradient {
  angle: number;
  gradient: {
    color: string;
    offset: number;
  }[];
}

export interface ThemeType {
  id: number;
  rank?: number;
  name: string;
  type: Type; // 类型
  published: boolean;
  updatedAt: string;
  config: {
    bgColor: string;
    textColor: string;
    assistColor: string;
    gridColor: string;
    seriesGradient: SeriesGradient[];
    palette: string[];
  };
}

export type ThemeConfigType = ThemeType['config'];

export const themeKeys = ['assistColor', 'bgColor', 'gridColor', 'palette', 'seriesGradient', 'textColor'];
