declare module 'mongoose' { import mongodb = require('mongodb'); /* * section collection.js */ interface CollectionBase extends mongodb.Collection { /* * Abstract methods. Some of these are already defined on the * mongodb.Collection interface so they've been commented out. */ ensureIndex(...args: any[]): any; findAndModify(...args: any[]): any; getIndexes(...args: any[]): any; /** The collection name */ collectionName: string; /** The Connection instance */ conn: Connection; /** The collection name */ name: string; } /* * section drivers/node-mongodb-native/collection.js */ interface Collection extends CollectionBase { /** * Collection constructor * @param name name of the collection * @param conn A MongooseConnection instance * @param opts optional collection options */ // eslint-disable-next-line @typescript-eslint/no-misused-new new(name: string, conn: Connection, opts?: any): Collection; /** Formatter for debug print args */ $format(arg: any, color?: boolean, shell?: boolean): string; /** Debug print helper */ $print(name: string, i: string | number, args: any[], color?: boolean, shell?: boolean): void; /** Retrieves information about this collections indexes. */ getIndexes(): ReturnType['indexInformation']>; } let Collection: Collection; }