aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request-video-event-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
commit69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch)
treead199a18ec3c322460d6f9523fc383ee562554e0 /server/models/request-video-event-interface.ts
parent4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff)
downloadPeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz
PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst
PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip
Type functions
Diffstat (limited to 'server/models/request-video-event-interface.ts')
-rw-r--r--server/models/request-video-event-interface.ts32
1 files changed, 27 insertions, 5 deletions
diff --git a/server/models/request-video-event-interface.ts b/server/models/request-video-event-interface.ts
index a31c7108f..ad576a2b1 100644
--- a/server/models/request-video-event-interface.ts
+++ b/server/models/request-video-event-interface.ts
@@ -1,10 +1,30 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2 2
3import { VideoInstance } from './video-interface'
4import { PodInstance } from './pod-interface'
5
6export type RequestsVideoEventGrouped = {
7 [ podId: number ]: {
8 id: number
9 type: string
10 count: number
11 video: VideoInstance
12 pod: PodInstance
13 }[]
14}
15
3export namespace RequestVideoEventMethods { 16export namespace RequestVideoEventMethods {
4 export type CountTotalRequests = (callback) => void 17 export type CountTotalRequestsCallback = (err: Error, total: number) => void
5 export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback) => void 18 export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
6 export type RemoveByRequestIdsAndPod = (ids, podId, callback) => void 19
7 export type RemoveAll = (callback) => void 20 export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoEventGrouped) => void
21 export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void
22
23 export type RemoveByRequestIdsAndPodCallback = () => void
24 export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void
25
26 export type RemoveAllCallback = () => void
27 export type RemoveAll = (callback: RemoveAllCallback) => void
8} 28}
9 29
10export interface RequestVideoEventClass { 30export interface RequestVideoEventClass {
@@ -19,8 +39,10 @@ export interface RequestVideoEventAttributes {
19 count: number 39 count: number
20} 40}
21 41
22export interface RequestVideoEventInstance extends Sequelize.Instance<RequestVideoEventAttributes> { 42export interface RequestVideoEventInstance extends RequestVideoEventClass, RequestVideoEventAttributes, Sequelize.Instance<RequestVideoEventAttributes> {
23 id: number 43 id: number
44
45 Video: VideoInstance
24} 46}
25 47
26export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {} 48export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {}