import { Document, SchemaType } from 'mongoose'; declare module 'mongoose' { // export function model( // name: string, // schema?: Schema, // collection?: string, // skipInit?: boolean // ): Model; // interface Model // extends NodeJS.EventEmitter, // ModelProperties { // /** // * Model constructor // * Provides the interface to MongoDB collections as well as creates document instances. // * @param doc values with which to create the document // * @event error If listening to this event, it is emitted when a document // * was saved without passing a callback and an error occurred. If not // * listening, the event bubbles to the connection used to create this Model. // * @event index Emitted after Model#ensureIndexes completes. If an error // * occurred it is passed with the event. // * @event index-single-start Emitted when an individual index starts within // * Model#ensureIndexes. The fields and options being used to build the index // * are also passed with the event. // * @event index-single-done Emitted when an individual index finishes within // * Model#ensureIndexes. If an error occurred it is passed with the event. // * The fields, options, and index name are also passed. // */ // new (doc?: U): T; // } export class nSchemaType extends SchemaType { discriminator( name: string, schema: Schema ): Model; } }