borisyankov/DefinitelyTyped — pull request #2541 by Wordenskjold (2014-07-21 13:42:01+00:00)
Title: Add channel support to backbone.wreqr in marionette.d.ts

Marionette.d.ts includes definitions for Backbone.Wreqr, but does not support the recommended way of using the Wreqr channels as officially documented: 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 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.