The typical approach to this in Python is to define a callable class instead. If you define the __call__() method on a class, instances of the class will be callable.
Ah, that's not really that different than in TypeScript then. There you have to define a callable interface, and can add whatever properties you want
interface SomethingCallableWithAnExtraProperty {
// This means you can call it like a function.
(args: Whatever): SomethingReturned
// And since it's an interface, you can still do interface-y things
anotherProperty: string
}
Example, I have some Redux helpers that are functions, but those functions also define a `.actionType` property. TypeScript handles that.
edit: accidentally wrote "object" instead of "function"