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/job/job-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/job/job-interface.ts')
-rw-r--r-- | server/models/job/job-interface.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/server/models/job/job-interface.ts b/server/models/job/job-interface.ts new file mode 100644 index 000000000..ab6678257 --- /dev/null +++ b/server/models/job/job-interface.ts | |||
@@ -0,0 +1,24 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | export namespace JobMethods { | ||
4 | export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void | ||
5 | export type ListWithLimit = (limit: number, state: string, callback: ListWithLimitCallback) => void | ||
6 | } | ||
7 | |||
8 | export interface JobClass { | ||
9 | listWithLimit: JobMethods.ListWithLimit | ||
10 | } | ||
11 | |||
12 | export interface JobAttributes { | ||
13 | state: string | ||
14 | handlerName: string | ||
15 | handlerInputData: object | ||
16 | } | ||
17 | |||
18 | export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> { | ||
19 | id: number | ||
20 | createdAt: Date | ||
21 | updatedAt: Date | ||
22 | } | ||
23 | |||
24 | export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {} | ||