Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#29132 from ChrisGrant/master
Browse files Browse the repository at this point in the history
[parse] Added fullText function to Parse.Query
  • Loading branch information
amcasey authored Oct 5, 2018
2 parents f0c544e + 5f62d00 commit a9d8ace
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions types/parse/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ declare namespace Parse {
exists(key: string): Query<T>;
find(options?: Query.FindOptions): Promise<T[]>;
first(options?: Query.FirstOptions): Promise<T | undefined>;
fullText(key: string, value: string, options?: Query.FullTextOptions): Query<T>;
get(objectId: string, options?: Query.GetOptions): Promise<T>;
greaterThan(key: string, value: any): Query<T>;
greaterThanOrEqualTo(key: string, value: any): Query<T>;
Expand Down Expand Up @@ -675,6 +676,13 @@ declare namespace Parse {
// Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort
sort?: {[key: string]: 1|-1};
}

// According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText
interface FullTextOptions {
language?: string;
caseSensitive?: boolean;
diacriticSensitive?: boolean;
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions types/parse/parse-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function test_query() {
const query = new Parse.Query(GameScore);
query.equalTo("playerName", "Dan Stemkoski");
query.notEqualTo("playerName", "Michael Yabuti");
query.fullText("playerName", "dan", { language: 'en', caseSensitive: false, diacriticSensitive: true });
query.greaterThan("playerAge", 18);
query.limit(10);
query.skip(10);
Expand Down

0 comments on commit a9d8ace

Please sign in to comment.