mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #36767 from overleaf/oa-express-types
[web] Express req/res/next types GitOrigin-RevId: 30b4822e2ee55976331d049f8109f7098914973c
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'express'
|
||||
import OAuth2Server from '@node-oauth/oauth2-server'
|
||||
import type SessionData from 'express-session'
|
||||
import type { Capability } from '../../capabilities'
|
||||
|
||||
// Request-scoped logger attached by @overleaf/metrics http.monitor() middleware.
|
||||
// See libraries/metrics/http.js RequestLogger class.
|
||||
@@ -20,11 +21,17 @@ declare module 'express' {
|
||||
oauth_user?: OAuth2Server.User
|
||||
logger: RequestLogger
|
||||
i18n: {
|
||||
language: string
|
||||
translate(
|
||||
key: string,
|
||||
vars?: Record<string, any>,
|
||||
components?: any
|
||||
): string
|
||||
}
|
||||
// Set by PermissionMiddleware
|
||||
managedBy?: any
|
||||
isManagedGroupAdmin?: boolean
|
||||
capabilitySet?: Set<Capability>
|
||||
assertPermission(capability: string): void
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import 'express'
|
||||
|
||||
declare module 'express' {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
interface Response {
|
||||
// Set per-request by the addSetContentDisposition middleware in
|
||||
// app/src/infrastructure/ExpressLocals.mjs (web/private-api/public-api routers only).
|
||||
setContentDisposition(
|
||||
type: 'attachment' | 'inline',
|
||||
opts: { filename: string }
|
||||
): void
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user