added a definition for knockout-amd-helpers

This commit is contained in:
David Sichau 2014-06-26 17:04:44 +02:00
parent 87fba9fea2
commit 2b55cf57dc
3 changed files with 58 additions and 0 deletions

View File

@ -193,6 +193,7 @@ All definitions files include a header with the author and editors, so at some p
* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat))
* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit))
* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.Amd.Helpers](https://github.com/rniemeyer/knockout-amd-helpers) (by [David Sichau](https://github.com/DavidSichau/))
* [Knockout.DeferredUpdates](https://github.com/mbest/knockout-deferred-updates) (by [Sebastián Galiano](https://github.com/sgaliano))
* [Knockout.ES5](https://github.com/SteveSanderson/knockout-es5) (by [Sebastián Galiano](https://github.com/sgaliano))
* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC))

View File

@ -0,0 +1,23 @@
// Tests for knockout.projections.d.ts
/// <reference path="../knockout/knockout.d.ts" />
/// <reference path="knockout-amd-helpers.d.ts" />
//The baseDir is used in building the path to use in the require statement. If your modules live in the modules directory, then you can specify it globally here.
ko.bindingHandlers.module.baseDir = "blub";
//This allows the ability to globally override the function that the module binding calls after loading an AMD module that does not return a constructor.
ko.bindingHandlers.module.initializer= "initialize";
//The dispose method name can be globally overriden. This function is optionally called when a module is being removed/swapped.
ko.bindingHandlers.module.disposeMethod ="dispose";
//The templateProperty option can be globally set. If defined, when a module is loaded - if it has a property with the key specified here
// (where the value is a string or function), the value of that property will be used as the template for the module. The result is a fully
// self-contained module (i.e. it has its own template, not an external one).
ko.bindingHandlers.module.templateProperty ="test";
ko.amdTemplateEngine.defaultPath = "your/path/to/templates";
ko.amdTemplateEngine.defaultSuffix = ".template.html";
ko.amdTemplateEngine.defaultRequireTextPluginName = "text";

View File

@ -0,0 +1,34 @@
// Type definitions for knockout-amd-helpers
// Project: https://github.com/rniemeyer/knockout-amd-helpers
// Definitions by: David Sichau <https://github.com/DavidSichau>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../knockout/knockout.d.ts" />
interface KnockoutAMDModule {
baseDir: string;
initializer: string;
disposeMethod: string;
templateProperty: string;
}
interface KnockoutAMDTemplate {
defaultPath: string;
defaultSuffix: string;
defaultRequireTextPluginName: string;
}
interface KnockoutBindingHandlers {
module: KnockoutAMDModule;
}
interface KnockoutStatic {
amdTemplateEngine: KnockoutAMDTemplate
}
declare module "knockout-amd-helpers" {
export = ko;
}
declare var ko: KnockoutStatic;