refac: SammoAPI에서 인자, 반환 타입을 사전 지정 가능

This commit is contained in:
2022-03-25 22:48:34 +09:00
parent be308fdb4a
commit 9d868cb2f4
5 changed files with 31 additions and 18 deletions
+2 -2
View File
@@ -20,11 +20,11 @@ const apiRealPath = {
},
} as const;
export const SammoRootAPI = APIPathGen<typeof done, typeof apiRealPath>(apiRealPath, (path: string[]) => {
export const SammoRootAPI = APIPathGen(apiRealPath, (path: string[]) => {
return (args?: Record<string, unknown>, returnError?: boolean) => {
if (returnError) {
return callSammoAPI(path.join('/'), args, true);
}
return callSammoAPI(path.join('/'), args);
};
});
}) as typeof apiRealPath;