mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
Merge pull request #2690 from rsamec/master
business-rules-engine - new typings created
This commit is contained in:
+112
@@ -0,0 +1,112 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="business-rules-engine.d.ts" />
|
||||
declare module Validators {
|
||||
class LettersOnlyValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class ZipCodeValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class EmailValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class UrlValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RequiredValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DateValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DateISOValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class NumberValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class DigitValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class SignedDigitValidator implements Validation.IStringValidator {
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MinLengthValidator implements Validation.IStringValidator {
|
||||
public MinLength: number;
|
||||
constructor(MinLength?: number);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MaxLengthValidator implements Validation.IStringValidator {
|
||||
public MaxLength: number;
|
||||
constructor(MaxLength?: number);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RangeLengthValidator implements Validation.IStringValidator {
|
||||
public RangeLength: number[];
|
||||
constructor(RangeLength?: number[]);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public MinLength : number;
|
||||
public MaxLength : number;
|
||||
public tagName: string;
|
||||
}
|
||||
class MinValidator implements Validation.IPropertyValidator {
|
||||
public Min: number;
|
||||
constructor(Min?: number);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class MaxValidator implements Validation.IPropertyValidator {
|
||||
public Max: number;
|
||||
constructor(Max?: number);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class RangeValidator implements Validation.IPropertyValidator {
|
||||
public Range: number[];
|
||||
constructor(Range?: number[]);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public Min : number;
|
||||
public Max : number;
|
||||
public tagName: string;
|
||||
}
|
||||
class StepValidator implements Validation.IPropertyValidator {
|
||||
public Step: string;
|
||||
constructor(Step?: string);
|
||||
public isAcceptable(s: any): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class PatternValidator implements Validation.IStringValidator {
|
||||
public Pattern: string;
|
||||
constructor(Pattern?: string);
|
||||
public isAcceptable(s: string): boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
class ContainsValidator implements Validation.IAsyncPropertyValidator {
|
||||
public Options: Q.Promise<any[]>;
|
||||
constructor(Options: Q.Promise<any[]>);
|
||||
public isAcceptable(s: string): Q.Promise<boolean>;
|
||||
public isAsync: boolean;
|
||||
public tagName: string;
|
||||
}
|
||||
}
|
||||
declare module "node-validators" {export = Validators;}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
declare module Utils {
|
||||
class StringFce {
|
||||
static format(s: string, args: any): string;
|
||||
}
|
||||
class NumberFce {
|
||||
static GetNegDigits(value: string): number;
|
||||
}
|
||||
}
|
||||
declare module "node-utils" {export = Utils;}
|
||||
+241
@@ -0,0 +1,241 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
declare module Validation {
|
||||
interface IErrorCustomMessage {
|
||||
(config: any, args: any): string;
|
||||
}
|
||||
interface IPropertyValidator {
|
||||
isAcceptable(s: any): boolean;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IStringValidator extends IPropertyValidator {
|
||||
isAcceptable(s: string): boolean;
|
||||
}
|
||||
interface IAsyncPropertyValidator {
|
||||
isAcceptable(s: any): Q.Promise<boolean>;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
isAsync: boolean;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
|
||||
isAcceptable(s: string): Q.Promise<boolean>;
|
||||
}
|
||||
enum CompareOperator {
|
||||
LessThan = 0,
|
||||
LessThanEqual = 1,
|
||||
Equal = 2,
|
||||
NotEqual = 3,
|
||||
GreaterThanEqual = 4,
|
||||
GreaterThan = 5,
|
||||
}
|
||||
interface IError {
|
||||
HasError: boolean;
|
||||
ErrorMessage: string;
|
||||
TranslateArgs?: IErrorTranslateArgs;
|
||||
}
|
||||
interface IErrorTranslateArgs {
|
||||
TranslateId: string;
|
||||
MessageArgs: any;
|
||||
CustomMessage?: IErrorCustomMessage;
|
||||
}
|
||||
interface IOptional {
|
||||
(): boolean;
|
||||
}
|
||||
interface IValidationFailure extends IError {
|
||||
IsAsync: boolean;
|
||||
Error: IError;
|
||||
}
|
||||
interface IValidationResult {
|
||||
Name: string;
|
||||
Add(validationResult: IValidationResult): void;
|
||||
Remove(index: number): void;
|
||||
Children: IValidationResult[];
|
||||
HasErrors: boolean;
|
||||
HasErrorsDirty: boolean;
|
||||
ErrorMessage: string;
|
||||
ErrorCount: number;
|
||||
Optional?: IOptional;
|
||||
TranslateArgs?: IErrorTranslateArgs[];
|
||||
}
|
||||
interface IValidate {
|
||||
(args: IError): void;
|
||||
}
|
||||
interface IAsyncValidate {
|
||||
(args: IError): Q.Promise<any>;
|
||||
}
|
||||
interface IValidatorFce {
|
||||
Name: string;
|
||||
ValidationFce?: IValidate;
|
||||
AsyncValidationFce?: IAsyncValidate;
|
||||
}
|
||||
interface IValidator {
|
||||
Validate(context: any): IValidationFailure;
|
||||
ValidateAsync(context: any): Q.Promise<IValidationFailure>;
|
||||
Error: IError;
|
||||
}
|
||||
interface IAbstractValidator<T> {
|
||||
RuleFor(prop: string, validator: IPropertyValidator): any;
|
||||
ValidationFor(prop: string, validatorFce: IValidatorFce): any;
|
||||
Validation(validatorFce: IValidatorFce): any;
|
||||
ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>): any;
|
||||
CreateRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractListRule(name: string): IAbstractValidationRule<any>;
|
||||
ForList: boolean;
|
||||
}
|
||||
interface IAbstractValidationRule<T> {
|
||||
Validate(context: T): IValidationResult;
|
||||
ValidateAsync(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateAll(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateProperty(context: T, propName: string): void;
|
||||
ValidationResult: IValidationResult;
|
||||
Rules: {
|
||||
[name: string]: IPropertyValidationRule<T>;
|
||||
};
|
||||
Validators: {
|
||||
[name: string]: IValidator;
|
||||
};
|
||||
Children: {
|
||||
[name: string]: IAbstractValidationRule<any>;
|
||||
};
|
||||
}
|
||||
interface IPropertyValidationRule<T> {
|
||||
Validators: {
|
||||
[name: string]: any;
|
||||
};
|
||||
Validate(context: IValidationContext<T>): IValidationFailure[];
|
||||
ValidateAsync(context: IValidationContext<T>): Q.Promise<IValidationFailure[]>;
|
||||
}
|
||||
interface IValidationContext<T> {
|
||||
Value: string;
|
||||
Key: string;
|
||||
Data: T;
|
||||
}
|
||||
class Error implements IError {
|
||||
public HasError: boolean;
|
||||
public ErrorMessage: string;
|
||||
constructor();
|
||||
}
|
||||
class ValidationFailure implements IError {
|
||||
public Error: IError;
|
||||
public IsAsync: boolean;
|
||||
constructor(Error: IError, IsAsync: boolean);
|
||||
public HasError : boolean;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs;
|
||||
}
|
||||
class ValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
constructor(Name: string);
|
||||
public IsDirty: boolean;
|
||||
public Children : IValidationResult[];
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public Optional: IOptional;
|
||||
public TranslateArgs: IErrorTranslateArgs[];
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
}
|
||||
class CompositeValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
public Children: IValidationResult[];
|
||||
constructor(Name: string);
|
||||
public Optional: IOptional;
|
||||
public AddFirst(error: IValidationResult): void;
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
public LogErrors(headerMessage?: string): void;
|
||||
public Errors : {
|
||||
[name: string]: IValidationResult;
|
||||
};
|
||||
private FlattenErros;
|
||||
public SetDirty(): void;
|
||||
public SetPristine(): void;
|
||||
private SetDirtyEx(node, dirty);
|
||||
private flattenErrors(node, errorCollection);
|
||||
private traverse(node, indent);
|
||||
}
|
||||
class AbstractValidator<T> implements IAbstractValidator<T> {
|
||||
public Validators: {
|
||||
[name: string]: IPropertyValidator[];
|
||||
};
|
||||
public AbstractValidators: {
|
||||
[name: string]: IAbstractValidator<any>;
|
||||
};
|
||||
public ValidationFunctions: {
|
||||
[name: string]: IValidatorFce[];
|
||||
};
|
||||
public RuleFor(prop: string, validator: IPropertyValidator): void;
|
||||
public ValidationFor(prop: string, fce: IValidatorFce): void;
|
||||
public Validation(fce: IValidatorFce): void;
|
||||
public ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>, forList?: boolean): void;
|
||||
public CreateAbstractRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateAbstractListRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateRule(name: string): IAbstractValidationRule<T>;
|
||||
public ForList: boolean;
|
||||
}
|
||||
class MessageLocalization {
|
||||
static customMsg: string;
|
||||
static defaultMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static ValidationMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static GetValidationMessage(validator: any): string;
|
||||
}
|
||||
}
|
||||
declare module "node-validation" {export = Validation;}
|
||||
@@ -0,0 +1,32 @@
|
||||
/// <reference path="business-rules-engine.d.ts" />
|
||||
/// <reference path="BasicValidators.d.ts" />
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../moment/moment.d.ts" />
|
||||
|
||||
export interface IPerson{
|
||||
Checked:boolean;
|
||||
FirstName:string;
|
||||
LastName:string;
|
||||
Email:string;
|
||||
}
|
||||
|
||||
|
||||
//create custom composite validator
|
||||
var personValidator = new Validation.AbstractValidator<IPerson>();
|
||||
|
||||
//create field validators
|
||||
var required = new Validators.RequiredValidator();
|
||||
var email = new Validators.EmailValidator();
|
||||
var maxLength = new Validators.MaxLengthValidator();
|
||||
maxLength.MaxLength = 15;
|
||||
|
||||
|
||||
personValidator.RuleFor("FirstName", required);
|
||||
personValidator.RuleFor("FirstName", maxLength);
|
||||
|
||||
personValidator.RuleFor("LastName", required);
|
||||
personValidator.RuleFor("LastName", maxLength);
|
||||
|
||||
personValidator.RuleFor("Email", required);
|
||||
personValidator.RuleFor("Email", email);
|
||||
+242
@@ -0,0 +1,242 @@
|
||||
// Type definitions for business-rules-engine - v1.0.20
|
||||
// Project: https://github.com/rsamec/form
|
||||
// Definitions by: Roman Samec <https://github.com/rsamec>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Source: typings/business-rules-engine/Validation.d.ts
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../underscore/underscore.d.ts" />
|
||||
declare module Validation {
|
||||
interface IErrorCustomMessage {
|
||||
(config: any, args: any): string;
|
||||
}
|
||||
interface IPropertyValidator {
|
||||
isAcceptable(s: any): boolean;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IStringValidator extends IPropertyValidator {
|
||||
isAcceptable(s: string): boolean;
|
||||
}
|
||||
interface IAsyncPropertyValidator {
|
||||
isAcceptable(s: any): Q.Promise<boolean>;
|
||||
customMessage?: IErrorCustomMessage;
|
||||
isAsync: boolean;
|
||||
tagName?: string;
|
||||
}
|
||||
interface IAsyncStringPropertyValidator extends IAsyncPropertyValidator {
|
||||
isAcceptable(s: string): Q.Promise<boolean>;
|
||||
}
|
||||
enum CompareOperator {
|
||||
LessThan = 0,
|
||||
LessThanEqual = 1,
|
||||
Equal = 2,
|
||||
NotEqual = 3,
|
||||
GreaterThanEqual = 4,
|
||||
GreaterThan = 5,
|
||||
}
|
||||
interface IError {
|
||||
HasError: boolean;
|
||||
ErrorMessage: string;
|
||||
TranslateArgs?: IErrorTranslateArgs;
|
||||
}
|
||||
interface IErrorTranslateArgs {
|
||||
TranslateId: string;
|
||||
MessageArgs: any;
|
||||
CustomMessage?: IErrorCustomMessage;
|
||||
}
|
||||
interface IOptional {
|
||||
(): boolean;
|
||||
}
|
||||
interface IValidationFailure extends IError {
|
||||
IsAsync: boolean;
|
||||
Error: IError;
|
||||
}
|
||||
interface IValidationResult {
|
||||
Name: string;
|
||||
Add(validationResult: IValidationResult): void;
|
||||
Remove(index: number): void;
|
||||
Children: IValidationResult[];
|
||||
HasErrors: boolean;
|
||||
HasErrorsDirty: boolean;
|
||||
ErrorMessage: string;
|
||||
ErrorCount: number;
|
||||
Optional?: IOptional;
|
||||
TranslateArgs?: IErrorTranslateArgs[];
|
||||
}
|
||||
interface IValidate {
|
||||
(args: IError): void;
|
||||
}
|
||||
interface IAsyncValidate {
|
||||
(args: IError): Q.Promise<any>;
|
||||
}
|
||||
interface IValidatorFce {
|
||||
Name: string;
|
||||
ValidationFce?: IValidate;
|
||||
AsyncValidationFce?: IAsyncValidate;
|
||||
}
|
||||
interface IValidator {
|
||||
Validate(context: any): IValidationFailure;
|
||||
ValidateAsync(context: any): Q.Promise<IValidationFailure>;
|
||||
Error: IError;
|
||||
}
|
||||
interface IAbstractValidator<T> {
|
||||
RuleFor(prop: string, validator: IPropertyValidator): any;
|
||||
ValidationFor(prop: string, validatorFce: IValidatorFce): any;
|
||||
Validation(validatorFce: IValidatorFce): any;
|
||||
ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>): any;
|
||||
CreateRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractRule(name: string): IAbstractValidationRule<any>;
|
||||
CreateAbstractListRule(name: string): IAbstractValidationRule<any>;
|
||||
ForList: boolean;
|
||||
}
|
||||
interface IAbstractValidationRule<T> {
|
||||
Validate(context: T): IValidationResult;
|
||||
ValidateAsync(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateAll(context: T): Q.Promise<IValidationResult>;
|
||||
ValidateProperty(context: T, propName: string): void;
|
||||
ValidationResult: IValidationResult;
|
||||
Rules: {
|
||||
[name: string]: IPropertyValidationRule<T>;
|
||||
};
|
||||
Validators: {
|
||||
[name: string]: IValidator;
|
||||
};
|
||||
Children: {
|
||||
[name: string]: IAbstractValidationRule<any>;
|
||||
};
|
||||
}
|
||||
interface IPropertyValidationRule<T> {
|
||||
Validators: {
|
||||
[name: string]: any;
|
||||
};
|
||||
Validate(context: IValidationContext<T>): IValidationFailure[];
|
||||
ValidateAsync(context: IValidationContext<T>): Q.Promise<IValidationFailure[]>;
|
||||
}
|
||||
interface IValidationContext<T> {
|
||||
Value: string;
|
||||
Key: string;
|
||||
Data: T;
|
||||
}
|
||||
class Error implements IError {
|
||||
public HasError: boolean;
|
||||
public ErrorMessage: string;
|
||||
constructor();
|
||||
}
|
||||
class ValidationFailure implements IError {
|
||||
public Error: IError;
|
||||
public IsAsync: boolean;
|
||||
constructor(Error: IError, IsAsync: boolean);
|
||||
public HasError : boolean;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs;
|
||||
}
|
||||
class ValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
constructor(Name: string);
|
||||
public IsDirty: boolean;
|
||||
public Children : IValidationResult[];
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public Optional: IOptional;
|
||||
public TranslateArgs: IErrorTranslateArgs[];
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
}
|
||||
class CompositeValidationResult implements IValidationResult {
|
||||
public Name: string;
|
||||
public Children: IValidationResult[];
|
||||
constructor(Name: string);
|
||||
public Optional: IOptional;
|
||||
public AddFirst(error: IValidationResult): void;
|
||||
public Add(error: IValidationResult): void;
|
||||
public Remove(index: number): void;
|
||||
public HasErrorsDirty : boolean;
|
||||
public HasErrors : boolean;
|
||||
public ErrorCount : number;
|
||||
public ErrorMessage : string;
|
||||
public TranslateArgs : IErrorTranslateArgs[];
|
||||
public LogErrors(headerMessage?: string): void;
|
||||
public Errors : {
|
||||
[name: string]: IValidationResult;
|
||||
};
|
||||
private FlattenErros;
|
||||
public SetDirty(): void;
|
||||
public SetPristine(): void;
|
||||
private SetDirtyEx(node, dirty);
|
||||
private flattenErrors(node, errorCollection);
|
||||
private traverse(node, indent);
|
||||
}
|
||||
class AbstractValidator<T> implements IAbstractValidator<T> {
|
||||
public Validators: {
|
||||
[name: string]: IPropertyValidator[];
|
||||
};
|
||||
public AbstractValidators: {
|
||||
[name: string]: IAbstractValidator<any>;
|
||||
};
|
||||
public ValidationFunctions: {
|
||||
[name: string]: IValidatorFce[];
|
||||
};
|
||||
public RuleFor(prop: string, validator: IPropertyValidator): void;
|
||||
public ValidationFor(prop: string, fce: IValidatorFce): void;
|
||||
public Validation(fce: IValidatorFce): void;
|
||||
public ValidatorFor<K>(prop: string, validator: IAbstractValidator<K>, forList?: boolean): void;
|
||||
public CreateAbstractRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateAbstractListRule(name: string): IAbstractValidationRule<T>;
|
||||
public CreateRule(name: string): IAbstractValidationRule<T>;
|
||||
public ForList: boolean;
|
||||
}
|
||||
class MessageLocalization {
|
||||
static customMsg: string;
|
||||
static defaultMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static ValidationMessages: {
|
||||
"required": string;
|
||||
"remote": string;
|
||||
"email": string;
|
||||
"url": string;
|
||||
"date": string;
|
||||
"dateISO": string;
|
||||
"number": string;
|
||||
"digits": string;
|
||||
"signedDigits": string;
|
||||
"creditcard": string;
|
||||
"equalTo": string;
|
||||
"maxlength": string;
|
||||
"minlength": string;
|
||||
"rangelength": string;
|
||||
"range": string;
|
||||
"max": string;
|
||||
"min": string;
|
||||
"step": string;
|
||||
"contains": string;
|
||||
"mask": string;
|
||||
"custom": string;
|
||||
};
|
||||
static GetValidationMessage(validator: any): string;
|
||||
}
|
||||
}
|
||||
declare module "business-rule-engine" {export = Validation;}
|
||||
Reference in New Issue
Block a user