Merge pull request #3045 from pine613/feature/knockout-secure-binding

Add knockout-secure-binding.d.ts
This commit is contained in:
Masahiro Wakame
2014-10-30 13:14:12 +09:00
3 changed files with 56 additions and 1 deletions
+2 -1
View File
@@ -246,7 +246,8 @@ All definitions files include a header with the author and editors, so at some p
* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC))
* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov))
* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel))
* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek))
* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek))
* [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613))
* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig))
* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising))
* [Knockstrap](http://faulknercs.github.io/Knockstrap/) (by [Adam Pluciński](https://github.com/adaskothebeast))
@@ -0,0 +1,23 @@
/// <reference path="knockout-secure-binding.d.ts" />
// knockout-secure-binding
// The MIT License(MIT)
// Copyright(c) 2013 Brian M Hunt
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import ksp = require('knockout-secure-binding');
function testt(): void {
// https://github.com/brianmhunt/knockout-secure-binding
var options = {
attribute: "data-bind", // default "data-sbind"
globals: window, // default {}
bindings: ko.bindingHandlers, // default ko.bindingHandlers
noVirtualElements: false // default true
};
ko.bindingProvider.instance = new ko.secureBindingsProvider(options);
ko.bindingProvider.instance = new ksp(options);
}
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for knockout-secure-binding
// Project: https://github.com/brianmhunt/knockout-secure-binding
// Definitions by: Pine Mizune <https://github.com/pine613>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../knockout/knockout.d.ts" />
interface KnockoutSecureBindingOptions {
attribute?: string;
globals?: any;
bindings?: KnockoutBindingHandlers;
noVirtualElements?: boolean;
}
interface KnockoutSecureBindingProvider extends KnockoutBindingProvider {
new (options?: KnockoutSecureBindingOptions): KnockoutBindingProvider;
}
interface KnockoutStatic {
secureBindingsProvider: {
new (options?: KnockoutSecureBindingOptions): KnockoutBindingProvider;
};
}
declare module "knockout-secure-binding" {
var klass: {
new (options?: KnockoutSecureBindingOptions): KnockoutBindingProvider;
};
export = klass;
}