From 4412049ea6863d9caf822bd356b585dbd26c3abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Tom=C3=A9?= Date: Tue, 4 Jun 2019 15:28:42 -0300 Subject: [PATCH] Fix Parse Object types (#35894) * Fix ParseObject types of @types/parse * Add myself to "Definitions by" section * Change all false boolean types to false type All occurrences of `this | boolean` in `Parse.Object` was acctually `this | false` --- types/parse/index.d.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 3aed86461c..53414d9769 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -11,6 +11,7 @@ // Diamond Lewis // Jong Eun Lee // Julien Quere +// Yago Tomé // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -295,7 +296,7 @@ declare namespace Parse { static fetchAll(list: T[], options: Object.FetchAllOptions): Promise; static fetchAllIfNeeded(list: T[], options: Object.FetchAllOptions): Promise; static fetchAllWithInclude(list: T[], keys: string | Array>, options: RequestOptions): Promise; - static fromJSON(json: any, override: boolean): any; + static fromJSON(json: any, override?: boolean): Object; static pinAll(objects: Object[]): Promise; static pinAllWithName(name: string, objects: Object[]): Promise; static registerSubclass(className: string, clazz: new (options?: any) => T): void; @@ -305,10 +306,10 @@ declare namespace Parse { static unPinAllObjectsWithName(name: string): Promise; static unPinAllWithName(name: string, objects: Object[]): Promise; - add(attr: string, item: any): this | boolean; - addAll(attr: string, items: any[]): this | boolean; - addAllUnique(attr: string, items: any[]): this | boolean; - addUnique(attr: string, item: any): this | boolean; + add(attr: string, item: any): this | false; + addAll(attr: string, items: any[]): this | false; + addAllUnique(attr: string, items: any[]): this | false; + addUnique(attr: string, item: any): this | false; change(options: any): this; changedAttributes(diff: any): boolean; clear(options: any): any; @@ -337,15 +338,15 @@ declare namespace Parse { previous(attr: string): any; previousAttributes(): any; relation(attr: string): Relation; - remove(attr: string, item: any): this | boolean; - removeAll(attr: string, items: any): this | boolean; + remove(attr: string, item: any): this | false; + removeAll(attr: string, items: any): this | false; revert(): void; save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise; save(key: string, value: any, options?: Object.SaveOptions): Promise; save(attrs: object, options?: Object.SaveOptions): Promise; - set(key: string, value: any, options?: Object.SetOptions): boolean; - set(attrs: object, options?: Object.SetOptions): boolean; - setACL(acl: ACL, options?: SuccessFailureOptions): boolean; + set(key: string, value: any, options?: Object.SetOptions): this | false; + set(attrs: object, options?: Object.SetOptions): this | false; + setACL(acl: ACL, options?: SuccessFailureOptions): this | false; toPointer(): Pointer; unPin(): Promise; unPinWithName(name: string): Promise;