models.d.ts [mongoose.d.ts]
/// <reference path='./../../typings/mongoose/mongoose.d.ts' />
import * as mongoose from 'mongoose';
// Tried `V0`, `V1`, `V2`, `V3` independently. None worked.
/* V0 */
export interface Foo extends mongoose.Document {
name: string;
}
models.ts
/// <reference path='./models.d.ts' />
import * as mongoose from 'mongoose';
export function Foo(model): Foo.Foo /* also tried `Foo` and `models.Foo` */ {
return mongoose.model('Foo', new mongoose.Schema({
name: String
}));
}
More context + attempts (gist).
Error
Cannot find name 'Foo'
As you can see, I even included reference path AND tsconfig.json, to no avail. How do I import it?