Conversation
|
|
||
| interface WithMethod<QB extends AnyQueryBuilder> { | ||
| (alias: string, expr: CallbackVoid<QB> | AnyQueryBuilder | Raw): QB; | ||
| (alias: string, columns: string[], expr: CallbackVoid<QB> | AnyQueryBuilder | Raw): QB; |
There was a problem hiding this comment.
I'm no TS specialist and don't personally use typings, but columns is optional, and this doesn't seem to be reflected here? Please make sure the typings work for both patterns, with and without columns.
There was a problem hiding this comment.
Please make sure the typings work for both patterns, with and without columns
@lehni
so here it is without already above:
(alias: string, expr: CallbackVoid<QB> | AnyQueryBuilder | Raw): QB;
I added - where "with columns" ( (alias: string, columns: string[], expr: CallbackVoid<QB> | AnyQueryBuilder | Raw): QB;)
I'm already using this patch in production (see ts-patch )
I'm no TS specialist and don't personally use typings
we simply declare multiple signatures for functions via an interface (overload signatures)
fixes #2749