Skip to content

Commit

Permalink
Add missing observeAsync types
Browse files Browse the repository at this point in the history
Added missing TS types for `observeAsync` and `observeChangesAsync` as pointed out in #12918 by @ebroder
  • Loading branch information
StorytellerCZ committed Apr 20, 2024
1 parent 514c9e9 commit 5649814
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/mongo/mongo.d.ts
Expand Up @@ -430,6 +430,11 @@ export namespace Mongo {
* @param callbacks Functions to call to deliver the result set as it changes
*/
observe(callbacks: ObserveCallbacks<U>): Meteor.LiveQueryHandle;
/**
* Watch a query. Receive callbacks as the result set changes.
* @param callbacks Functions to call to deliver the result set as it changes
*/
observeAsync(callbacks: ObserveCallbacks<U>): Promise<Meteor.LiveQueryHandle>;
/**
* Watch a query. Receive callbacks as the result set changes. Only the differences between the old and new documents are passed to the callbacks.
* @param callbacks Functions to call to deliver the result set as it changes
Expand All @@ -440,6 +445,15 @@ export namespace Mongo {
): Meteor.LiveQueryHandle;
[Symbol.iterator](): Iterator<T>;
[Symbol.asyncIterator](): AsyncIterator<T>;
/**
* Watch a query. Receive callbacks as the result set changes. Only the differences between the old and new documents are passed to the callbacks.
* @param callbacks Functions to call to deliver the result set as it changes
* @param options { nonMutatingCallbacks: boolean }
*/
observeChangesAsync(
callbacks: ObserveChangesCallbacks<T>,
options?: { nonMutatingCallbacks?: boolean | undefined }
): Promise<Meteor.LiveQueryHandle>;
}

var ObjectID: ObjectIDStatic;
Expand Down

0 comments on commit 5649814

Please sign in to comment.