ui.ts 1.0 KB

12345678910111213141516171819202122232425262728
  1. import type { Nullable } from '@growi/core';
  2. export const SidebarContentsType = {
  3. CUSTOM: 'custom',
  4. RECENT: 'recent',
  5. TREE: 'tree',
  6. TAG: 'tag',
  7. BOOKMARKS: 'bookmarks',
  8. } as const;
  9. export const AllSidebarContentsType = Object.values(SidebarContentsType);
  10. export type SidebarContentsType = typeof SidebarContentsType[keyof typeof SidebarContentsType];
  11. export type ICustomTabContent = {
  12. Content?: () => JSX.Element,
  13. i18n?: string,
  14. Icon?: () => JSX.Element,
  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;
  22. export type onDeletedBookmarkFolderFunction = (bookmarkFolderId: string) => void;