Currently, I am struggling with a specific typescript definition that is not functioning as expected:
mapping.ts
class Mapping {
//
}
var mapping = new Mapping();
export = mapping;
This setup allows for the following usage:
import _mapping = require('mapping');
_mapping.doSomething();
Unfortunately, I am unable to figure out the correct structure for my mapping.d.ts file to make this work, and it fails to compile.
mapping.d.ts
export var mapping: Mapping;
The issue here is that the usage would then need to be:
_mapping.mapping.doSomething();
If you have any suggestions on how to resolve this without changing the object name in the usage, I would greatly appreciate it.