diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
commit | 69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch) | |
tree | ad199a18ec3c322460d6f9523fc383ee562554e0 /server/models/request-video-qadu-interface.ts | |
parent | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff) | |
download | PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip |
Type functions
Diffstat (limited to 'server/models/request-video-qadu-interface.ts')
-rw-r--r-- | server/models/request-video-qadu-interface.ts | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/server/models/request-video-qadu-interface.ts b/server/models/request-video-qadu-interface.ts index 6fe34ee91..04de7f159 100644 --- a/server/models/request-video-qadu-interface.ts +++ b/server/models/request-video-qadu-interface.ts | |||
@@ -1,10 +1,28 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | 2 | ||
3 | import { VideoInstance } from './video-interface' | ||
4 | import { PodInstance } from './pod-interface' | ||
5 | |||
6 | export type RequestsVideoQaduGrouped = { | ||
7 | [ podId: number ]: { | ||
8 | request: RequestVideoQaduInstance | ||
9 | video: VideoInstance | ||
10 | pod: PodInstance | ||
11 | } | ||
12 | } | ||
13 | |||
3 | export namespace RequestVideoQaduMethods { | 14 | export namespace RequestVideoQaduMethods { |
4 | export type CountTotalRequests = (callback) => void | 15 | export type CountTotalRequestsCallback = (err: Error, total: number) => void |
5 | export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback) => void | 16 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void |
6 | export type RemoveByRequestIdsAndPod = (ids, podId, callback) => void | 17 | |
7 | export type RemoveAll = (callback) => void | 18 | export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void |
19 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void | ||
20 | |||
21 | export type RemoveByRequestIdsAndPodCallback = () => void | ||
22 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void | ||
23 | |||
24 | export type RemoveAllCallback = () => void | ||
25 | export type RemoveAll = (callback: RemoveAllCallback) => void | ||
8 | } | 26 | } |
9 | 27 | ||
10 | export interface RequestVideoQaduClass { | 28 | export interface RequestVideoQaduClass { |
@@ -18,8 +36,11 @@ export interface RequestVideoQaduAttributes { | |||
18 | type: string | 36 | type: string |
19 | } | 37 | } |
20 | 38 | ||
21 | export interface RequestVideoQaduInstance extends Sequelize.Instance<RequestVideoQaduAttributes> { | 39 | export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { |
22 | id: number | 40 | id: number |
41 | |||
42 | Pod: PodInstance | ||
43 | Video: VideoInstance | ||
23 | } | 44 | } |
24 | 45 | ||
25 | export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} | 46 | export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} |