refac: SammoAPI Path 정의에 NumVar, StrVar 추가

This commit is contained in:
Hide_D committed 2022-03-25 23:29:10 +09:00
1 parent 9d868cb2f4
commit 24c043386d
5 files changed
+51 -33

No files matched your search

+19 -1
View File
@@ -1 +1,19 @@
export function APIPathGen<T>(obj: T, callback: (path: string[])=>unknown): T;
export function APIPathGen<T>(obj: T, callback: (path: string[])=>unknown): T;
export function StrVar<PathType extends string>(): <NextCall>(next: NextCall)=>{
[v in PathType]: NextCall
};
export function NumVar<NextCall>(next: NextCall):{
[v: number]: NextCall
};
/*
const apiPath = {
SomePath: someFunc,
User: StrVar<'a'|'b'>()({
Update: someFunc,
Delete: someFunc,
})
}
*/