ui.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import type { Nullable } from '@growi/core';
  2. export const SidebarMode = {
  3. DRAWER: 'drawer',
  4. COLLAPSED: 'collapsed',
  5. DOCK: 'dock',
  6. } as const;
  7. export type SidebarMode = typeof SidebarMode[keyof typeof SidebarMode];
  8. export const SidebarContentsType = {
  9. CUSTOM: 'custom',
  10. RECENT: 'recent',
  11. TREE: 'tree',
  12. TAG: 'tag',
  13. BOOKMARKS: 'bookmarks',
  14. NOTIFICATION: 'notification',
  15. } as const;
  16. export const AllSidebarContentsType = Object.values(SidebarContentsType);
  17. export type SidebarContentsType = typeof SidebarContentsType[keyof typeof SidebarContentsType];
  18. export type ICustomTabContent = {
  19. Content?: () => JSX.Element,
  20. i18n?: string,
  21. Icon?: () => JSX.Element,
  22. isLinkEnabled?: boolean | ((content: ICustomTabContent) => boolean),
  23. };
  24. export type ICustomNavTabMappings = { [key: string]: ICustomTabContent };
  25. export type OnDeletedFunction = (idOrPaths: string | string[], isRecursively: Nullable<true>, isCompletely: Nullable<true>) => void;
  26. export type OnRenamedFunction = (path: string) => void;
  27. export type OnDuplicatedFunction = (fromPath: string, toPath: string) => void;
  28. export type OnPutBackedFunction = (path: string) => void;
  29. export type onDeletedBookmarkFolderFunction = (bookmarkFolderId: string) => void;
  30. export type OnSelectedFunction = () => void;