RaminZhong 最近的时间轴更新
RaminZhong

RaminZhong

V2EX 第 537905 号会员,加入于 2021-03-16 23:55:33 +08:00
RaminZhong 最近回复了
2021-04-14 13:50:43 +08:00
回复了 devlaiho 创建的主题 求职 [求职]Golang 后端求职,地点不限,求内推
给个微信加下聊聊?
2021-04-07 09:43:26 +08:00
回复了 yohole 创建的主题 Apple 知道 M1 的蓝牙不好,但没想到可以这么差
这个问题一直都有,我用了 2015 年款 MacBookPro 和 2018MacMini 都会有这种现象,MacMini 更严重点,下午基本必现,很难受
不太清楚你要的是哪种效果,试着写了下

const xFetch = <
Path extends keyof paths,
OpName extends keyof paths[Path],
Parameters extends paths[Path][OpName] extends { parameters: { query?: any; body?: any } }
? paths[Path][OpName]["parameters"]
: { query: any; body: any }
>(
path: Path,
opName: OpName,
query: Parameters["query"]["query"],
body: Parameters["body"]["body"]
): Promise<
paths[Path][OpName] extends { responses: { [key: number]: { schema: any } } }
? paths[Path][OpName]["responses"][keyof paths[Path][OpName]["responses"]] extends { schema: any }
? paths[Path][OpName]["responses"][keyof paths[Path][OpName]["responses"]]["schema"]
: any
: any
> => {
return {} as any;
};


冗余地方有点多,你可以自行优化下
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3367 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 11:08 · PVG 19:08 · LAX 04:08 · JFK 07:08
Developed with CodeLauncher
♥ Do have faith in what you're doing.