From f614c7b3d4946dc60ec44af39bee91c52d8c2eb6 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Fri, 5 Aug 2016 23:44:52 +0200 Subject: [PATCH] Changed changedAttributes method to return any, instead of any | boolean. And added some JSDoc to describe its behaviour. --- backbone/backbone-global.d.ts | 9 ++++++++- backbone/backbone.d.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backbone/backbone-global.d.ts b/backbone/backbone-global.d.ts index 3d27e35b5c..3dca269eb0 100644 --- a/backbone/backbone-global.d.ts +++ b/backbone/backbone-global.d.ts @@ -153,7 +153,14 @@ declare namespace Backbone { /*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model; set(obj: any, options?: ModelSetOptions): Model; - changedAttributes(attributes?: any): any | boolean; + /** + * Return an object containing all the attributes that have changed, or + * false if there are no changed attributes. Useful for determining what + * parts of a view need to be updated and/or what attributes need to be + * persisted to the server. Unset attributes will be set to undefined. + * You can also pass an attributes object to diff against the model, + * determining if there *would be* a change. */ + changedAttributes(attributes?: any): any; clear(options?: Silenceable): any; clone(): Model; destroy(options?: ModelDestroyOptions): any; diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 65e273a61f..d3887b4176 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Backbone 1.0.0 +// Type definitions for Backbone 1.3.3 // Project: http://backbonejs.org/ // Definitions by: Boris Yankov , Natan Vivo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped