Skip to content

Commit

Permalink
Update types for min, max, avg & sum (#4999)
Browse files Browse the repository at this point in the history
* Update types for min, max, avg & sum
This fixes #4994
  • Loading branch information
kraenhansen authored Oct 14, 2022
1 parent bf88394 commit c051c75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* `Realm#writeCopyTo()` doesn't support flexible sync, and an exception is thrown. ([realm/realm-core#5798](https://github.com/realm/realm-core/issues/5798) and , since v10.10.0)
* Asymmetric object types/classes cannot be used with partition-based sync, and an exception is thrown. ([realm/realm-core#5691](https://github.com/realm/realm-core/issues/5691), since v10.19.0)
* If you set a subscription on a link in flexible sync, the server would not know how to handle it. ([realm/realm-core#5409](https://github.com/realm/realm-core/issues/5409), since v10.10.1)
* Fixed type declarations for aggregation methods (min, max, sum, avg) to reflect implementation. ([4994](https://github.com/realm/realm-js/issues/4994), since v2.0.0)

### Compatibility
* React Native >= v0.64.0
Expand Down
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ declare namespace Realm {
*/
isEmpty(): boolean;

min(property?: string): number | Date | null;
max(property?: string): number | Date | null;
sum(property?: string): number | null;
avg(property?: string): number;
min(property?: string): number | Date | undefined;
max(property?: string): number | Date | undefined;
avg(property?: string): number | undefined;
sum(property?: string): number;

/**
* @param {string} query
Expand Down

0 comments on commit c051c75

Please sign in to comment.