1 Star 0 Fork 0

HongZhijun/maybe-archive

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
custom-express.d.ts 608 Bytes
一键复制 编辑 原始数据 按行查看 历史
Anthony Shew 提交于 2024-01-14 22:52 . Handle types and tests.
import express, { Send, Response, Request } from 'express'
import { SharedType } from '@maybe-finance/shared'
// Because this is a module, need to escape from module scope and enter global scope so declaration merging works correctly
declare global {
namespace Express {
interface Request {
// Add custom properties here (i.e. if props are defined with middleware)
user?: User & SharedType.MaybeCustomClaims
}
interface Response {
json(data: any): Send<Response, this>
superjson(data: any): Send<Response, this>
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hzj111/maybe-archive.git
git@gitee.com:hzj111/maybe-archive.git
hzj111
maybe-archive
maybe-archive
main

搜索帮助