How to define a Typescript constructor and factory function with the same name?

I am writing a Typescript definition file for an existing Javascript library.
In this library there are functions which can be called as constructors or factories.
How do I write the typings in a compatible fashion?