All Downloads are FREE. Search and download functionalities are using the official Maven repository.

types.sidebar.ts Maven / Gradle / Ivy

import { SyntheticEvent } from 'react';

import { ThemeIcon } from './theming';
import Types, { GearsIconType } from './types';

type SidebarItemDataType = "group" | "cascading" | "item" 

export type SidebarItemDataBase = {
  type :    SidebarItemDataType,
  key :     string,
  label?:   string,
  ref?:     string,
  href?:    string,
  onClick?: (event: SyntheticEvent) => void,
  tip?:     string
}

export interface SidebarItemDataIcon extends SidebarItemDataBase {
  icon :       string | GearsIconType | ThemeIcon,
  activeIcon : string | GearsIconType | ThemeIcon,
  badge?:      string
}

export interface SidebarItemDataCascading extends SidebarItemDataBase,SidebarItemDataIcon {
  children: SidebarItemData[], 
}

export interface SidebarItemDataGroup extends SidebarItemDataBase {
  children: SidebarItemData[], 
}

export interface SidebarItemDataLink extends SidebarItemDataBase,SidebarItemDataIcon {
}

export type SidebarItemData = SidebarItemDataCascading | SidebarItemDataGroup | SidebarItemDataLink




© 2015 - 2024 Weber Informatics LLC | Privacy Policy