mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[web] Add some types to web module (#27051)
* Update `WebModule` types * Add `if (module.middleware)` so types are satisfied GitOrigin-RevId: 875fa2710a65d557037771c3eb76ff3cb0e73429
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { RequestHandler } from 'express'
|
||||
|
||||
type LinkedFileAgent = {
|
||||
createLinkedFile: (
|
||||
projectId: string,
|
||||
@@ -41,6 +43,11 @@ export type WebModule = {
|
||||
privateApiRouter?: any,
|
||||
publicApiRouter?: any
|
||||
) => void
|
||||
applyNonCsrfRouter?: (
|
||||
webRouter: any,
|
||||
privateApiRouter?: any,
|
||||
publicApiRouter?: any
|
||||
) => void
|
||||
}
|
||||
nonCsrfRouter?: {
|
||||
apply: (webRouter: any, privateApiRouter: any, publicApiRouter: any) => void
|
||||
@@ -49,7 +56,7 @@ export type WebModule = {
|
||||
[name: string]: (args: any[]) => void
|
||||
}
|
||||
middleware?: {
|
||||
[name: string]: (req: any, res: any, next: any) => void
|
||||
[name: string]: RequestHandler
|
||||
}
|
||||
sessionMiddleware?: (webRouter: any, options: any) => void
|
||||
start?: () => Promise<void>
|
||||
@@ -57,4 +64,5 @@ export type WebModule = {
|
||||
linkedFileAgents?: {
|
||||
[name: string]: () => LinkedFileAgent
|
||||
}
|
||||
viewIncludes?: Record<string, string[]>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user