deno.land / x / mongoose@6.7.5 / test / types / generics.test.ts

generics.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { 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>;
mongoose

Version Info

Tagged at
a year ago