// Type definitions for meteorjs for node-mysql-wrapper which helps in development // Project: https://github.com/nodets/node-mysql-wrapper // Definitions by: Makis Maropoulos // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module Mongo { var Collection: CollectionStatic; interface CollectionStatic { new (name: string, options?: { connection?: Object; idGeneration?: string; transform?: Function; }): Collection; } interface Collection { allow(options: { insert?: (userId: string, doc: T) => boolean; update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; remove?: (userId: string, doc: T) => boolean; fetch?: string[]; transform?: Function; }): boolean; deny(options: { insert?: (userId: string, doc: T) => boolean; update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; remove?: (userId: string, doc: T) => boolean; fetch?: string[]; transform?: Function; }): boolean; find(selector?: any, options?: { sort?: any; skip?: number; limit?: number; fields?: any; reactive?: boolean; transform?: Function; }): Mongo.Cursor; findOne(selector?: any, options?: { sort?: any; skip?: number; fields?: any; reactive?: boolean; transform?: Function; }): T; insert(doc: T, callback?: Function): string; rawCollection():any; rawDatabase():any; remove(selector: any, callback?: Function): void; update(selector: any, modifier: any, options?: { multi?: boolean; upsert?: boolean; }, callback?: Function): number; upsert(selector: any, modifier: any, options?: { multi?: boolean; }, callback?: Function): { numberAffected?: number; insertedId?: string; }; _ensureIndex(indexName: string, options?: { [key: string]: any }): void; } var Cursor: CursorStatic; interface CursorStatic { new (): Cursor; } interface Cursor { count(): number; fetch(): Array; forEach(callback: (doc: T, index: number, cursor: Mongo.Cursor) => void, thisArg?: any): void; map(callback: (doc: T, index: number, cursor: Mongo.Cursor) => U, thisArg?: any): Array; observe(callbacks: Object): any; observeChanges(callbacks: Object): any; } var ObjectID: ObjectIDStatic; interface ObjectIDStatic { new (hexString: string): ObjectID; } interface ObjectID { } } declare module Meteor { var isServer: boolean; var isClient: boolean; }