1
0
Fork 0
peertube/server/models/job/job-interface.ts

27 lines
676 B
TypeScript
Raw Normal View History

2017-05-22 18:58:25 +00:00
import * as Sequelize from 'sequelize'
import * as Promise from 'bluebird'
2017-05-22 18:58:25 +00:00
2017-06-16 08:36:18 +00:00
import { JobState } from '../../../shared/models/job.model'
2017-05-22 18:58:25 +00:00
export namespace JobMethods {
export type ListWithLimit = (limit: number, state: JobState) => Promise<JobInstance[]>
2017-05-22 18:58:25 +00:00
}
export interface JobClass {
listWithLimit: JobMethods.ListWithLimit
}
export interface JobAttributes {
2017-06-16 08:36:18 +00:00
state: JobState
2017-05-22 18:58:25 +00:00
handlerName: string
handlerInputData: object
}
export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> {
id: number
createdAt: Date
updatedAt: Date
}
export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {}