This question is a refinement of my earlier one: How do I write a TypeScript declaration file for an external commonjs module that has constructor?
I\'m trying to write
Ideally, all of the interfaces will be defined inside of module "imap", so there is no pollution of the global scope
Instead of:
interface IFetchOptions {
markSeen: boolean;
// so on
}
interface ICriteria {
ALL: void;
}
Do the following
module imap {
interface IFetchOptions {
markSeen: boolean;
// so on
}
interface ICriteria {
ALL: void;
}
}
And you only pollute the global scope with imap
. Which is a non-initializaed module and can only be used for Type Information.
Reference : look at ghost modules : http://definitelytyped.org/guides/best-practices.html