diff --git a/src/types/express.d.ts b/src/types/express.d.ts index 6776a27682..a11eebeadc 100644 --- a/src/types/express.d.ts +++ b/src/types/express.d.ts @@ -2,12 +2,16 @@ * Custom properties on the req object in express */ -declare namespace Express { - export interface Request { - token?: string; - user?: string; - role?: string; - collection?: string; - loaders?: any; +import createSystemLoaders from '../loaders'; + +declare global { + namespace Express { + export interface Request { + token?: string; + user?: string; + role?: string; + collection?: string; + loaders?: ReturnType; + } } }