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-event-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-event-interface.ts')
-rw-r--r-- | server/models/request-video-event-interface.ts | 32 |
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 @@ | |||
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 RequestsVideoEventGrouped = { | ||
7 | [ podId: number ]: { | ||
8 | id: number | ||
9 | type: string | ||
10 | count: number | ||
11 | video: VideoInstance | ||
12 | pod: PodInstance | ||
13 | }[] | ||
14 | } | ||
15 | |||
3 | export namespace RequestVideoEventMethods { | 16 | export 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 | ||
10 | export interface RequestVideoEventClass { | 30 | export interface RequestVideoEventClass { |
@@ -19,8 +39,10 @@ export interface RequestVideoEventAttributes { | |||
19 | count: number | 39 | count: number |
20 | } | 40 | } |
21 | 41 | ||
22 | export interface RequestVideoEventInstance extends Sequelize.Instance<RequestVideoEventAttributes> { | 42 | export interface RequestVideoEventInstance extends RequestVideoEventClass, RequestVideoEventAttributes, Sequelize.Instance<RequestVideoEventAttributes> { |
23 | id: number | 43 | id: number |
44 | |||
45 | Video: VideoInstance | ||
24 | } | 46 | } |
25 | 47 | ||
26 | export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {} | 48 | export interface RequestVideoEventModel extends RequestVideoEventClass, Sequelize.Model<RequestVideoEventInstance, RequestVideoEventAttributes> {} |