diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index 89928dc5ed..ab3a1e81ae 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -157,6 +157,9 @@ function test_collection() { var book1: Book = new Book({ title: "Title 1", author: "Mike" }); books.add(book1); + // Test adding sort option to add. + books.add(new Book(), { sort: true }); + // Objects can be added to collection by casting to model type. // Compiler will check if object properties are valid for the cast. // This gives better type checking than declaring an `any` overload. diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index a880b27ff8..3278f54804 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -16,6 +16,7 @@ declare namespace Backbone { interface AddOptions extends Silenceable { at?: number; merge?: boolean; + sort?: boolean; } interface CollectionSetOptions extends Silenceable {