Type alias ParseWithVars<Q, Vars>
Parse
With
Vars
<Q, Vars>: Q extends `${infer Head
},${infer Tail
}` ? ParseWithVars<Head, Vars> & ParseWithVars<Tail, Vars> : Q extends `${infer Var
} ${"AS" | "as"} ${infer Name
}` ? { [ X in Trim<Name>]: Trim<Var> extends keyof Vars ? Vars[Trim<Var>] : Unknown } : Q extends `${infer Var
}` ? Trim<Var> extends keyof Vars ? { [ X in Trim<Var>]: Trim<Var> extends keyof Vars ? Vars[Trim<Var>] : Unknown } : Trim<Var> extends "*" ? Vars : { [ X in Trim<Var>]: Unknown } : {}