]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/models/video/video-blacklist-interface.ts
Remove any typing from server
[github/Chocobozzz/PeerTube.git] / server / models / video / video-blacklist-interface.ts
CommitLineData
e02643f3 1import * as Sequelize from 'sequelize'
6fcd19ba
C
2import * as Promise from 'bluebird'
3
4import { ResultList } from '../../../shared'
e02643f3 5
69818c93 6// Don't use barrel, import just what we need
4771e000 7import { BlacklistedVideo as FormatedBlacklistedVideo } from '../../../shared/models/videos/video-blacklist.model'
69818c93 8
e02643f3 9export namespace BlacklistedVideoMethods {
70c065d6 10 export type ToFormatedJSON = (this: BlacklistedVideoInstance) => FormatedBlacklistedVideo
69818c93 11
6fcd19ba 12 export type CountTotal = () => Promise<number>
69818c93 13
6fcd19ba 14 export type List = () => Promise<BlacklistedVideoInstance[]>
69818c93 15
6fcd19ba 16 export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<BlacklistedVideoInstance> >
69818c93 17
6fcd19ba 18 export type LoadById = (id: number) => Promise<BlacklistedVideoInstance>
e02643f3 19
6fcd19ba 20 export type LoadByVideoId = (id: string) => Promise<BlacklistedVideoInstance>
e02643f3
C
21}
22
23export interface BlacklistedVideoClass {
24 toFormatedJSON: BlacklistedVideoMethods.ToFormatedJSON
25 countTotal: BlacklistedVideoMethods.CountTotal
26 list: BlacklistedVideoMethods.List
27 listForApi: BlacklistedVideoMethods.ListForApi
28 loadById: BlacklistedVideoMethods.LoadById
29 loadByVideoId: BlacklistedVideoMethods.LoadByVideoId
30}
31
32export interface BlacklistedVideoAttributes {
70c065d6 33 videoId: string
e02643f3
C
34}
35
6fcd19ba
C
36export interface BlacklistedVideoInstance
37 extends BlacklistedVideoClass, BlacklistedVideoAttributes, Sequelize.Instance<BlacklistedVideoAttributes> {
e02643f3
C
38 id: number
39 createdAt: Date
40 updatedAt: Date
154898b0
C
41
42 toFormatedJSON: BlacklistedVideoMethods.ToFormatedJSON
e02643f3
C
43}
44
6fcd19ba
C
45export interface BlacklistedVideoModel
46 extends BlacklistedVideoClass, Sequelize.Model<BlacklistedVideoInstance, BlacklistedVideoAttributes> {}