Explorar o código

improve Ref type

Yuki Takei %!s(int64=4) %!d(string=hai) anos
pai
achega
f94032c042

+ 3 - 1
packages/app/src/interfaces/common.ts

@@ -2,6 +2,8 @@
  * Common types and interfaces
  */
 
+import { HasObjectId } from './has-object-id';
+
 
 // Foreign key field
-export type Ref<T> = string | T;
+export type Ref<T> = string | T & HasObjectId;

+ 1 - 1
packages/app/src/interfaces/page.ts

@@ -9,7 +9,7 @@ import { SubscriptionStatusType } from './subscription';
 export interface IPage {
   path: string,
   status: string,
-  revision: Ref<IRevision & HasObjectId>,
+  revision: Ref<IRevision>,
   tags: Ref<ITag>[],
   creator: Ref<IUser>,
   createdAt: Date,