A
Size: a a a
НК
m
// typings/express.d.ts
declare module Express {
export interface Request{
[key: string]: any
}
}
// example.ts
import express, { Request, Response, NextFunction } from 'express'
interface RequestWithModels extends Request {
model : MyModel;
}
router.get('/path',
getHistory, //<- тут ошибка
returnHistory
)
async function getHistory (req: RequestWithModels, res: Response, next: NextFunction) {
// smthing
}
m
m
m
m
AM
EG
type Foo = { [key in string]: Bar };
interface Foo {
[key: string]: Bar
}
Record<string, Foo>
NT
go
AM
type Foo = { [key in string]: Bar };
interface Foo {
[key: string]: Bar
}
Record<string, Foo>
МХ
МХ
R:
R:
MK
R: