- Added constructor with options to Marionette.RegionManager.
- Added overloads to addRegions with more specific types.
- Specified type of parameter for RegionManager.removeRegion.
- Added JSdoc to Marionette.Controller
- Added getOption method to Marionette.Controller.
- Introduced interfaces for configuration options for Region construction and the Region.show() method.
- Added missing options parameter to Region.show() and Region.attachView()
- Removed method Region.ensureEl() since this does not seem to exist on the Marionette.Region class.
- Removed method Region.open() since this does not seem to exist on the Marionette.Region class.
- Added return-type specifications to methods, instead of relying on implicit any. (Most methods just return 'this').
- Merged a previous commit that removed superfluous generics from several classes that didn't need them.
The Application, Region, Module and RegionManager classes were all declared as generic with a Model as a type-argument. However, none of these classes store items of a single model and do not need to be generic. The views are really the only classes that needs generics, so moved the generic to the methods accepting views as arguments instead.
Marionette.d.ts includes definitions for Backbone.Wreqr, but does not support the recommended way of using the Wreqr object as seen here: https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.application.md#accessing-the-global-channel
I've added the Channel object, and a definition to the Radio class as well. This is only a means of getting a specific channel through the channel() method, so while it is possible to create an instance of Radio, I've chosen only to include channel() method, and make it static.
This makes it possible to access the instance of a channel with the name 'global' like this (created if not found), as recommended in the above documentation:
var channel = Backbone.Wreqr.radio.channel('global');
// channel.vent;
Finally, I've made the parameter context of the setHandler method in the Backbone.Wreqr.Handlers class optional, as this adheres to the actual implementation.