bookmark-info.ts 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import type { Ref, IPageHasId, IUser } from '@growi/core';
  2. export interface IBookmarkInfo {
  3. sumOfBookmarks: number,
  4. isBookmarked: boolean,
  5. bookmarkedUsers: IUser[],
  6. pageId: string,
  7. }
  8. export interface BookmarkedPage {
  9. _id: string,
  10. page: IPageHasId | null,
  11. user: Ref<IUser>,
  12. createdAt: Date,
  13. }
  14. export type MyBookmarkList = BookmarkedPage[]
  15. export interface IBookmarkFolder {
  16. name: string
  17. owner: Ref<IUser>
  18. parent?: Ref<this>
  19. }
  20. export interface BookmarkFolderItems extends IBookmarkFolder {
  21. _id: string;
  22. childFolder: BookmarkFolderItems[];
  23. bookmarks: BookmarkedPage[];
  24. }
  25. export const DRAG_ITEM_TYPE = {
  26. FOLDER: 'FOLDER',
  27. BOOKMARK: 'BOOKMARK',
  28. } as const;
  29. interface BookmarkDragItem {
  30. bookmarkFolder: BookmarkFolderItems
  31. level: number
  32. root: string
  33. }
  34. export interface DragItemDataType extends BookmarkDragItem, IPageHasId {
  35. parentFolder: BookmarkFolderItems | null
  36. }
  37. export type DragItemType = typeof DRAG_ITEM_TYPE[keyof typeof DRAG_ITEM_TYPE];