Просмотр исходного кода

Move SWRInfinitePageRevisionsResponse to revision interface

Mudana-Grune 3 лет назад
Родитель
Сommit
de851fc596
2 измененных файлов с 7 добавлено и 6 удалено
  1. 1 6
      packages/app/src/stores/page.tsx
  2. 6 0
      packages/core/src/interfaces/revision.ts

+ 1 - 6
packages/app/src/stores/page.tsx

@@ -1,7 +1,7 @@
 import { useEffect, useMemo } from 'react';
 import { useEffect, useMemo } from 'react';
 
 
 import type {
 import type {
-  IPageInfoForEntity, IPagePopulatedToShowRevision, IRevisionHasPageId, Nullable,
+  IPageInfoForEntity, IPagePopulatedToShowRevision, Nullable, SWRInfinitePageRevisionsResponse,
 } from '@growi/core';
 } from '@growi/core';
 import { Ref, isClient, pagePathUtils } from '@growi/core';
 import { Ref, isClient, pagePathUtils } from '@growi/core';
 import useSWR, { mutate, SWRResponse } from 'swr';
 import useSWR, { mutate, SWRResponse } from 'swr';
@@ -168,11 +168,6 @@ export const useSWRxPageRevisions = (
 /*
 /*
  * SWR Infinite for page revision list
  * SWR Infinite for page revision list
  */
  */
-type SWRInfinitePageRevisionsResponse = {
-  revisions: IRevisionHasPageId[],
-  totalCount: number,
-  offset: number,
-}
 
 
 export const useSWRxInfinitePageRevisions = (
 export const useSWRxInfinitePageRevisions = (
     pageId: string | null | undefined,
     pageId: string | null | undefined,

+ 6 - 0
packages/core/src/interfaces/revision.ts

@@ -32,3 +32,9 @@ export type IRevisionOnConflict = {
 export type HasRevisionShortbody = {
 export type HasRevisionShortbody = {
   revisionShortBody?: string,
   revisionShortBody?: string,
 }
 }
+
+export type SWRInfinitePageRevisionsResponse = {
+  revisions: IRevisionHasPageId[],
+  totalCount: number,
+  offset: number,
+}