refac: SammoAPI Path 정의에 NumVar, StrVar 추가
This commit is contained in:
Vendored
+19
-1
@@ -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,
|
||||
})
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user