If you're looking for the TypeScript definition I mentioned, you can find it here. I've been working with a Meteor package called restivus. When using it, you simply instantiate the constructor like this:
var Api = new Restivus({
useDefaultAuth: true,
prettyJson: true
});
However, there's one issue when using the current definition file:
Cannot use 'new' with an expression whose type lacks a call or construct signature
. The existing definition looks like this:
declare module Restivus {
export function configure(o: {})
export function addCollection<T>(collection: Mongo.Collection<T>);
export function addRoute<T>(path: string, conf: {}, routes: {});
}
It seems that there is no explicit constructor in the definitions, and most examples I've found involve using a class to be able to call either new or constructor. How would you suggest implementing Restivus in a way that doesn't require me to use declare var
? Appreciate any guidance!