import {DesktopCloudListTreeItem} from '@/generated/api';
import {MenuItem} from '../layout.interface';

export type ModuleActionType = 
  'init_module_list' |
  'init_menus' | 
  'close_module' | 
  'lock_module' | 
  'unlock_module' | 
  'select_module' | 
  'update_menu'
; 

export interface ModuleItem extends MenuItem {
  isLock?: boolean;
  onClose?: () => void;
  toggleLock?: (item: ModuleItem) => void;
  desktopAppIdcloudCategoryId?: string;
}

export interface ModuleAction {
  type: ModuleActionType;
  payload: {
    data: any;
  };
}

export interface ModuleState {
  desktopMenus: ModuleItem[];
  moduleList:DesktopCloudListTreeItem[];
  isModuleListLoading: boolean;
  currentMenu: ModuleItem;
  currentModule: string;
}

export type moduleType = 'ONLINE' | 'DEFAULT' | 'TRAILER';
