X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftypings%2Fexpress%2Findex.d.ts;h=1a99b598aabacb6be95983d07e610c81ff5a726c;hb=597f771f3f2bfe4b1e7234a5760e23f0283e2b29;hp=f58436ce1e406d6db9d3ec152c9383a58bf0a781;hpb=76148b27f7501bac061992136852be4303370c8d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/typings/express/index.d.ts b/server/typings/express/index.d.ts index f58436ce1..1a99b598a 100644 --- a/server/typings/express/index.d.ts +++ b/server/typings/express/index.d.ts @@ -1,3 +1,5 @@ + +import { OutgoingHttpHeaders } from 'http' import { RegisterServerAuthExternalOptions } from '@server/types' import { MAbuseMessage, @@ -9,6 +11,8 @@ import { MStreamingPlaylist, MVideoChangeOwnershipFull, MVideoFile, + MVideoFormattableDetails, + MVideoId, MVideoImmutable, MVideoLive, MVideoPlaylistFull, @@ -19,10 +23,8 @@ import { MPlugin, MServer, MServerBlocklist } from '@server/types/models/server' import { MVideoImportDefault } from '@server/types/models/video/video-import' import { MVideoPlaylistElement, MVideoPlaylistElementVideoUrlPlaylistPrivacy } from '@server/types/models/video/video-playlist-element' import { MAccountVideoRateAccountVideo } from '@server/types/models/video/video-rate' -import { HttpMethod } from '@shared/core-utils/miscs/http-methods' -import { VideoCreate } from '@shared/models' +import { HttpMethod, PeerTubeProblemDocumentData, ServerErrorCode, VideoCreate } from '@shared/models' import { File as UploadXFile, Metadata } from '@uploadx/core' -import { ProblemDocumentOptions } from 'http-problem-details/dist/ProblemDocument' import { RegisteredPlugin } from '../../lib/plugins/plugin-manager' import { MAccountDefault, @@ -35,12 +37,12 @@ import { MVideoBlacklist, MVideoCaptionVideo, MVideoFullLight, - MVideoIdThumbnail, MVideoRedundancyVideo, MVideoShareActor, - MVideoThumbnail, - MVideoWithRights + MVideoThumbnail } from '../../types/models' +import { Writable } from 'stream' + declare module 'express' { export interface Request { query: any @@ -86,19 +88,34 @@ declare module 'express' { // Extends Response with added functions and potential variables passed by middlewares interface Response { - docs?: string fail: (options: { - data?: Record - docs?: string message: string - } & ProblemDocumentOptions) => void + + title?: string + status?: number + type?: ServerErrorCode + instance?: string + + data?: PeerTubeProblemDocumentData + }) => void locals: { + apicache: { + content: string | Buffer + write: Writable['write'] + writeHead: Response['writeHead'] + end: Response['end'] + cacheable: boolean + headers: OutgoingHttpHeaders + } + + docUrl?: string + + videoAPI?: MVideoFormattableDetails videoAll?: MVideoFullLight onlyImmutableVideo?: MVideoImmutable onlyVideo?: MVideoThumbnail - onlyVideoWithRights?: MVideoWithRights - videoId?: MVideoIdThumbnail + videoId?: MVideoId videoLive?: MVideoLive