From 9084225d447d22acdee8b0102274e92b8f4bbebf Mon Sep 17 00:00:00 2001 From: rsamec Date: Mon, 28 Jul 2014 08:36:08 +0200 Subject: [PATCH 1/3] explicitly define node-form module with export = Validation --- node-form/node-form.d.ts | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/node-form/node-form.d.ts b/node-form/node-form.d.ts index b84236896..8c9bc73a8 100644 --- a/node-form/node-form.d.ts +++ b/node-form/node-form.d.ts @@ -1,14 +1,9 @@ -// Type definitions for node-form v1.0.0 -// Project: https://github.com/rsamec/form -// Definitions by: Roman Samec -// Definitions: https://github.com/borisyankov/DefinitelyTyped - /// /// /// declare module Validation { /** - * It represents a propert y validator for atomic object. + * It represents a property validator for atomic object. */ interface IPropertyValidator { isAcceptable(s: any): boolean; @@ -163,11 +158,18 @@ declare module Validation { TranslateArgs?: IErrorTranslateArgs; } /** + * Custom message functions. + */ + interface IErrorCustomMessage { + (config: any, args: any): string; + } + /** * support for localization of error messages */ interface IErrorTranslateArgs { TranslateId: string; MessageArgs: any; + CustomMessage?: IErrorCustomMessage; } /** * It defines conditional function. @@ -636,7 +638,9 @@ declare module Validation { }; constructor(Name: string, validatorsToAdd?: IPropertyValidator[]); public AddValidator(validator: any): void; - public Errors : IError[]; + public Errors : { + [name: string]: IValidationFailure; + }; public HasErrors : boolean; public ErrorCount : number; public ErrorMessage : string; @@ -669,13 +673,22 @@ declare module Validation { public Name: string; private ValidateFce; public Error: IError; + public ValidationFailures: { + [name: string]: IValidationFailure; + }; constructor(Name: string, ValidateFce: IValidate); public Optional: IOptional; public Validate(context: any): boolean; public HasError : boolean; + public Errors : { + [name: string]: IValidationFailure; + }; public HasErrors : boolean; public ErrorCount : number; public ErrorMessage : string; public TranslateArgs : IErrorTranslateArgs[]; } } +declare module "node-form" { + export = Validation ; +} \ No newline at end of file From 76781c4c859386006983e34c1046c43f143cb901 Mon Sep 17 00:00:00 2001 From: rsamec Date: Mon, 28 Jul 2014 08:47:12 +0200 Subject: [PATCH 2/3] explicitly define node-form module with export = Validation --- node-form/node-form.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/node-form/node-form.d.ts b/node-form/node-form.d.ts index 8c9bc73a8..96fab7001 100644 --- a/node-form/node-form.d.ts +++ b/node-form/node-form.d.ts @@ -2,12 +2,18 @@ /// /// declare module Validation { + /** + * Custom message functions. + */ + interface IErrorCustomMessage { + (config: any, args: any): string; + } /** * It represents a property validator for atomic object. */ interface IPropertyValidator { isAcceptable(s: any): boolean; - customMessage? (config: any, args: any): string; + customMessage?: IErrorCustomMessage; tagName?: string; } /** @@ -21,7 +27,7 @@ declare module Validation { */ interface IAsyncPropertyValidator { isAcceptable(s: any): Q.Promise; - customMessage? (config: any, args: any): string; + customMessage?: IErrorCustomMessage; isAsync: boolean; tagName?: string; } @@ -158,12 +164,6 @@ declare module Validation { TranslateArgs?: IErrorTranslateArgs; } /** - * Custom message functions. - */ - interface IErrorCustomMessage { - (config: any, args: any): string; - } - /** * support for localization of error messages */ interface IErrorTranslateArgs { @@ -690,5 +690,5 @@ declare module Validation { } } declare module "node-form" { - export = Validation ; +export = Validation ; } \ No newline at end of file From c320d0fac2fad31e762ff9931cd292928307a010 Mon Sep 17 00:00:00 2001 From: rsamec Date: Mon, 28 Jul 2014 09:25:35 +0200 Subject: [PATCH 3/3] explicitly define node-form module with export = Validation --- node-form/node-form.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node-form/node-form.d.ts b/node-form/node-form.d.ts index 96fab7001..d75e313cd 100644 --- a/node-form/node-form.d.ts +++ b/node-form/node-form.d.ts @@ -1,3 +1,8 @@ +// Type definitions for node-form v1.0.6 +// Project: https://github.com/rsamec/form +// Definitions by: Roman Samec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /// /// ///