Commit Graph

50 Commits

Author SHA1 Message Date
Natan Vivo
67c0a6fc37 Makes some parameters optional, as they are not required by backbone. 2013-12-12 12:13:10 -02:00
Natan Vivo
44161fb6f7 Added missing overloads, backbone collections convert raw objects into models on add/reset. 2013-12-10 11:19:06 -02:00
Masahiro Wakame
dbc68718e1 Remove not required .tscparams 2013-11-29 15:25:31 +09:00
Derek Cicerone
422822586b Fix noImplicitAny 2013-11-28 13:19:53 -05:00
Derek Cicerone
473659fb66 More implicit anys 2013-11-27 17:12:00 -05:00
Natan Vivo
2e52be773f Fix space/tab issue. 2013-11-24 17:33:14 -02:00
Natan Vivo
00bf83cd8e Fix noConflict() definition to return typeof(Backbone), added declaration of Backbone.$; 2013-11-24 17:30:32 -02:00
basarat
c23d407d62 Fix backbonejs version 2013-11-15 08:14:01 +11:00
gscshoyru
aa043e12ae Change model to any to try and pass tests 2013-11-12 17:16:56 -08:00
gscshoyru
f40bad2378 Add explicit types so that it passes the noImplicitAny rule
Also updated version number. Added appropriate types to all the functions where I could find them, otherwise typed them with any. This now will compile for typescript compilers that have the noImplictAny flag set.
2013-11-12 13:39:45 -08:00
Derek Cicerone
bacdd2e984 Fix future bugs in backbone.d.ts
Callbacks need to use Function if the arguments to it aren't known ahead of time - see discussion here: https://typescript.codeplex.com/discussions/462819
2013-10-24 14:40:40 -04:00
vvakame
2708bc05cd Fixed tsc failed on Node.js v0.8.25 2013-10-03 11:23:38 +09:00
vvakame
3fe1f6bc4e Fixed to CI test passing 2013-10-03 10:18:58 +09:00
areel
11e08e1d4e If eventName is an instance of an event map e.g '{change:action}' then callback is not required. So callback should be marked as optional. Related to earlier commit (cb1b628527) 2013-09-05 18:38:15 +01:00
areel
cb1b628527 eventName should be an object to support multiple event names: see code below taken from Backbone code base
// Bind an event to a `callback` function. Passing `"all"` will bind
    // the callback to all events fired.
    on: function(name, callback, context) {
      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;

========
  // Implement fancy features of the Events API such as multiple event
  // names `"change blur"` and jQuery-style event maps `{change: action}`
  // in terms of the existing API.
  var eventsApi = function(obj, action, name, rest) {
    if (!name) return true;

    // Handle event maps.
    if (typeof name === 'object') {
      for (var key in name) {
        obj[action].apply(obj, [key, name[key]].concat(rest));
      }
      return false;
    }

Signed-off-by: areel <aidanreel@gmail.com>
2013-08-30 21:29:47 +01:00
Jared Pochtar
de92542c55 Router.routes, View.events, and Model.defaults -> method form
As of typescript 0.9.1, fields are set after calling the super
constructor, so if events, defaults, or routes are set to object
literals, they will not be seen by backbone, and will not be bound.
The cleanest way to fix this is to define them as methods which return
an object hash, as the methods are already on the prototype chain when
backbone looks for events/defaults/routes, and backbone supports either
objects or functions that when called return objects.
2013-08-19 19:56:50 -04:00
ashwinr
5b6f9e9f78 fix overriding comparator for Backbone
having the "sort" version of the comparator return a number, while technically correct according to the Backbone documentation, does not actually work when the "sortBy" version of the comparator is used.
2013-08-14 14:11:42 -04:00
Boris Yankov
38888208fb Fix backbone error 2013-08-07 17:24:19 +03:00
Natan Vivo
752cb09e2c Model.default should be a property, as it can be a function or an object. 2013-07-12 15:30:21 -03:00
Derek Cicerone
9941765485 Replace bool with boolean (for TypeScript 0.9.0+) 2013-07-01 17:38:49 -04:00
rosedomini
1da3d8cf71 add View#setElement for JQuery element parameter
setElement(element: HTMLElement, delegate?: boolean);
        setElement(element: JQuery, delegate?: boolean);
2013-06-28 17:44:54 +02:00
Natan Vivo
bcb5914a86 Add missing property View.cid. 2013-06-22 12:43:53 -03:00
Natan Vivo
3c72be6a93 Add missing property View.cid. 2013-06-22 12:39:21 -03:00
Natan Vivo
2167e6f5b0 Fix test, remove duplicated declaration for _ and $. 2013-06-22 11:43:21 -03:00
Natan Vivo
38e50c8b10 Add internal method to View. 2013-06-22 11:25:42 -03:00
Natan Vivo
d6c2d01c5c Add internal methods and mixins to Model and Collection. 2013-06-22 11:25:42 -03:00
Natan Vivo
08259b232b Improvements to definition.
* Model.urlRoot should be any, as it may be a string or a function.
* Added internal methods to Router.
* Improved definition of History:
  - Extends Events
  - Remove pushState method, it doesn't exist in the source
  - Added internal methods to definition.
2013-06-22 11:25:41 -03:00
Natan Vivo
364bdc1176 Remove unused code. 2013-06-22 11:25:41 -03:00
Natan Vivo
875a928373 Remove template property from View, its not part of the class. 2013-06-22 11:25:41 -03:00
Natan Vivo
8c3bfa5ee5 Backbone.js -> Fix compilation errors for 0.9. 2013-06-22 09:34:20 -03:00
Natan Vivo
5259a60b02 Colleciton model must be any, as the class itself must be passed, not an instance.
Template parameter is optional.
2013-05-29 22:33:17 -03:00
Zeeshan Hamid
23d7e0b31e Update backbone and marionette 2013-05-10 16:56:59 -04:00
Zeeshan Hamid
44212a3791 Adding className and id to backbone view 2013-05-07 19:23:17 -04:00
Kazi Manzur Rashid
2e898e0c38 stopListening can be invoked without any argument. 2013-05-03 17:12:36 +06:00
Kazi Manzur Rashid
d2e0be3ea9 Model isValid should return boolean instead of string 2013-04-30 13:54:50 +06:00
Kazi Manzur Rashid
0fea2d1a86 Added the test for the previous changes. 2013-04-20 09:59:51 +06:00
Kazi Manzur Rashid
2a9a991418 Updated the signatures and included some of the recent changes of Backbone.js v1.0.0 2013-04-19 05:20:09 +06:00
parliament718
76339b1240 Update backbone.d.ts
Added Backbone.History.started 

https://github.com/documentcloud/backbone/pull/538#issuecomment-15996793
2013-04-09 16:31:42 -03:00
Guus Goossens
f8cbbfaae7 Optional parameters for Backbone. 2013-02-25 13:49:41 +01:00
Diullei Gomes
887f6de365 Merge pull request #326 from Diullei/master
fix tests to: jquery.bbq, jquery and backbone.
2013-02-23 22:13:34 -08:00
Diullei Gomes
6acad39924 fix backbone test 2013-02-24 02:59:27 -03:00
Omid K. Rad
b403d81779 Added options parameter to Backbone.Model.set() 2013-02-22 10:16:44 -08:00
Omid K. Rad
7d1f71d700 Added two function definitions for Backbone.History 2013-02-21 15:56:14 -08:00
ProVega
761af95d45 Update backbone/backbone.d.ts
Removing getByCid which was removed 0.9.9
2013-01-31 23:31:53 -08:00
Boris Yankov
209d95071a Update reference paths 2013-01-17 20:03:30 +02:00
Boris Yankov
c98eebb137 Rename all definition files, remove versions 2013-01-17 17:17:27 +02:00
Natan Vivo
c7d2934d6d Update project references to use jQuery 1.9 instead of missing 1.8 file. 2013-01-17 12:05:06 -02:00
Stuart Thompson
040418a364 Backbone.Router now extends Events
The Backbone.Router class did not previously extend Events in the
definition file. This caused the TypeScript compiler to raise an
error when calling one of the Events methods (such as on()) on an
instance of a router.

This change allows instances of classes derived from Backbone.Router
to call methods on the Events class that are inherited by the router.
2012-12-07 15:39:11 -08:00
Boris Yankov
7c82efb17a Update reference paths 2012-11-19 01:28:08 +02:00
Boris Yankov
c91c45f9ae Move definitions and test in separate folders
This enables each definition to have a readme if necessary.
Also a .json metadata file to help with package managers.
And last, to have different versions of the definitions.
2012-11-18 22:28:44 +02:00