]>
Commit | Line | Data |
---|---|---|
1 | import * as Sequelize from 'sequelize' | |
2 | import * as Promise from 'bluebird' | |
3 | ||
4 | import { SortType } from '../../helpers' | |
5 | import { ResultList } from '../../../shared' | |
6 | import { VideoInstance } from './video-interface' | |
7 | ||
8 | // Don't use barrel, import just what we need | |
9 | import { BlacklistedVideo as FormattedBlacklistedVideo } from '../../../shared/models/videos/video-blacklist.model' | |
10 | ||
11 | export namespace BlacklistedVideoMethods { | |
12 | export type ToFormattedJSON = (this: BlacklistedVideoInstance) => FormattedBlacklistedVideo | |
13 | ||
14 | export type CountTotal = () => Promise<number> | |
15 | ||
16 | export type List = () => Promise<BlacklistedVideoInstance[]> | |
17 | ||
18 | export type ListForApi = (start: number, count: number, sort: SortType) => Promise< ResultList<BlacklistedVideoInstance> > | |
19 | ||
20 | export type LoadById = (id: number) => Promise<BlacklistedVideoInstance> | |
21 | ||
22 | export type LoadByVideoId = (id: number) => Promise<BlacklistedVideoInstance> | |
23 | } | |
24 | ||
25 | export interface BlacklistedVideoClass { | |
26 | toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON | |
27 | countTotal: BlacklistedVideoMethods.CountTotal | |
28 | list: BlacklistedVideoMethods.List | |
29 | listForApi: BlacklistedVideoMethods.ListForApi | |
30 | loadById: BlacklistedVideoMethods.LoadById | |
31 | loadByVideoId: BlacklistedVideoMethods.LoadByVideoId | |
32 | } | |
33 | ||
34 | export interface BlacklistedVideoAttributes { | |
35 | videoId: number | |
36 | ||
37 | Video?: VideoInstance | |
38 | } | |
39 | ||
40 | export interface BlacklistedVideoInstance | |
41 | extends BlacklistedVideoClass, BlacklistedVideoAttributes, Sequelize.Instance<BlacklistedVideoAttributes> { | |
42 | id: number | |
43 | createdAt: Date | |
44 | updatedAt: Date | |
45 | ||
46 | toFormattedJSON: BlacklistedVideoMethods.ToFormattedJSON | |
47 | } | |
48 | ||
49 | export interface BlacklistedVideoModel | |
50 | extends BlacklistedVideoClass, Sequelize.Model<BlacklistedVideoInstance, BlacklistedVideoAttributes> {} |