From e4fd38e983451f4829dc4110f93d23e040d7193a Mon Sep 17 00:00:00 2001 From: mnlegend Date: Wed, 15 Nov 2017 10:31:15 -0800 Subject: [PATCH] Update Backbone.sync to use a union Updating file to use union to better follow the typescript Do's and Don'ts under the 'Use Union Types' section found in the link below. https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html This will help prevent issues where a line of code such as 'let proxiedSync = Backbone.sync;' will use the wrong sync function. --- types/backbone/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 607f6413fc..1a186d9924 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -460,8 +460,7 @@ declare namespace Backbone { } // SYNC - function sync(method: string, model: Model, options?: JQueryAjaxSettings): any; - function sync(method: string, collection: Collection, options?: JQueryAjaxSettings): any; + function sync(method: string, model: Model | Collection, options?: JQueryAjaxSettings): any; function ajax(options?: JQueryAjaxSettings): JQueryXHR; var emulateHTTP: boolean; var emulateJSON: boolean;