PeerTube/server/models/job/job-interface.ts

25 lines
678 B
TypeScript
Raw Normal View History

2017-05-22 20:58:25 +02:00
import * as Sequelize from 'sequelize'
export namespace JobMethods {
2017-06-10 22:15:25 +02:00
export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void
export type ListWithLimit = (limit: number, state: string, callback: ListWithLimitCallback) => void
2017-05-22 20:58:25 +02:00
}
export interface JobClass {
listWithLimit: JobMethods.ListWithLimit
}
export interface JobAttributes {
state: string
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> {}