From 73604e393ab1d336c3c76a7461dd73e54515e899 Mon Sep 17 00:00:00 2001 From: Peter Palotas Date: Mon, 29 Dec 2014 11:33:25 +0100 Subject: [PATCH] - Added some more missing type annotations. --- marionette/marionette-tests.ts | 6 +++--- marionette/marionette.d.ts | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/marionette/marionette-tests.ts b/marionette/marionette-tests.ts index 109735d218..eec2db8a41 100644 --- a/marionette/marionette-tests.ts +++ b/marionette/marionette-tests.ts @@ -176,7 +176,7 @@ module Marionette.Tests { } }; - this.childViewOptions = function (model, index) { + this.childViewOptions = function (model: any, index: any): any { // do some calculations based on the model return { foo: "bar", @@ -258,7 +258,7 @@ module Marionette.Tests { app.mainRegion.reset(); - Marionette.Region.prototype.attachHtml = function (view) { + Marionette.Region.prototype.attachHtml = function (view: any): void { this.$el.empty().append(view.el); } @@ -268,7 +268,7 @@ module Marionette.Tests { app.mainRegion.attachView(myView); - app.mainRegion.on("empty", function (view, region, options) { + app.mainRegion.on("empty", function (view: any, region: any, options: any) { // manipulate the `view` or do something extra // with the `region` // you also have access to the `options` that were passed to the Region.show call diff --git a/marionette/marionette.d.ts b/marionette/marionette.d.ts index aa1812e4db..397da6fab2 100644 --- a/marionette/marionette.d.ts +++ b/marionette/marionette.d.ts @@ -19,7 +19,7 @@ declare module Backbone { findByCustom(index: number): View; findByIndex(index: number): View; findByCid(cid: string): View; - remove(view: View); + remove(view: View): void; call(method: any): void; apply(method: any, args?: any[]): void; @@ -34,7 +34,7 @@ declare module Backbone { filter(iterator: (element: View, index: number) => boolean, context?: any): View[]; find(iterator: (element: View, index: number) => boolean, context?: any): View; first(): View; - forEach(iterator: (element: View, index: number, list?: any) => void, context?: any); + forEach(iterator: (element: View, index: number, list?: any) => void, context?: any): void; include(value: any): boolean; initial(): View; initial(n: number): View[]; @@ -88,7 +88,7 @@ declare module Backbone { setHandler(name: string, handler: any, context?: any): void; hasHandler(name: string): boolean; getHandler(name: string): Function; - removeHandler(name: string); + removeHandler(name: string): void; removeAllHandlers(): void; } @@ -165,7 +165,7 @@ declare module Marionette { * @param entity The entity (Backbone.Model or Backbone.Collection) to bind the events from. * @param bindings a hash of { "event:name": "eventHandler" } configuration. Multiple handlers can be separated by a space. A function can be supplied instead of a string handler name. */ - function unbindEntityEvents(target: any, entity: any, bindings: any); + function unbindEntityEvents(target: any, entity: any, bindings: any): void; class Callbacks { add(callback: Function, contextOverride: any): void; @@ -740,7 +740,7 @@ declare module Marionette { unbindUIElements(): any; - triggerMethod(name, ...args: any[]): any; + triggerMethod(name: string, ...args: any[]): any; /** * Called on the view instance when the view has been rendered and @@ -1218,7 +1218,7 @@ declare module Marionette { request(...args: any[]): any; /** Deprecated! Initializers, you should use events to manage start-up logic. */ - addInitializer(initializer): void; + addInitializer(initializer: any): void; /** * Once you have your application configured, you can kick everything off @@ -1228,7 +1228,7 @@ declare module Marionette { start(options?: any): void; /** Deprecated! nstead of using the Application as the root of your view tree, you should use a Layout View.*/ - addRegions(regions): any; + addRegions(regions: any): any; /** Deprecated! nstead of using the Application as the root of your view tree, you should use a Layout View.*/ emptyRegions(): void; @@ -1258,10 +1258,10 @@ declare module Marionette { constructor(moduleName: string, app: Application); submodules: any; - triggerMethod(name, ...args: any[]): any; + triggerMethod(name: string, ...args: any[]): any; - addInitializer(callback): void; - addFinalizer(callback): void; + addInitializer(callback: any): void; + addFinalizer(callback: any): void; start(options?: any): void; addDefinition(moduleDefinition: any, customArgs: any): any; }