diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
commit | 74889a71fe687dda74f2a687653122327807af36 (patch) | |
tree | e938e8b6401b74fbec80513a877d9967f2c0dbcd /server/models/video/author-interface.ts | |
parent | 15a302943d84bc0978b84fe33110c4daa451d311 (diff) | |
download | PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.gz PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.zst PeerTube-74889a71fe687dda74f2a687653122327807af36.zip |
Reorganize model files
Diffstat (limited to 'server/models/video/author-interface.ts')
-rw-r--r-- | server/models/video/author-interface.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/models/video/author-interface.ts b/server/models/video/author-interface.ts new file mode 100644 index 000000000..c1b30848c --- /dev/null +++ b/server/models/video/author-interface.ts | |||
@@ -0,0 +1,27 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | import { PodInstance } from '../pod' | ||
4 | |||
5 | export namespace AuthorMethods { | ||
6 | export type FindOrCreateAuthorCallback = (err: Error, authorInstance?: AuthorInstance) => void | ||
7 | export type FindOrCreateAuthor = (name: string, podId: number, userId: number, transaction: Sequelize.Transaction, callback: FindOrCreateAuthorCallback) => void | ||
8 | } | ||
9 | |||
10 | export interface AuthorClass { | ||
11 | findOrCreateAuthor: AuthorMethods.FindOrCreateAuthor | ||
12 | } | ||
13 | |||
14 | export interface AuthorAttributes { | ||
15 | name: string | ||
16 | } | ||
17 | |||
18 | export interface AuthorInstance extends AuthorClass, AuthorAttributes, Sequelize.Instance<AuthorAttributes> { | ||
19 | id: number | ||
20 | createdAt: Date | ||
21 | updatedAt: Date | ||
22 | |||
23 | podId: number | ||
24 | Pod: PodInstance | ||
25 | } | ||
26 | |||
27 | export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {} | ||