ui.ts 919 B

1234567891011121314151617181920212223242526
  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. isLinkEnabled?: boolean | ((content: ICustomTabContent) => boolean),
  15. };
  16. export type ICustomNavTabMappings = { [key: string]: ICustomTabContent };
  17. export type OnDeletedFunction = (idOrPaths: string | string[], isRecursively: Nullable<true>, isCompletely: Nullable<true>) => void;
  18. export type OnRenamedFunction = (path: string) => void;
  19. export type OnDuplicatedFunction = (fromPath: string, toPath: string) => void;
  20. export type OnPutBackedFunction = (path: string) => void;