diff --git a/mongodb/mongodb.d.ts b/mongodb/mongodb.d.ts index b96c43522a..695f14c6a4 100644 --- a/mongodb/mongodb.d.ts +++ b/mongodb/mongodb.d.ts @@ -11,6 +11,7 @@ declare module "mongodb" { import {EventEmitter} from 'events'; + // Class documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/MongoClient.html export class MongoClient { constructor(); @@ -150,7 +151,7 @@ declare module "mongodb" { socketOptions?: SocketOptions; } - // Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/db.html + // Class documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html export class Db extends EventEmitter { constructor(databaseName: string, serverConfig: Server | ReplSet | Mongos, options?: DbCreateOptions); @@ -322,7 +323,7 @@ declare module "mongodb" { } // http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html - export class Admin { + export interface Admin { // http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#addUser addUser(username: string, password: string, callback: MongoCallback): void; addUser(username: string, password: string, options?: AddUserOptions): Promise; @@ -552,7 +553,7 @@ declare module "mongodb" { } // Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html - export class Collection { + export interface Collection { // Get the collection name. collectionName: string; // Get the full collection namespace. @@ -642,7 +643,7 @@ declare module "mongodb" { //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeOrderedBulkOp initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeUnorderedBulkOp - initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation; + initializeUnorderedBulkOp(options: CollectionOptions): OrderedBulkOperation; //http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertMany insertMany(docs: Object[], callback: MongoCallback): void insertMany(docs: Object[], options?: CollectionInsertManyOptions): Promise; @@ -871,7 +872,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html - export class OrderedBulkOperation { + export interface OrderedBulkOperation { length: number; //http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html#execute execute(callback: MongoCallback): void; @@ -884,7 +885,14 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/BulkWriteResult.html - export class BulkWriteResult { + export interface BulkWriteResult { + ok: boolean; + nInserted: number; + nUpdated: number; + nUpserted: number; + nModified: number; + nRemoved: number; + getInsertedIds(): Array; getLastOp(): Object; getRawResponse(): Object; @@ -916,7 +924,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/FindOperatorsOrdered.html - export class FindOperatorsOrdered { + export interface FindOperatorsOrdered { delete(): OrderedBulkOperation; deleteOne(): OrderedBulkOperation; replaceOne(doc: Object): OrderedBulkOperation; @@ -926,7 +934,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html - export class UnorderedBulkOperation { + export interface UnorderedBulkOperation { //http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html#execute execute(callback: MongoCallback): void; execute(options: FSyncOptions): Promise; @@ -938,7 +946,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/FindOperatorsUnordered.html - export class FindOperatorsUnordered { + export interface FindOperatorsUnordered { length: number; remove(): UnorderedBulkOperation; removeOne(): UnorderedBulkOperation; @@ -1044,7 +1052,7 @@ declare module "mongodb" { export type CursorResult = any | void | boolean; //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html - export class Cursor extends EventEmitter implements Readable { + export interface Cursor extends Readable, NodeJS.EventEmitter { sortValue: string; timeout: boolean; @@ -1161,7 +1169,7 @@ declare module "mongodb" { export type AggregationCursorResult = any | void; //http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html - export class AggregationCursor extends EventEmitter implements Readable { + export interface AggregationCursor extends Readable, NodeJS.EventEmitter { // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#batchSize batchSize(value: number): AggregationCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#clone @@ -1225,7 +1233,7 @@ declare module "mongodb" { } //http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html - export class CommandCursor extends EventEmitter implements Readable { + export interface CommandCursor extends Readable, NodeJS.EventEmitter { // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#batchSize batchSize(value: number): CommandCursor; // http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#clone