parse: Add fromJSON

This commit is contained in:
Ryan Twomey
2017-06-19 11:25:09 -04:00
parent 8aff840533
commit cd145b1f6a
2 changed files with 4 additions and 1 deletions

View File

@@ -327,11 +327,12 @@ declare namespace Parse {
constructor(attributes?: string[], options?: any);
static extend(className: string, protoProps?: any, classProps?: any): any;
static fromJSON(json: any, override: boolean): any;
static fetchAll<T extends Object>(list: T[], options: SuccessFailureOptions): Promise<T[]>;
static fetchAllIfNeeded<T extends Object>(list: T[], options: SuccessFailureOptions): Promise<T[]>;
static destroyAll<T>(list: T[], options?: Object.DestroyAllOptions): Promise<T[]>;
static saveAll<T extends Object>(list: T[], options?: Object.SaveAllOptions): Promise<T[]>;
static registerSubclass<T extends Object>(className: string, clazz: new (options?: any) => T): void;
initialize(): void;

View File

@@ -56,6 +56,8 @@ function test_object() {
gameScore.addUnique("skills", "kungfu");
game.set("gameScore", gameScore);
var gameCopy = Game.fromJSON(JSON.parse(JSON.stringify(game)), true);
}
function test_query() {