How to infer connection type in TypeScript?

I'd like this function can receive transaction connection from another function, or can use normal db connection as default, so how to define type for this parameter?
image.png
Was this page helpful?