mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
added a definition for knockout-amd-helpers
This commit is contained in:
parent
87fba9fea2
commit
2b55cf57dc
@ -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))
|
||||
|
||||
23
knockout.amd.helpers/knockout-amd-helpers-tests.ts
Normal file
23
knockout.amd.helpers/knockout-amd-helpers-tests.ts
Normal 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";
|
||||
34
knockout.amd.helpers/knockout-amd-helpers.d.ts
vendored
Normal file
34
knockout.amd.helpers/knockout-amd-helpers.d.ts
vendored
Normal 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;
|
||||
Loading…
Reference in New Issue
Block a user