diff --git a/types/knockout-amd-helpers/index.d.ts b/types/knockout-amd-helpers/index.d.ts index d12c8d9a8f..6f3a5493e1 100644 --- a/types/knockout-amd-helpers/index.d.ts +++ b/types/knockout-amd-helpers/index.d.ts @@ -2,10 +2,10 @@ // Project: https://github.com/rniemeyer/knockout-amd-helpers // Definitions by: David Sichau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// - interface KnockoutAMDModule { baseDir: string; initializer: string; diff --git a/types/knockout-secure-binding/index.d.ts b/types/knockout-secure-binding/index.d.ts index 84a432738b..f7c7500cff 100644 --- a/types/knockout-secure-binding/index.d.ts +++ b/types/knockout-secure-binding/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/brianmhunt/knockout-secure-binding // Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -28,4 +29,4 @@ declare module "knockout-secure-binding" { }; export = klass; -} \ No newline at end of file +} diff --git a/types/knockout-transformations/index.d.ts b/types/knockout-transformations/index.d.ts index 958eb99fb6..5fab318c1b 100644 --- a/types/knockout-transformations/index.d.ts +++ b/types/knockout-transformations/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/One-com/knockout-transformations // Definitions by: John Reilly , Wim Looman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.deferred.updates/index.d.ts b/types/knockout.deferred.updates/index.d.ts index 89fb752089..c02f371277 100644 --- a/types/knockout.deferred.updates/index.d.ts +++ b/types/knockout.deferred.updates/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mbest/knockout-deferred-updates // Definitions by: Sebastián Galiano // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -42,4 +43,4 @@ interface KnockoutUtils { // Deferred extender interface KnockoutExtenders { deferred(target: any, value: boolean): any; -} \ No newline at end of file +} diff --git a/types/knockout.editables/index.d.ts b/types/knockout.editables/index.d.ts index 4a4ed59d3b..5167287e7e 100644 --- a/types/knockout.editables/index.d.ts +++ b/types/knockout.editables/index.d.ts @@ -2,6 +2,7 @@ // Project: http://romanych.github.com/ko.editables/ // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.es5/index.d.ts b/types/knockout.es5/index.d.ts index ce41db0d73..0ae2526c25 100644 --- a/types/knockout.es5/index.d.ts +++ b/types/knockout.es5/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/SteveSanderson/knockout-es5 // Definitions by: Sebastián Galiano // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.mapper/index.d.ts b/types/knockout.mapper/index.d.ts index 747a3d1f4a..d77f3e8f22 100644 --- a/types/knockout.mapper/index.d.ts +++ b/types/knockout.mapper/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/LucasLorentz/knockout.mapper // Definitions by: Brandon Meyer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.mapping/index.d.ts b/types/knockout.mapping/index.d.ts index 23f7aae8b5..e6d5fe2f6c 100644 --- a/types/knockout.mapping/index.d.ts +++ b/types/knockout.mapping/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for Knockout.Mapping 2.0 // Project: https://github.com/SteveSanderson/knockout.mapping -// Definitions by: Boris Yankov +// Definitions by: Boris Yankov , +// Mathias Lorenzen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// @@ -33,17 +35,25 @@ declare global { update?: (options: KnockoutMappingUpdateOptions) => void; key?: (data: any) => any; } + + type KnockoutObservableType = { + [P in keyof T]: KnockoutObservable; + }; interface KnockoutMapping { isMapped(viewModel: any): boolean; - fromJS(jsObject: any): any; - fromJS(jsObject: any, targetOrOptions: any): any; - fromJS(jsObject: any, inputOptions: any, target: any): any; + fromJS(jsObject: T[]): KnockoutObservableType[]; + fromJS(jsObject: T[], targetOrOptions: any): KnockoutObservableType[]; + fromJS(jsObject: T[], inputOptions: any, target: any): KnockoutObservableType[]; + fromJS(jsObject: T): KnockoutObservableType; + fromJS(jsObject: T, targetOrOptions: any): KnockoutObservableType; + fromJS(jsObject: T, inputOptions: any, target: any): KnockoutObservableType; fromJSON(jsonString: string): any; fromJSON(jsonString: string, targetOrOptions: any): any; fromJSON(jsonString: string, inputOptions: any, target: any): any; - toJS(rootObject: any, options?: KnockoutMappingOptions): any; - toJSON(rootObject: any, options?: KnockoutMappingOptions): any; + toJS(rootObject: KnockoutObservableArray|T, options?: KnockoutMappingOptions): T[]; + toJS(rootObject: KnockoutObservableType|T, options?: KnockoutMappingOptions): T; + toJSON(rootObject: any, options?: KnockoutMappingOptions): string; defaultOptions(): KnockoutMappingOptions; resetDefaultOptions(): void; getType(x: any): any; diff --git a/types/knockout.postbox/index.d.ts b/types/knockout.postbox/index.d.ts index 56afa3a2b6..d7e967bcb9 100644 --- a/types/knockout.postbox/index.d.ts +++ b/types/knockout.postbox/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rniemeyer/knockout-postbox // Definitions by: Judah Gabriel Himango // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.projections/index.d.ts b/types/knockout.projections/index.d.ts index aae8b55f57..bed2ac82ca 100644 --- a/types/knockout.projections/index.d.ts +++ b/types/knockout.projections/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/stevesanderson/knockout-projections // Definitions by: John Reilly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.punches/index.d.ts b/types/knockout.punches/index.d.ts index aec2860bd9..c378d68c37 100644 --- a/types/knockout.punches/index.d.ts +++ b/types/knockout.punches/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/mbest/knockout.punches // Definitions by: Stephen Lautier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.rx/index.d.ts b/types/knockout.rx/index.d.ts index 82a5473f1c..fea2c5175b 100644 --- a/types/knockout.rx/index.d.ts +++ b/types/knockout.rx/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Igorbek/knockout.rx // Definitions by: Igor Oleinikov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// diff --git a/types/knockout.validation/index.d.ts b/types/knockout.validation/index.d.ts index 8b0300bd7f..e302ee6279 100644 --- a/types/knockout.validation/index.d.ts +++ b/types/knockout.validation/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ericmbarnard/Knockout-Validation // Definitions by: Dan Ludwig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout.viewmodel/index.d.ts b/types/knockout.viewmodel/index.d.ts index 5e57afb449..2ea6815531 100644 --- a/types/knockout.viewmodel/index.d.ts +++ b/types/knockout.viewmodel/index.d.ts @@ -2,6 +2,7 @@ // Project: http://coderenaissance.github.com/knockout.viewmodel/ // Definitions by: Oisin Grehan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 4ef3bc8739..8d035ed8d2 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -1,12 +1,13 @@ // Type definitions for Knockout v3.4.0 // Project: http://knockoutjs.com -// Definitions by: Boris Yankov -// Igor Oleinikov -// Clément Bourgeois -// Matt Brooks -// Benjamin Eckardt +// Definitions by: Boris Yankov , +// Igor Oleinikov , +// Clément Bourgeois , +// Matt Brooks , +// Benjamin Eckardt , +// Mathias Lorenzen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 interface KnockoutExtensionFunctions { [key: string]: any; diff --git a/types/knockout/test/index.ts b/types/knockout/test/index.ts index e3f7820f94..9913b64fa8 100644 --- a/types/knockout/test/index.ts +++ b/types/knockout/test/index.ts @@ -484,8 +484,8 @@ function test_mappingplugin() { ko.mapping.fromJS(data, {}, this); var alice, aliceMappingOptions, bob, bobMappingOptions; - var viewModel = ko.mapping.fromJS(alice, aliceMappingOptions); - ko.mapping.fromJS(bob, bobMappingOptions, viewModel); + var aliceViewModel = ko.mapping.fromJS(alice, aliceMappingOptions); + ko.mapping.fromJS(bob, bobMappingOptions, aliceViewModel); var obj; var result = ko.mapping.fromJS(obj, { diff --git a/types/kolite/knockout.activity.d.ts b/types/kolite/knockout.activity.d.ts index 8a1f1a0fac..8022e18cff 100644 --- a/types/kolite/knockout.activity.d.ts +++ b/types/kolite/knockout.activity.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/CodeSeven/kolite // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 /// /// diff --git a/types/kolite/knockout.command.d.ts b/types/kolite/knockout.command.d.ts index ff509dbd16..786bbcfaae 100644 --- a/types/kolite/knockout.command.d.ts +++ b/types/kolite/knockout.command.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/CodeSeven/kolite // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 /// /// diff --git a/types/kolite/knockout.dirtyFlag.d.ts b/types/kolite/knockout.dirtyFlag.d.ts index 1c63ce8b7d..2f63a110e0 100644 --- a/types/kolite/knockout.dirtyFlag.d.ts +++ b/types/kolite/knockout.dirtyFlag.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/CodeSeven/kolite // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.3 /// /// diff --git a/types/underscore-ko/index.d.ts b/types/underscore-ko/index.d.ts index 8b04a28f39..25413677ef 100644 --- a/types/underscore-ko/index.d.ts +++ b/types/underscore-ko/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/kamranayub/UnderscoreKO // Definitions by: Maurits Elbers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/valerie/index.d.ts b/types/valerie/index.d.ts index cab8ee7467..733014b37e 100644 --- a/types/valerie/index.d.ts +++ b/types/valerie/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/davewatts/valerie // Definitions by: Howard Richards // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 ///