I was trying to write definitions for TypeScript for CraftyJS (for own use firstly), but I have a problem caused by developer's choose of using same named Crafty global object and Crafty() function. TypeScript, on the other side, blocks me from using same name for class and function in definitions file, so, maybe, developer should rename Crafty function for something like Crafty.s() for better usage? I think it's really bad practice of naming different things the same name.
I was able to surpass this issue by making small helpers.js file and defining it's only function in my d.ts file, but it's not very good.
function CraftySearch(component) {
return Crafty(component);
}
declare function CraftySearch(component : string) : Array<any>