@@ -114,18 +114,21 @@ declare module 'mongoose' {
114
114
/** Gets mongoose options */
115
115
export function get < K extends keyof MongooseOptions > ( key : K ) : MongooseOptions [ K ] ;
116
116
117
+ /*! ignore */
118
+ type CompileModelOptions = { overwriteModels ?: boolean , connection ?: Connection } ;
119
+
117
120
/**
118
121
* Returns true if Mongoose can cast the given value to an ObjectId, or
119
122
* false otherwise.
120
123
*/
121
124
export function isValidObjectId ( v : any ) : boolean ;
122
125
123
- export function model < T > ( name : string , schema ?: Schema < T , any , any > | Schema < T & Document , any , any > , collection ?: string , skipInit ?: boolean ) : Model < T > ;
126
+ export function model < T > ( name : string , schema ?: Schema < T , any , any > | Schema < T & Document , any , any > , collection ?: string , options ?: CompileModelOptions ) : Model < T > ;
124
127
export function model < T , U , TQueryHelpers = { } > (
125
128
name : string ,
126
129
schema ?: Schema < T , U , TQueryHelpers > ,
127
130
collection ?: string ,
128
- skipInit ?: boolean
131
+ options ?: CompileModelOptions
129
132
) : U ;
130
133
131
134
/** Returns an array of model names created on this instance of Mongoose. */
@@ -371,12 +374,12 @@ declare module 'mongoose' {
371
374
models : { [ index : string ] : Model < any > } ;
372
375
373
376
/** Defines or retrieves a model. */
374
- model < T > ( name : string , schema ?: Schema < any > , collection ?: string ) : Model < T > ;
377
+ model < T > ( name : string , schema ?: Schema < any > , collection ?: string , options ?: CompileModelOptions ) : Model < T > ;
375
378
model < T , U , TQueryHelpers = { } > (
376
379
name : string ,
377
380
schema ?: Schema < T , U , TQueryHelpers > ,
378
381
collection ?: string ,
379
- skipInit ?: boolean
382
+ options ?: CompileModelOptions
380
383
) : U ;
381
384
382
385
/** Returns an array of model names created on this connection. */
0 commit comments