강력한 API 타입 체크

This commit is contained in:
2023-08-06 09:27:24 +00:00
parent 7352cdbf23
commit 826b4212e5
11 changed files with 266 additions and 445 deletions
+15
View File
@@ -0,0 +1,15 @@
import { POST } from "../base";
import type { structure } from "../../apiStructure/sammoRootAPI";
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
type BaseAPI = typeof structure.Login.ReqNonce;
type RType = ExtractResponse<BaseAPI>;
type EType = ExtractError<BaseAPI>;
type QType = ExtractQuery<BaseAPI>;
export class ReqNonce extends POST<RType, EType, QType>{
protected ReqNonce = Symbol("ReqNonce");//TODO: remove this
protected override async api(query: QType): Promise<RType | EType | true> {
throw new Error("Method not implemented.");
}
}