Browse Source

create IWatcher

Shun Miyazawa 4 years ago
parent
commit
67981a4fc6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/app/src/server/models/watcher.ts

+ 3 - 1
packages/app/src/server/models/watcher.ts

@@ -8,7 +8,7 @@ const STATUS_WATCH = 'WATCH';
 const STATUS_IGNORE = 'IGNORE';
 const STATUS_IGNORE = 'IGNORE';
 const STATUSES = [STATUS_WATCH, STATUS_IGNORE];
 const STATUSES = [STATUS_WATCH, STATUS_IGNORE];
 
 
-export interface WatcherDocument extends Document {
+export interface IWatcher {
   _id: Types.ObjectId
   _id: Types.ObjectId
   user: Types.ObjectId
   user: Types.ObjectId
   targetModel: string
   targetModel: string
@@ -20,6 +20,8 @@ export interface WatcherDocument extends Document {
   isIgnoring(): boolean
   isIgnoring(): boolean
 }
 }
 
 
+export interface WatcherDocument extends IWatcher, Document {}
+
 export interface WatcherModel extends Model<WatcherDocument> {
 export interface WatcherModel extends Model<WatcherDocument> {
   findByUserIdAndTargetId(userId: Types.ObjectId, targetId: Types.ObjectId): any
   findByUserIdAndTargetId(userId: Types.ObjectId, targetId: Types.ObjectId): any
   upsertWatcher(user: Types.ObjectId, targetModel: string, target: Types.ObjectId, status: string): any
   upsertWatcher(user: Types.ObjectId, targetModel: string, target: Types.ObjectId, status: string): any