deno.land / x / mongoose@6.7.5 / test / types / generics.test.ts
12345678910111213141516import { Model, Document } from 'mongoose';
class Repository<T> { private readonly Model: Model<T & Document>;
findById(id: string): Promise<T & Document> { return Model.findById(id).exec(); }}
class Foo { name: string;}
type Test = Repository<Foo>;
Version Info