PeerTube/server/models/video/video-abuse-interface.ts

37 lines
1.1 KiB
TypeScript
Raw Normal View History

2017-05-22 20:58:25 +02:00
import * as Sequelize from 'sequelize'
import * as Promise from 'bluebird'
2017-05-22 20:58:25 +02:00
2017-11-15 11:00:25 +01:00
import { ServerInstance } from '../server/server-interface'
import { ResultList } from '../../../shared'
2017-06-10 22:15:25 +02:00
// Don't use barrel, import just what we need
2017-08-25 11:45:31 +02:00
import { VideoAbuse as FormattedVideoAbuse } from '../../../shared/models/videos/video-abuse.model'
2017-06-10 22:15:25 +02:00
2017-05-22 20:58:25 +02:00
export namespace VideoAbuseMethods {
2017-08-25 11:45:31 +02:00
export type ToFormattedJSON = (this: VideoAbuseInstance) => FormattedVideoAbuse
2017-05-22 20:58:25 +02:00
export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<VideoAbuseInstance> >
2017-05-22 20:58:25 +02:00
}
export interface VideoAbuseClass {
listForApi: VideoAbuseMethods.ListForApi
}
export interface VideoAbuseAttributes {
reporterUsername: string
reason: string
videoId: number
2017-05-22 20:58:25 +02:00
}
2017-06-10 22:15:25 +02:00
export interface VideoAbuseInstance extends VideoAbuseClass, VideoAbuseAttributes, Sequelize.Instance<VideoAbuseAttributes> {
2017-05-22 20:58:25 +02:00
id: number
createdAt: Date
updatedAt: Date
2017-11-15 11:00:25 +01:00
Server: ServerInstance
2017-06-17 11:28:11 +02:00
2017-08-25 11:45:31 +02:00
toFormattedJSON: VideoAbuseMethods.ToFormattedJSON
2017-05-22 20:58:25 +02:00
}
export interface VideoAbuseModel extends VideoAbuseClass, Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> {}