mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
Parse.Object set and save methods can receive a object as parameter
This commit is contained in:
Vendored
+5
-3
@@ -98,11 +98,11 @@ declare namespace Parse {
|
||||
reject(error: any): void;
|
||||
resolve(result: any): void;
|
||||
then<U>(resolvedCallback: (...values: T[]) => IPromise<U>,
|
||||
rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
then<U>(resolvedCallback: (...values: T[]) => U,
|
||||
rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
rejectedCallback?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
then<U>(resolvedCallback: (...values: T[]) => U,
|
||||
rejectedCallback?: (reason: any) => U): IPromise<U>;
|
||||
rejectedCallback?: (reason: any) => U): IPromise<U>;
|
||||
}
|
||||
|
||||
interface Pointer {
|
||||
@@ -373,7 +373,9 @@ declare namespace Parse {
|
||||
remove(attr: string, item: any): any;
|
||||
save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise<this>;
|
||||
save(key: string, value: any, options?: Object.SaveOptions): Promise<this>;
|
||||
save(attrs: object, options?: Object.SaveOptions): Promise<this>;
|
||||
set(key: string, value: any, options?: Object.SetOptions): boolean;
|
||||
set(attrs: object, options?: Object.SetOptions): boolean;
|
||||
setACL(acl: ACL, options?: SuccessFailureOptions): boolean;
|
||||
toPointer(): Pointer;
|
||||
unset(attr: string, options?: any): any;
|
||||
|
||||
@@ -57,6 +57,12 @@ function test_object() {
|
||||
gameScore.set("cheatMode", false);
|
||||
|
||||
|
||||
// Setting attrs using object
|
||||
gameScore.set({
|
||||
level: '10',
|
||||
difficult: 15
|
||||
});
|
||||
|
||||
const score = gameScore.get("score");
|
||||
const playerName = gameScore.get("playerName");
|
||||
const cheatMode = gameScore.get("cheatMode");
|
||||
@@ -274,6 +280,7 @@ function test_user_acl_roles() {
|
||||
game.setACL(new Parse.ACL(Parse.User.current()));
|
||||
game.save().then((game: Game) => { });
|
||||
game.save(null, { useMasterKey: true });
|
||||
game.save({ score: '10' }, { useMasterKey: true });
|
||||
|
||||
const groupACL = new Parse.ACL();
|
||||
|
||||
@@ -366,7 +373,7 @@ function test_cloud_functions() {
|
||||
});
|
||||
|
||||
Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest,
|
||||
response: Parse.Cloud.BeforeDeleteResponse) => {
|
||||
response: Parse.Cloud.BeforeDeleteResponse) => {
|
||||
// result
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user