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

style: retype G2GProgressStatus

mizozobu 3 лет назад
Родитель
Сommit
10be495a3a
1 измененных файлов с 6 добавлено и 20 удалено
  1. 6 20
      packages/app/src/interfaces/g2g-transfer.ts

+ 6 - 20
packages/app/src/interfaces/g2g-transfer.ts

@@ -1,20 +1,6 @@
 /**
- * Get the union type of all the values in an object, array or array-like type `T`
- * @see {@link https://github.com/piotrwitek/utility-types/blob/df2502ef504c4ba8bd9de81a45baef112b7921d0/src/mapped-types.ts#L589-L597}
+ * G2G transfer progress status master
  */
-type ValuesType<
- T extends ReadonlyArray<any> | ArrayLike<any> | Record<any, any>
-> = T extends ReadonlyArray<any>
- ? T[number]
- : T extends ArrayLike<any>
- ? T[number]
- : T extends object
- ? T[keyof T]
- : never;
-
-/**
-* G2G transfer progress status master
-*/
 export const G2G_PROGRESS_STATUS = {
   PENDING: 'PENDING',
   IN_PROGRESS: 'IN_PROGRESS',
@@ -23,13 +9,13 @@ export const G2G_PROGRESS_STATUS = {
 } as const;
 
 /**
-* G2G transfer progress status
-*/
-export type G2GProgressStatus = ValuesType<typeof G2G_PROGRESS_STATUS>
+ * G2G transfer progress status
+ */
+export type G2GProgressStatus = typeof G2G_PROGRESS_STATUS[keyof typeof G2G_PROGRESS_STATUS];
 
 /**
-* G2G transfer progress
-*/
+ * G2G transfer progress
+ */
 export interface G2GProgress {
  mongo: G2GProgressStatus;
  attachments: G2GProgressStatus;