ui.ts 1.4 KB

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