Shun Miyazawa 3 месяцев назад
Родитель
Сommit
c0ea95604c
2 измененных файлов с 15 добавлено и 22 удалено
  1. 4 10
      apps/app/src/server/service/page/index.ts
  2. 11 12
      packages/core/src/interfaces/page.ts

+ 4 - 10
apps/app/src/server/service/page/index.ts

@@ -9,8 +9,8 @@ import type {
   IGrantedGroup,
   IPage,
   IPageInfoBasic,
-  IPageInfoForEmpty,
-  IPageInfoForEntity,
+  IPageInfoBasicForEmpty,
+  IPageInfoBasicForEntity,
   IRevisionHasId,
   IUser,
   IUserHasId,
@@ -3273,10 +3273,7 @@ class PageService implements IPageService {
         isEmpty: true,
         isMovable,
         isRevertible: false,
-      } satisfies Omit<
-        IPageInfoForEmpty,
-        'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'
-      >;
+      } satisfies IPageInfoBasicForEmpty;
     }
 
     const likers = page.liker.slice(0, 15) as Ref<IUserHasId>[];
@@ -3298,10 +3295,7 @@ class PageService implements IPageService {
       // the page must have a revision if it is not empty
       // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       latestRevisionId: getIdStringForRef(page.revision!),
-    } satisfies Omit<
-      IPageInfoForEntity,
-      'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'
-    >;
+    } satisfies IPageInfoBasicForEntity;
 
     return infoForEntity;
   }

+ 11 - 12
packages/core/src/interfaces/page.ts

@@ -170,18 +170,17 @@ export const isIPageInfoForEntity = (
   return isIPageInfo(pageInfo) && pageInfo.isEmpty === false;
 };
 
-export type IPageInfoBasic =
-  | Omit<
-      IPageInfoForEmpty,
-      | 'bookmarkCount'
-      | 'isDeletable'
-      | 'isAbleToDeleteCompletely'
-      | 'isBookmarked'
-    >
-  | Omit<
-      IPageInfoForEntity,
-      'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'
-    >;
+export type IPageInfoBasicForEmpty = Omit<
+  IPageInfoForEmpty,
+  'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely' | 'isBookmarked'
+>;
+
+export type IPageInfoBasicForEntity = Omit<
+  IPageInfoForEntity,
+  'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'
+>;
+
+export type IPageInfoBasic = IPageInfoBasicForEmpty | IPageInfoBasicForEntity;
 
 export const isIPageInfoForOperation = (
   // biome-ignore lint/suspicious/noExplicitAny: ignore