RaminZhong's recent timeline updates
RaminZhong

RaminZhong

V2EX member #537905, joined on 2021-03-16 23:55:33 +08:00
RaminZhong's recent replies
Apr 14, 2021
Replied to a topic by devlaiho 求职 [求职]Golang 后端求职,地点不限,求内推
给个微信加下聊聊?
Apr 7, 2021
Replied to a topic by no996 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;
};


冗余地方有点多,你可以自行优化下
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   937 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 20:55 · PVG 04:55 · LAX 13:55 · JFK 16:55
♥ Do have faith in what you're doing.