diff --git a/index.d.ts b/index.d.ts index a8f0e70..00786d2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -13,7 +13,7 @@ import { EventEmitter } from "events"; export default Nedb; -declare class Nedb extends EventEmitter { +declare class Nedb extends EventEmitter { constructor(pathOrOptions?: string | Nedb.DataStoreOptions); persistence: Nedb.Persistence; @@ -36,7 +36,7 @@ declare class Nedb extends EventEmitter { stopAutocompaction(): void; - getAllData(): T[]; + getAllData(): T[]; ensureIndex( options: Nedb.EnsureIndexOptions, @@ -49,49 +49,49 @@ declare class Nedb extends EventEmitter { removeIndexAsync(fieldName: string | string[]): Promise; - insert( + insert( newDoc: T, callback?: (err: Error | null, document: T) => void ): void; - insert( + insert( newDocs: T[], callback?: (err: Error | null, documents: T[]) => void ): void; - insertAsync(newDoc: T): Promise; - insertAsync(newDocs: T[]): Promise; + insertAsync(newDoc: T): Promise; + insertAsync(newDocs: T[]): Promise; count(query: any, callback: (err: Error | null, n: number) => void): void; count(query: any): Nedb.CursorCount; countAsync(query: any): Nedb.Cursor; - find( + find( query: any, projection: any, callback?: (err: Error | null, documents: T[]) => void ): void; - find(query: any, projection?: any): Nedb.Cursor; - find( + find(query: any, projection?: any): Nedb.Cursor; + find( query: any, callback: (err: Error | null, documents: T[]) => void ): void; - findAsync(query: any, projection?: any): Nedb.Cursor; + findAsync(query: any, projection?: any): Nedb.Cursor; - findOne( + findOne( query: any, projection: any, callback: (err: Error | null, document: T) => void ): void; - findOne( + findOne( query: any, callback: (err: Error | null, document: T) => void ): void; - findOneAsync(query: any, projection?: any): Nedb.Cursor; + findOneAsync(query: any, projection?: any): Nedb.Cursor; - update( + update( query: any, updateQuery: any, options?: Nedb.UpdateOptions, @@ -103,7 +103,7 @@ declare class Nedb extends EventEmitter { ) => void ): void; - updateAsync( + updateAsync( query: any, updateQuery: any, options?: Nedb.UpdateOptions