]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/models/job/job-interface.ts
Share models between server and client
[github/Chocobozzz/PeerTube.git] / server / models / job / job-interface.ts
1 import * as Sequelize from 'sequelize'
2
3 import { JobState } from '../../../shared/models/job.model'
4
5 export namespace JobMethods {
6 export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void
7 export type ListWithLimit = (limit: number, state: JobState, callback: ListWithLimitCallback) => void
8 }
9
10 export interface JobClass {
11 listWithLimit: JobMethods.ListWithLimit
12 }
13
14 export interface JobAttributes {
15 state: JobState
16 handlerName: string
17 handlerInputData: object
18 }
19
20 export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> {
21 id: number
22 createdAt: Date
23 updatedAt: Date
24 }
25
26 export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {}