refac: APICall에 타입 지정
- 비 undefined 타입에서 ?타입 호출 제거 - API 소속 type들을 defs/API/ 로 이동 - 모든 SammoAPI, SammoRootAPI 지정
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import type { AutoLoginFailed, AutoLoginNonceResponse, AutoLoginResponse } from "./defs/API/Login";
|
||||
import type { AutoLoginFailed, AutoLoginNonceResponse, AutoLoginResponse, LoginFailed, LoginResponse } from "./defs/API/Login";
|
||||
import { APIPathGen } from "./util/APIPathGen";
|
||||
import { callSammoAPI, extractHttpMethod, GET, POST, type APICallT, type APITail, type InvalidResponse, type RawArgType, type ValidResponse } from "./util/callSammoAPI";
|
||||
export type { ValidResponse, InvalidResponse };
|
||||
|
||||
const apiRealPath = {
|
||||
Login: {
|
||||
LoginByID: POST,
|
||||
LoginByID: POST as APICallT<{
|
||||
username: string,
|
||||
password: string,
|
||||
}, LoginResponse, LoginFailed>,
|
||||
LoginByToken: POST as APICallT<{
|
||||
hashedToken: string,
|
||||
token_id: number,
|
||||
|
||||
Reference in New Issue
Block a user