import React, { ReactNode } from 'react';
import {YRouterItem, Action, YRouterConfig} from '@/default.interface';

export interface YModuleProps {
  config: ModuleConfig;
  onMenuClick?: (path: string) => void;
}

export interface ModuleConfig {
  moduleId: string;
  moduleName: string;
}

export interface SiderProps extends YModuleProps  {
}

export interface ModuleAction extends Action<ModuleType> {

}

export interface ModuleState {
  menus: YRouterItem[];
  defaultSelectedMenus?: string[];
  defaultOpenMenus?: string[];
  defaultMenu?: YRouterItem;
  selectedMenus: YRouterItem[];
  openMenu?: string[];
  permissions: string[];
  pageName: string;
  pageData?: { [propName: string]: any };
  isInit: boolean;
  moduleId?: string;
}

type ModuleType =
  | 'init_menu'
  | 'select_menu'
  | 'close_menu'
  | 'init_selected'
  | 'update_selected';


  export interface BookmarkProps extends YModuleProps {
    userId?: string;
    projectId?: string;
  }

  export type TargetKey = string | React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>;

  export type BookmarkActionType = 'add' | 'remove';