fix(parse/query): missing base attributes in doesNotMatchKeyInQuery() (#41391)

* fix(parse/query): add type of base attributes in doesNotMatchKeyInQuery()

* lint(parse): apply lint changes
This commit is contained in:
Raschid J.F. Rafeally
2020-01-06 15:50:41 -06:00
committed by Armando Aguirre
parent 2072c9c2c3
commit 294b40b37a
2 changed files with 7 additions and 1 deletions

View File

@@ -598,7 +598,9 @@ namespace Parse {
count(options?: Query.CountOptions): Promise<number>;
descending<K extends (keyof T['attributes'] | keyof BaseAttributes)>(key: K | K[]): this;
doesNotExist<K extends (keyof T['attributes'] | keyof BaseAttributes)>(key: K): this;
doesNotMatchKeyInQuery<U extends Object, K extends keyof T['attributes'], X extends Extract<keyof U['attributes'], string>>(key: K, queryKey: X, query: Query<U>): this;
doesNotMatchKeyInQuery<U extends Object,
K extends (keyof T['attributes'] | keyof BaseAttributes),
X extends Extract<keyof U['attributes'], string>>(key: K, queryKey: X, query: Query<U>): this;
doesNotMatchQuery<U extends Object, K extends keyof T['attributes']>(key: K, query: Query<U>): this;
distinct<K extends keyof T['attributes'], V = T['attributes'][K]>(key: K): Promise<V>;
each(callback: Function, options?: Query.EachOptions): Promise<void>;

View File

@@ -1219,6 +1219,10 @@ function testQuery() {
query.doesNotMatchKeyInQuery('unexistenProp', 'x', new Parse.Query(AnotherSubclass));
// $ExpectError
query.doesNotMatchKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubclass));
// $ExpectType Query<MySubClass>
query.doesNotMatchKeyInQuery('objectId', 'x', new Parse.Query(AnotherSubclass));
// $ExpectType Query<MySubClass>
query.doesNotMatchKeyInQuery('updatedAt', 'x', new Parse.Query(AnotherSubclass));
// $ExpectType Query<MySubClass>
query.doesNotMatchQuery('attribute1', new Parse.Query('Example'));