ui.ts 935 B

123456789101112131415161718192021222324252627
  1. import { Nullable } from '@growi/core';
  2. export const SidebarContentsType = {
  3. CUSTOM: 'custom',
  4. RECENT: 'recent',
  5. TREE: 'tree',
  6. TAG: 'tag',
  7. } as const;
  8. export const AllSidebarContentsType = Object.values(SidebarContentsType);
  9. export type SidebarContentsType = typeof SidebarContentsType[keyof typeof SidebarContentsType];
  10. export type ICustomTabContent = {
  11. Content: () => JSX.Element,
  12. i18n: string,
  13. Icon?: () => JSX.Element,
  14. index?: number,
  15. isLinkEnabled?: boolean | ((content: ICustomTabContent) => boolean),
  16. };
  17. export type ICustomNavTabMappings = { [key: string]: ICustomTabContent };
  18. export type OnDeletedFunction = (idOrPaths: string | string[], isRecursively: Nullable<true>, isCompletely: Nullable<true>) => void;
  19. export type OnRenamedFunction = (path: string) => void;
  20. export type OnDuplicatedFunction = (fromPath: string, toPath: string) => void;
  21. export type OnPutBackedFunction = (path: string) => void;