Fix express type extending

This commit is contained in:
rijkvanzanten
2020-06-24 17:38:35 -04:00
parent 9c176c0955
commit 368e102906

View File

@@ -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<typeof createSystemLoaders>;
}
}
}