]>
Commit | Line | Data |
---|---|---|
1 | import * as Sequelize from 'sequelize' | |
2 | import * as Promise from 'bluebird' | |
3 | ||
4 | import { ResultList } from '../../../shared' | |
5 | ||
6 | // Don't use barrel, import just what we need | |
7 | import { BlacklistedVideo as FormatedBlacklistedVideo } from '../../../shared/models/videos/video-blacklist.model' | |
8 | ||
9 | export namespace BlacklistedVideoMethods { | |
10 | export type ToFormatedJSON = (this: BlacklistedVideoInstance) => FormatedBlacklistedVideo | |
11 | ||
12 | export type CountTotal = () => Promise<number> | |
13 | ||
14 | export type List = () => Promise<BlacklistedVideoInstance[]> | |
15 | ||
16 | export type ListForApi = (start: number, count: number, sort: string) => Promise< ResultList<BlacklistedVideoInstance> > | |
17 | ||
18 | export type LoadById = (id: number) => Promise<BlacklistedVideoInstance> | |
19 | ||
20 | export type LoadByVideoId = (id: string) => Promise<BlacklistedVideoInstance> | |
21 | } | |
22 | ||
23 | export 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 | ||
32 | export interface BlacklistedVideoAttributes { | |
33 | videoId: string | |
34 | } | |
35 | ||
36 | export interface BlacklistedVideoInstance | |
37 | extends BlacklistedVideoClass, BlacklistedVideoAttributes, Sequelize.Instance<BlacklistedVideoAttributes> { | |
38 | id: number | |
39 | createdAt: Date | |
40 | updatedAt: Date | |
41 | ||
42 | toFormatedJSON: BlacklistedVideoMethods.ToFormatedJSON | |
43 | } | |
44 | ||
45 | export interface BlacklistedVideoModel | |
46 | extends BlacklistedVideoClass, Sequelize.Model<BlacklistedVideoInstance, BlacklistedVideoAttributes> {} |