1
0
Fork 0
peertube/server/models/job/job-interface.ts
2017-06-16 10:36:18 +02:00

26 lines
743 B
TypeScript

import * as Sequelize from 'sequelize'
import { JobState } from '../../../shared/models/job.model'
export namespace JobMethods {
export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void
export type ListWithLimit = (limit: number, state: JobState, callback: ListWithLimitCallback) => void
}
export interface JobClass {
listWithLimit: JobMethods.ListWithLimit
}
export interface JobAttributes {
state: JobState
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> {}