-
-type VideoFetchType = 'all' | 'only-video' | 'only-video-with-rights' | 'id' | 'none'
-
-function fetchVideo (id: number | string, fetchType: VideoFetchType, userId?: number) {
+import * as Bluebird from 'bluebird'
+import {
+ MVideoAccountLightBlacklistAllFiles,
+ MVideoFullLight,
+ MVideoIdThumbnail,
+ MVideoThumbnail,
+ MVideoWithRights,
+ MVideoImmutable
+} from '@server/typings/models'
+import { Response } from 'express'
+
+type VideoFetchType = 'all' | 'only-video' | 'only-video-with-rights' | 'id' | 'none' | 'only-immutable-attributes'
+
+function fetchVideo (id: number | string, fetchType: 'all', userId?: number): Bluebird<MVideoFullLight>
+function fetchVideo (id: number | string, fetchType: 'only-immutable-attributes'): Bluebird<MVideoImmutable>
+function fetchVideo (id: number | string, fetchType: 'only-video', userId?: number): Bluebird<MVideoThumbnail>
+function fetchVideo (id: number | string, fetchType: 'only-video-with-rights', userId?: number): Bluebird<MVideoWithRights>
+function fetchVideo (id: number | string, fetchType: 'id' | 'none', userId?: number): Bluebird<MVideoIdThumbnail>
+function fetchVideo (
+ id: number | string,
+ fetchType: VideoFetchType,
+ userId?: number
+): Bluebird<MVideoFullLight | MVideoThumbnail | MVideoWithRights | MVideoIdThumbnail | MVideoImmutable>
+function fetchVideo (
+ id: number | string,
+ fetchType: VideoFetchType,
+ userId?: number
+): Bluebird<MVideoFullLight | MVideoThumbnail | MVideoWithRights | MVideoIdThumbnail | MVideoImmutable> {