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

This commit is contained in:
2022-03-25 23:29:10 +09:00
parent 11e28b7a87
commit 00ceb3f842
5 changed files with 51 additions and 33 deletions
+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,
})
}
*/