diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-09-08 04:13:01 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-09-08 04:13:01 +0900 |
| commit | 3feeaccf5955ebf17c26ccc06f32bb39624b89f6 (patch) | |
| tree | fa5d7ee54ba77dcc76ff3cae1d6791dcae499f92 /src/api/models/post.ts | |
| parent | wip dark (diff) | |
| download | sharkey-3feeaccf5955ebf17c26ccc06f32bb39624b89f6.tar.gz sharkey-3feeaccf5955ebf17c26ccc06f32bb39624b89f6.tar.bz2 sharkey-3feeaccf5955ebf17c26ccc06f32bb39624b89f6.zip | |
Add type definition
Diffstat (limited to 'src/api/models/post.ts')
| -rw-r--r-- | src/api/models/post.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api/models/post.ts b/src/api/models/post.ts index baab63f991..8b9f7f5ef6 100644 --- a/src/api/models/post.ts +++ b/src/api/models/post.ts @@ -1,3 +1,5 @@ +import * as mongo from 'mongodb'; + import db from '../../db/mongodb'; export default db.get('posts') as any; // fuck type definition @@ -5,3 +7,15 @@ export default db.get('posts') as any; // fuck type definition export function isValidText(text: string): boolean { return text.length <= 1000 && text.trim() != ''; } + +export type IPost = { + _id: mongo.ObjectID; + created_at: Date; + media_ids: mongo.ObjectID[]; + reply_to_id: mongo.ObjectID; + repost_id: mongo.ObjectID; + poll: {}; // todo + text: string; + user_id: mongo.ObjectID; + app_id: mongo.ObjectID; +}; |