/** * @name sogv * @namespace * @description Root namespace for the SOG Validator Library */ declare namespace sogv { /** * @abstract * @constructor * @name sogv.BaseComparisonValidator * @extends sogv.BaseValidator * @classdesc *

Abstract base class that implements functionality for validation.

*

Provides a base class for the validation of property comparisons.

* @description Create a new Validator. * @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options * @param {String} lang The language used by the application. Defaults to 'en'. * @param {Boolean} internal If this parameter is true, it means, that validation called from core. */ class BaseComparisonValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; } /** * @abstract * @constructor * @name sogv.BaseValidator * @classdesc Abstract base class that implements functionality for validation. * @description Create a new validation extension. * @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options * @param {String} lang Language of error messages. * @param {Boolean} lang Language of error messages. * @constructor */ class BaseValidator { constructor(data: any, options: any, optionRules: any, lang: boolean, lang: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; } /** * @function * @name sogv.globalScope * @description *

Return variable by name from the global scope.

* @param {String} name Variable name. * @returns {Window | *} */ function globalScope(name: string): Window | any; /** * @function * @name sogv.registerValidator * @description *

Register validator.

* @param {Function} validator The validator. */ function registerValidator(validator: (...params: any[]) => any): void; /** * @function * @name sogv.getType * @description *

Get data type.

* @param {*} data Data, which type needs to be defined. * @returns {String} Data type */ function getType(data: any): string; /** * @function * @name sogv.isType * @description *

Parse validation rules from string.

* @param {String} type Type string. * @param {*} data Data, which type needs to be checked. * @returns {Boolean} Is correct data type. */ function isType(type: string, data: any): boolean; /** * @function * @name sogv.makeValidator * @description *

Create object of the validator.

* @param {*} data The data which needs to be validated. * @param {String} validator Validator name. * @param {Object} options The setting options. * @param {Object} optionRules The validation rules for setting options. * @param {Object} lang The language used by the application. Defaults to 'en'. * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @returns {Object} The object of validator. */ function makeValidator(data: any, validator: string, options: any, optionRules: any, lang: any, internal: boolean): any; /** * @function * @name sogv.isValid * @description *

Check if data valid according to validation rules.

* @param {*} data The data which needs to be validated. * @param {String} rules Validation rules in string format. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal It means, that validation called from core. * @returns {Boolean} Validation status. */ function isValid(data: any, rules: string, lang: string, internal: boolean): boolean; /** * @function * @deprecated * @name sogv.isValidWithErrorMessage * @description *

Use sogv.isValidMessage instead.

*

Check if data valid according to validation rules.

*

Check only single data.

* @param {*} data The data which needs to be validated. * @param {String} rules Validation rules in string format. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal It means, that validation called from core. * @returns {Null|String} If valid this function return null otherwise error message. */ function isValidWithErrorMessage(data: any, rules: string, lang: string, internal: boolean): null | string; /** * @function * @name sogv.isValidMessage * @description *

Check if data valid according to validation rules.

*

Check only single data.

* @param {*} data The data which needs to be validated. * @param {String} rules Validation rules in string format. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal It means, that validation called from core. * @returns {Null|String} If valid this function return null otherwise error message. */ function isValidMessage(data: any, rules: string, lang: string, internal: boolean): null | string; /** * @function * @name sogv.isValidException * @description *

Check if data valid according to validation rules. If not then throw error exception.

*

Check only single data.

* @param {*} data The data which needs to be validated. * @param {String} rules Validation rules in string format. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal It means, that validation called from core. * @throws The validation error message. */ function isValidException(data: any, rules: string, lang: string, internal: boolean): void; /** * @function * @name sogv.isValidFormMessage * @description *

Check if data valid according to validation rules

*

Check only multi data.

* @param {Object} data The data which needs to be validated. * @param {Object} rules Validation rules in string format. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal It means, that validation called from core. * @returns {Null|Object} If valid this function return null otherwise the list of error messages. */ function isValidFormMessage(data: any, rules: any, lang: string, internal: boolean): null | any; /** * @function * @name sogv.isValidFormException * @description *

Check if data valid according to validation rules. If not then throw error exception.

*

Check only multi data.

* @param {Object} data The data which needs to be validated. * @param {Object} rules Validation rules in string format. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal It means, that validation called from core. * @throws The validation error message. */ function isValidFormException(data: any, rules: any, lang: string, internal: boolean): void; /** * @function * @name sogv.convertToType * @description Convert data to one of the type. * @param {*} data The data which needs to be converted * @param {String} strTypes Data types. (Example: 'integer|date-string') * @returns {*} The converted data */ function convertToType(data: any, strTypes: string): any; /** * @constructor * @name sogv.Application * @classdesc A sogv.Application represents and manages your Validation application. * @description Create a new Application. * @param {Object} options The setting options * @example * var validationEngine = new sogv.Application({ * lang: 'en' * }); * * var form = validationEngine.make({ * first_name: 'Leo', * last_lame: 'Lane', * email: 'leo.lane38@example.com', * birthday: '1977-03-07', * creditCard: '4111111111111111', * ip: '8.8.8.8', * locale: 'cy_GB', * country: 'US', * language: 'en_gb', * homepage: 'https://github.com//slaveofgod/sog-validator' * }, { * first_name: 'required|string|length:{"min":2,"max":255}', * last_lame: 'required|string|length:{"min":2,"max":255}', * email: 'required|email', * birthday: 'required|date', * creditCard: 'required|string|card-scheme:{"schemes":["VISA"]}', * ip: 'required|string|ip', * locale: 'required|string|locale', * country: 'required|string|country', * language: 'required|string|language', * homepage: 'required|string|url' * }); * * if (false === form.isValid()) { * if (false === form.get('name').isValid()) { * form.get('name').errors().first(); * } * // ... * } */ class Application { constructor(options: any); /** * @name sogv.Application#lang * @type {String} * @description *

The language used by the application.

*

Defaults to 'en' ({@link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes|List of ISO 639-1 codes}).

* @example * // Set the language for the application * this.app.lang = 'en'; */ lang: string; /** * @name sogv.Application#internal * @type {Boolean} * @description If this parameter is true, it means, that validation called from core. */ internal: boolean; /** * @function * @name sogv.Application#make * @description Create validators for all the fields * @param {Object} data The data which needs to be validated * @param {Object} rules The validation rules * @returns {sogv.ValidatorHandler} */ make(data: any, rules: any): sogv.ValidatorHandler; /** * @function * @name sogv.Application#makeSingle * @description Create single validator * @param {*} data The data which needs to be validated * @param {String} rules The validation rules * @example * var validationEngine = new sogv.Application({ * lang: 'en' * }); * * validator = validationEngine.makeSingle( * 'leo.lane38@example.com', * 'required|email' * ); * * if (false === validator.isValid()) { * validator.errors().first(); * } * @returns {Object} Validator object */ makeSingle(data: any, rules: string): any; } /** * @constructor * @name sogv.AnyValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is valid at least for one of the rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['any', 'one-of'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AnyValidator(data, contains); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AnyValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.AnyValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not valid.

*

Default: "This value should be valid at least for one rule."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.AnyValidator#rules * @type {String} * @description *

This option is required.

*

It defines the value to check the containing.

*/ rules: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['any', 'one-of'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ContainsValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value contains given substring.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['contains'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.ContainsValidator(data, contains); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class ContainsValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.ContainsValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not contains given substring.

*

Default: "This value should contains the given substring."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.ContainsValidator#value * @type {String} * @description *

This option is required.

*

It defines the value to check the containing.

*/ value: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['contains'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AcceptedValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be yes, on, 1, or true.

*

This is useful for validating "Terms of Service" acceptance.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['accepted'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AcceptedValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AcceptedValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['accepted'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ActiveUrlValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must have a valid A or AAAA record

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['active_url','active-url'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.ActiveUrlValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class ActiveUrlValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['active_url','active-url'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AfterOrEqualValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be a value after or equal to the given date.

*

For more information, see the after rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['after_or_equal', 'after-or-equal', 'aoe'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AfterOrEqualValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AfterOrEqualValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.AfterOrEqualValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['after_or_equal', 'after-or-equal', 'aoe'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AfterValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be a value after a given date.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['after'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AfterValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AfterValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.AfterValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['after'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AlphaDashValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation may have alpha-numeric characters, as well as dashes and underscores.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['alpha_dash', 'alpha-dash'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AlphaDashValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AlphaDashValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['alpha_dash', 'alpha-dash'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AlphaNumValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be entirely alpha-numeric characters.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['alpha_num', 'alpha-num', 'alnum'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AlphaNumValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AlphaNumValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['alpha_num', 'alpha-num', 'alnum'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AlphaValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be entirely alphabetic characters.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['alpha'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.AlphaValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AlphaValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['alpha'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ArrayValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be an array.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['array', 'arr'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.ArrayValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class ArrayValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['array', 'arr'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.BeforeOrEqualValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be a value before or equal to the given date.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['before_or_equal', 'before-or-equal', 'boe'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.BeforeOrEqualValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class BeforeOrEqualValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BeforeOrEqualValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['before_or_equal', 'before-or-equal', 'boe'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.BeforeValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be a value before a given date.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['before'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.BeforeValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class BeforeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BeforeValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['before'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.BetweenValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must have a size between the given min and max.

*

Strings, numerics, arrays and dates are evaluated in the same fashion as the size rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['between'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.BetweenValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class BetweenValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BetweenValidator#max * @type {Integer} * @description *

This option is the "max" count value. Validation will fail if the given collection elements count is greater than this max value.

*

This option is required when the min option is not defined.

*/ max: Integer; /** * @name sogv.BetweenValidator#min * @type {Integer} * @description *

This option is the "min" count value. Validation will fail if the given collection elements count is less than this min value.

*

This option is required when the max option is not defined.

*/ min: Integer; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['between'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.BooleanValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['boolean', 'bool'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.BooleanValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class BooleanValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['boolean', 'bool'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.CallableValidator * @extends sogv.BaseValidator * @classdesc *

Verify that the contents of a variable can be called as a function.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['callable'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.CallableValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class CallableValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['callable'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.CntrlValidator * @extends sogv.BaseValidator * @classdesc *

Check for control character(s).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['cntrl'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.CntrlValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class CntrlValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['cntrl'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DateEqualsValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be equal to the given date.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['date_equals', 'date-equals', 'de'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DateEqualsValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DateEqualsValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['date_equals', 'date-equals', 'de'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DigitValidator * @extends sogv.BaseValidator * @classdesc *

Check for numeric character(s).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['digit'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DigitValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DigitValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['digit'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DigitsBetweenValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be numeric and must have a length between the given min and max.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['digits_between', 'digits-between'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DigitsBetweenValidator(data, {"min": 5, "max": 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DigitsBetweenValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.DigitsBetweenValidator#min * @type {Integer} * @description * This option is required. It defines the min count of digits. */ min: Integer; /** * @name sogv.DigitsBetweenValidator#max * @type {Integer} * @description * This option is required. It defines the max count of digits. */ max: Integer; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['digits_between', 'digits-between'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DigitsValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be numeric and must have an exact length of value.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['digits'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DigitsValidator(data, {"length": 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DigitsValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.DigitsValidator#length * @type {*} * @description This option is required. It defines the exact count of digits. */ length: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['digits'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DistinctValidator * @extends sogv.BaseValidator * @classdesc *

When working with arrays, the field under validation must not have any duplicate values.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['distinct'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DistinctValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DistinctValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['distinct'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DoubleValidator * @extends sogv.BaseValidator * @classdesc *

Finds whether the type of a variable is double.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['double'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DoubleValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DoubleValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['double'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.EndsWithValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must end with one of the given values.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['ends_with', 'ends-with', 'ends'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.EndsWithValidator(data, {ends: ['abc','def']}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class EndsWithValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.EndsWithValidator#ends * @type {String|Array} * @description *

The option is required.

*

The list of ends.

*

One of the "end" needs to be the end of the passed value.

*/ ends: string | any[]; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['ends_with', 'ends-with', 'ends'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.FloatValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be able to be cast as a float.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['float'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.FloatValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class FloatValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['float'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.GraphValidator * @extends sogv.BaseValidator * @classdesc *

Check for any printable character(s) except space.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['graph'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.GraphValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class GraphValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['graph'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.GtValidator * @extends sogv.BaseValidator * @classdesc *

The data must be greater than the given value.

*

Strings, numerics, arrays, and dates are evaluated using the same conventions as the size rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['gt'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.GtValidator(data, {"value": 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class GtValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.GtValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number, array or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['gt'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.GteValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be greater than or equal to the given field.

*

Strings, numerics, arrays, and dates are evaluated using the same conventions as the size rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['gte'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.GteValidator(data, {"value": 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class GteValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.GteValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number, array or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['gte'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.InValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be included in the given list of values.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['in'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.InValidator("Liam", [ * "Liam", "Noah", "William", "James", "Logan", "Benjamin", "Mason", "Elijah", * "Oliver", "Jacob", "Lucas", "Michael", "Alexander", "Ethan", "Daniel", * "Matthew", "Aiden", "Henry", "Joseph", "Jackson", "Samuel", "Sebastian", * "David", "Carter", "Wyatt", "Jayden", "John", "Owen", "Dylan", "Luke" * ]); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class InValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.InValidator#choices * @type {Array} * @description *

A required option - The field under validation must be included in the given list of values.

*

The input value will be matched against this array.

*/ choices: any[]; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['in'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IntegerValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be an integer.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['integer', 'int'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IntegerValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IntegerValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['integer', 'int'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.Ipv4Validator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be an IPv4 address.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['ipv4'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.Ipv4Validator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class Ipv4Validator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['ipv4'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.Ipv6Validator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be an IPv6 address.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['ipv6'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.Ipv6Validator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class Ipv6Validator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['ipv6'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IterableValidator * @extends sogv.BaseValidator * @classdesc *

Verify that the contents of a variable is an iterable value.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['iterable'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IterableValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IterableValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['iterable'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LowerValidator * @extends sogv.BaseValidator * @classdesc *

Check for lowercase character(s).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['lower'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LowerValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LowerValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['lower'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LtValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be less than the given field.

*

Strings, numerics, arrays, and dates are evaluated using the same conventions as the size rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['lt'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LtValidator(data, {"value": 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LtValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LtValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number, array or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['lt'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LteValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be less than or equal to the given field.

*

Strings, numerics, arrays, and dates are evaluated using the same conventions as the size rule.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['lte'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LteValidator(data, {"value": 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LteValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LteValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

The data type could be string, number, array or date.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['lte'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NotInValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must not be included in the given list of values.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['not_in', 'not-in'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NotInValidator("Bob", [ * "Liam", "Noah", "William", "James", "Logan", "Benjamin", "Mason", "Elijah", * "Oliver", "Jacob", "Lucas", "Michael", "Alexander", "Ethan", "Daniel", * "Matthew", "Aiden", "Henry", "Joseph", "Jackson", "Samuel", "Sebastian", * "David", "Carter", "Wyatt", "Jayden", "John", "Owen", "Dylan", "Luke" * ]); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NotInValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NotInValidator#choices * @type {Array} * @description *

A required option - this is the array of options that should be considered in the valid set.

*

The input value will be matched against this array.

*/ choices: any[]; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['not_in', 'not-in'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NumericValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be numeric.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['numeric', 'num'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NumericValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NumericValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['numeric', 'num'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ObjectValidator * @extends sogv.BaseValidator * @classdesc *

Finds whether a variable is an object.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['object'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.ObjectValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class ObjectValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['object'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.PrintValidator * @extends sogv.BaseValidator * @classdesc *

Check for printable character(s).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['print'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.PrintValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class PrintValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['print'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.PunctValidator * @extends sogv.BaseValidator * @classdesc *

Check for any printable character which is not whitespace or an alphanumeric character.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['punct'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.PunctValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class PunctValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['punct'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.RealValidator * @extends sogv.BaseValidator * @classdesc *

Finds whether the type of a variable is real.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['real'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.RealValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class RealValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['real'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ScalarValidator * @extends sogv.BaseValidator * @classdesc *

Finds whether a variable is a scalar. Scalar variables are those containing an integer, float, string or boolean.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['scalar'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.ScalarValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class ScalarValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['scalar'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.SizeValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must have a size matching the given value.

*

For string data, value corresponds to the number of characters.

*

For numeric data, value corresponds to a given integer value.

*

For an array, size corresponds to the count of the array.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['size'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.SizeValidator(data, {min: 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class SizeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.SizeValidator#value * @type {Integer} * @description *

This option is required.

*

It defines the value to compare to.

*/ value: Integer; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['size'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.SpaceValidator * @extends sogv.BaseValidator * @classdesc *

Check for whitespace character(s).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['space'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.SpaceValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class SpaceValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['space'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.StartsWithValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must start with one of the given values.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['starts_with', 'starts-with', 'starts'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.StartsWithValidator(data, {starts: ['abc','def']}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class StartsWithValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.StartsWithValidator#starts * @type {String|Array} * @description *

The option is required.

*

The list of starts.

*

One of the "start" needs to be the end of the passed value.

*/ starts: string | any[]; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['starts_with', 'starts-with', 'starts'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.StringValidator * @extends sogv.BaseValidator * @classdesc *

The field under validation must be a string.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['string', 'str'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.StringValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class StringValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['string', 'str'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.UpperValidator * @extends sogv.BaseValidator * @classdesc *

Check for uppercase character(s).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['upper'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.UpperValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class UpperValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['upper'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.XdigitValidator * @extends sogv.BaseValidator * @classdesc *

Check for character(s) representing a hexadecimal digit.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['xdigit'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.XdigitValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class XdigitValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['xdigit'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.AllValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is valid according to list of validation rules.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} rules Validation rules. * @param {Object} options The setting options. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['all'].

* @property {Object} options The description of the required options. * @example * var rules = 'required|email'; * var data = 'iamtheslaveofgod@gmail.com' * var validator = new sogv.AllValidator(data, rules, { * lang: 'en' * }); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class AllValidator extends sogv.BaseValidator { constructor(data: any, rules: any, options: any); /** * @name sogv.AllValidator#rules * @type {String} * @description Validation rules. */ rules: string; /** * @function * @name sogv.AllValidator#add * @description Add new validator * @param {String} name The validator name * @param {Object} options The validation settings */ add(name: string, options: any): void; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['all'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.BicValidator * @extends sogv.BaseValidator * @classdesc *

This constraint is used to ensure that a value has the proper format of a {@link https://en.wikipedia.org/wiki/Business_Identifier_Code|Business Identifier Code (BIC)}.

*

BIC is an internationally agreed means to uniquely identify both financial and non-financial institutions.

*

You may also check that the BIC is associated with a given IBAN.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['bic'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.BicValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class BicValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BicValidator#iban * @type {String} * @description *

An IBAN value to validate that the BIC is associated with it.

*

Default: null.

*/ iban: string; /** * @name sogv.BicValidator#ibanMessage * @type {String} * @description *

The default message supplied when the value does not pass the combined BIC/IBAN check.

*

Default: "This Business Identifier Code (BIC) is not associated with IBAN %%iban%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%iban%%The current IBAN value
*/ ibanMessage: string; /** * @name sogv.BicValidator#message * @type {String} * @description *

The default message supplied when the value does not pass the BIC check.

*

Default: "This is not a valid Business Identifier Code (BIC)."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) BIC value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['bic'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.BlankValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is blank - meaning equal to an empty string or null.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['blank', 'empty'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.BlankValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class BlankValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.BlankValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not blank.

*

Default: "This value should be blank."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['blank', 'empty'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.CardSchemeValidator * @extends sogv.BaseValidator * @classdesc *

This constraint ensures that a credit card number is valid for a given credit card company.

*

It can be used to validate the number before trying to initiate a payment through a payment gateway.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['card-scheme', 'cs'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.CardSchemeValidator(data, schemes); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class CardSchemeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.CardSchemeValidator#message * @type {String} * @description *

The message shown when the value does not pass the CardScheme check.

*

Default: "Unsupported card type or invalid card number." *

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.CardSchemeValidator#schemes * @type {String|Array} * @description *

This option is required and represents the name of the number scheme used to validate the credit card number, it can either be a string or an array.

*

Valid values are:

* *

For more information about the used schemes, see {@link https://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number_.28IIN.29|Wikipedia: Issuer identification number (IIN)}.

*/ schemes: string | any[]; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['card-scheme', 'cs'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ChoiceValidator * @extends sogv.BaseValidator * @classdesc *

This constraint is used to ensure that the given value is one of a given set of valid choices.

*

It can also be used to validate that each item in an array of items is one of those valid choices.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['choice'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.ChoiceValidator(["Liam", "Noah", "William", "James"], { * 'choice': { * "choices": [ * "Liam", "Noah", "William", "James", "Logan", "Benjamin", "Mason", "Elijah", * "Oliver", "Jacob", "Lucas", "Michael", "Alexander", "Ethan", "Daniel", * "Matthew", "Aiden", "Henry", "Joseph", "Jackson", "Samuel", "Sebastian", * "David", "Carter", "Wyatt", "Jayden", "John", "Owen", "Dylan", "Luke" * ], * "multiple": true, * "min": 5 * } * }); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class ChoiceValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.ChoiceValidator#callback * @type {String|Array|Closure} * @description *

This is a callback method that can be used instead of the choices option to return the choices array.

*/ callback: string | any[] | Closure; /** * @name sogv.ChoiceValidator#choices * @type {Array} * @description *

A required option (unless callback is specified) - this is the array of options that should be considered in the valid set.

*

The input value will be matched against this array.

*/ choices: any[]; /** * @name sogv.ChoiceValidator#max * @type {Integer} * @description *

If the multiple option is true, then you can use the max option to force no more than XX number of values to be selected.

*

For example, if max is 3, but the input array contains 4 valid items, the validation will fail.

*/ max: Integer; /** * @name sogv.ChoiceValidator#maxMessage * @type {String} * @description *

This is the validation error message that's displayed when the user chooses too many options per the max option.

*

Default: "You must select at most {{ limit }} choices."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%limit%%Max count of selected options
%%choices%%A comma-separated list of available choices
%%value%%The current (invalid) value
*/ maxMessage: string; /** * @name sogv.ChoiceValidator#message * @type {String} * @description *

This is the message that you will receive if the multiple option is set to false and the underlying value is not in the valid array of choices.

*

Default: "The value you selected is not a valid choice."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.ChoiceValidator#min * @type {Integer} * @description *

If the multiple option is true, then you can use the min option to force at least XX number of values to be selected.

*

For example, if min is 3, but the input array only contains 2 valid items, the validation will fail.

*/ min: Integer; /** * @name sogv.ChoiceValidator#minMessage * @type {String} * @description *

This is the validation error message that's displayed when the user chooses too few choices per the min option.

*

Default: "You must select at least {{ limit }} choices."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%limit%%Min count of selected options
%%choices%%A comma-separated list of available choices
%%value%%The current (invalid) value
*/ minMessage: string; /** * @name sogv.ChoiceValidator#multiple * @type {Boolean} * @description *

If this option is true, the input value is expected to be an array instead of a single, scalar value.

*

The constraint will check that each value of the input array can be found in the array of valid choices.

*

If even one of the input values cannot be found, the validation will fail.

*

Default: false

*/ multiple: boolean; /** * @name sogv.ChoiceValidator#multipleMessage * @type {String} * @description *

This is the message that you will receive if the multiple option is set to true and one of the values on the underlying array being checked is not in the array of valid choices.

*

Default: "One or more of the given values is invalid."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ multipleMessage: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['choice'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.CountValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a given collection's (i.e. an array or an object that implements Countable) element count is between some minimum and maximum value.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['count'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.CountValidator(data, {"min": 10, "max": 20}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class CountValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.CountValidator#exactMessage * @type {String} * @description *

The message that will be shown if min and max values are equal and the underlying collection elements count is not exactly this value.

*

Default: "This collection should contain exactly %%limit%% elements."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * *
ParameterDescription
%%count%%The current collection size
%%limit%%The exact expected collection size
*/ exactMessage: string; /** * @name sogv.CountValidator#max * @type {Integer} * @description *

This option is the "max" count value. Validation will fail if the given collection elements count is greater than this max value.

*

This option is required when the min option is not defined.

*/ max: Integer; /** * @name sogv.CountValidator#maxMessage * @type {String} * @description *

The message that will be shown if the underlying collection elements count is more than the max option.

*

Default: "This collection should contain %%limit%% elements or less."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * *
ParameterDescription
%%count%%The current collection size
%%limit%%The upper limit
*/ maxMessage: string; /** * @name sogv.CountValidator#min * @type {Integer} * @description *

This option is the "min" count value. Validation will fail if the given collection elements count is less than this min value.

*

This option is required when the max option is not defined.

*/ min: Integer; /** * @name sogv.CountValidator#minMessage * @type {String} * @description *

The message that will be shown if the underlying collection elements count is less than the min option.

*

Default: "This collection should contain %%limit%% elements or more."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * *
ParameterDescription
%%count%%The current collection size
%%limit%%The lower limit
*/ minMessage: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['count'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.CountryValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid {@link https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes/ISO 3166-1 alpha-2} country code.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['country'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.CountryValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class CountryValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.CountryValidator#message * @type {String} * @description *

This message is shown if the string is not a valid country code.

*

Default:"This value is not a valid country."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) country code
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['country'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.CurrencyValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid {@link https://en.wikipedia.org/wiki/ISO_4217|3-letter ISO 4217} currency name.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['currency'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.CurrencyValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class CurrencyValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.CurrencyValidator#message * @type {String} * @description * This is the message that will be shown if the value is not a valid currency.

*

Default: "This value is not a valid currency."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['currency'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DateTimeValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid "datetime", meaning a string (or an object that can be cast into a string) that follows a specific format.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['date-time', 'date_format', 'date-format'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DateTimeValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DateTimeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.DateTimeValidator#message * @type {String} * @description *

This message is shown if the underlying data is not a valid datetime.

*

Default: "This value is not a valid datetime."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.DateTimeValidator#format * @type {String} * @description *

This option allows to validate a custom date format.

*

Default: "YYYY-MM-DD HH:mm:ss"

*

Year, month, and day tokens

*

Tokens are case-sensitive.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
InputExampleDescription
YYYY20144 or 2 digit year
YY142 digit year
Y-25Year with any number of digits and sign
Q1..4Quarter of year. Sets month to first month in quarter.
M MM1..12Month number
MMM MMMMJan..DecemberMonth name in locale that is specified
D DD1..31Day of month
Do1st..31stDay of month with ordinal
DDD DDDD1..365Day of year
X1410715640.579Unix timestamp
x1410715640579Unix ms timestamp
*

Week year, week, and weekday tokens

*

Tokens are case-sensitive.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
InputExampleDescription
gggg2014Locale 4 digit week year
gg * 14Locale 2 digit week year
w ww1..53Locale week of year
e0..6Locale day of week
ddd ddddMon...SundayDay name in locale that is specified
GGGG2014ISO 4 digit week year
GG14ISO 2 digit week year
W WW1..53ISO week of year
E1..7ISO day of week
*

Locale aware formats

*

Tokens are case-sensitive.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
InputExampleDescription
L04/09/1986Date (in local format)
LLSeptember 4 1986Month name, day of month, year
LLLSeptember 4 1986 8:30 PMMonth name, day of month, year, time
LLLLThursday, September 4 1986 8:30 PMDay of week, month name, day of month, year, time
LT08:30 PMTime (without seconds)
LTS08:30:00 PMTime (with seconds)
*

Hour, minute, second, millisecond, and offset tokens

*

Tokens are case-sensitive.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
InputExampleDescription
H HH0..23Hours (24 hour time)
h hh1..12Hours (12 hour time used with a A.)
k kk1..24Hours (24 hour time from 1 to 24)
a Aam pmPost or ante meridiem (Note the one character a p are also considered valid)
m mm0..59Minutes
s ss0..59Seconds
S SS SSS0..999Fractional seconds
Z ZZ+12:00Offset from UTC as +-HH:mm, +-HHmm, or Z
*/ format: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['date-time', 'date_format', 'date-format'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DateValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid date, meaning a string (or an object that can be cast into a string) that follows a valid YYYY-MM-DD format.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['date'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DateValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DateValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.DateValidator#message * @type {String} * @description *

This message is shown if the underlying data is not a valid date.

*

Default: "This value is not a valid date."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['date'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.DivisibleByValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is divisible by another value, defined in the options.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['divisible-by'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.DivisibleByValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class DivisibleByValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.DivisibleByValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not divisible by the comparison value.

*

Default: "This value should be a multiple of %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.DivisibleByValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a number or date object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['divisible-by'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.EmailValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid email address.

*

The underlying value is cast to a string before being validated.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['email'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.EmailValidator(data, {data: 'loose'}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class EmailValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.EmailValidator#mode * @type {String} * @description *

This option is optional and defines the pattern the email address is validated against.

*

Default: 'html5'

*

Valid values are:

* */ mode: string; /** * @name sogv.EmailValidator#normalize * @type {Boolean} * @description *

Normalizer string before validate (trim, etc.).

*

Default: false

*/ normalize: boolean; /** * @name sogv.EmailValidator#message * @type {String} * @description *

This message is shown if the underlying data is not a valid email address.

*

Default: "This value is not a valid email address."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['email'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.EqualToValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is equal to another value, defined in the options.

*

This constraint compares using ==, so 3 and "3" are considered equal. Use sogv.IdenticalTo to compare with ===.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['equal-to', 'equal', 'same', 'et'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.EqualToValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class EqualToValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.EqualToValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not equal.

*

Default: "This value should be equal to %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.EqualToValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['equal-to', 'equal', 'same', 'et'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.GreaterThanOrEqualValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is greater than or equal to another value, defined in the options.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['greater_than_or_equal', 'greater-than-or-equal', 'min'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.GreaterThanOrEqualValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class GreaterThanOrEqualValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.GreaterThanOrEqualValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not greater than or equal to the comparison value.

*

Default: "This value should be greater than or equal to %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.GreaterThanOrEqualValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or date object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['greater_than_or_equal', 'greater-than-or-equal', 'min'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.GreaterThanValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is greater than another value, defined in the options.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['greater_than', 'greater-than', 'greater'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.GreaterThanValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class GreaterThanValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.GreaterThanValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not greater than the comparison value.

*

Default: "This value should be greater than %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.GreaterThanValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or date object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['greater_than', 'greater-than', 'greater'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IbanValidator * @extends sogv.BaseValidator * @classdesc *

This constraint is used to ensure that a bank account number has the proper format of an {@link https://en.wikipedia.org/wiki/International_Bank_Account_Number|International Bank Account Number (IBAN)}.

*

IBAN is an internationally agreed means of identifying bank accounts across national borders with a reduced risk of propagating transcription errors.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['iban'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IbanValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IbanValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IbanValidator#message * @type {String} * @description *

The default message supplied when the value does not pass the IBAN check.

*

Default: "This is not a valid International Bank Account Number (IBAN)."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['iban'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IdenticalToValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is identical to another value, defined in the options.

*

This constraint compares using ===, so 3 and "3" are not considered equal.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['identical-to', 'identical', 'it'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IdenticalToValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IdenticalToValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IdenticalToValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not identical.

*

Default: "This value should be identical to %%compared_value_type%% %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.IdenticalToValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['identical-to', 'identical', 'it'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IpValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid IP address.

*

By default, this will validate the value as IPv4, but a number of different options exist to validate as IPv6 and many other combinations.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['ip'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IpValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IpValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IpValidator#message * @type {String} * @description *

This message is shown if the string is not a valid IP address.

*

Default: "This is not a valid IP address."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.IpValidator#normalize * @type {Boolean} * @description *

Normalizer string before validate (trim, etc.).

*

Default: false.

*/ normalize: boolean; /** * @name sogv.IpValidator#version * @type {String} * @description *

This determines exactly how the IP address is validated and can take one of a variety of different values.

*

Default: "4".

* All ranges * * No private ranges * * No reserved ranges * * Only public ranges * */ version: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['ip'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IsFalseValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is false.

*

Specifically, this checks to see if the value is exactly false, exactly the integer 0, or exactly the string "0".

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['is-false', 'false'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IsFalseValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IsFalseValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IsFalseValidator#message * @type {String} * @description *

This message is shown if the underlying data is not false.

*

Default: "This value should be false."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['is-false', 'false'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IsNullValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is exactly equal to null.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['is-null', 'null', 'nullable'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IsNullValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IsNullValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IsNullValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not null.

*

Default: "This value should be null."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['is-null', 'null', 'nullable'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IsTrueValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is true.

*

Specifically, this checks if the value is exactly true, exactly the integer 1, or exactly the string "1".

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['is-true', 'true'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IsTrueValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IsTrueValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IsTrueValidator#message * @type {String} * @description *

This message is shown if the underlying data is not true.

*

Default: "This value should be true."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['is-true', 'true'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IsbnValidator * @extends sogv.BaseValidator * @classdesc *

This constraint validates that an {@link https://en.wikipedia.org/wiki/Isbn|International Standard Book Number (ISBN)} is either a valid ISBN-10 or a valid ISBN-13.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['isbn'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IsbnValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IsbnValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IsbnValidator#bothIsbnMessage * @type {String} * @description *

The message that will be shown if the type option is null and the given value does not pass any of the ISBN checks.

*

Default: "This value is neither a valid ISBN-10 nor a valid ISBN-13."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ bothIsbnMessage: string; /** * @name sogv.IsbnValidator#isbn10Message * @type {String} * @description *

The message that will be shown if the type option is isbn10 and the given value does not pass the ISBN-10 check.

*

Default: "This value is not a valid ISBN-10."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ isbn10Message: string; /** * @name sogv.IsbnValidator#isbn13Message * @type {String} * @description *

The message that will be shown if the type option is isbn13 and the given value does not pass the ISBN-13 check.

*

Default: "This value is not a valid ISBN-13."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ isbn13Message: string; /** * @name sogv.IsbnValidator#message * @type {String} * @description *

The message that will be shown if the value is not valid. If not null, this message has priority over all the other messages.

*

Default: null

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.IsbnValidator#type * @type {String} * @description *

The type of ISBN to validate against. Valid values are isbn10, isbn13 and null to accept any kind of ISBN.

*

Default: null

*/ type: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['isbn'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.IssnValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid {@link https://en.wikipedia.org/wiki/Issn|International Standard Serial Number (ISSN)}.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['issn'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.IssnValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class IssnValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.IssnValidator#caseSensitive * @type {Boolean} * @description *

The validator will allow ISSN values to end with a lower case 'x' by default.

*

When switching this to true, the validator requires an upper case 'X'.

*

Default: false

*/ caseSensitive: boolean; /** * @name sogv.IssnValidator#requireHyphen * @type {Boolean} * @description *

The validator will allow non hyphenated ISSN values by default.

*

When switching this to true, the validator requires a hyphenated ISSN value.

*

Default: false

*/ requireHyphen: boolean; /** * @name sogv.IssnValidator#message * @type {String} * @description *

The message shown if the given value is not a valid ISSN.

*

Default: "This value is not a valid ISSN."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['issn'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.JsonValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value has valid JSON syntax.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['json'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.JsonValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class JsonValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.JsonValidator#message * @type {String} * @description *

This message is shown if the underlying data is not a valid JSON value.

*

Default: "This value should be valid JSON."

*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['json'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LanguageValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid language Unicode language identifier (e.g. fr or ar-dz).

*

Available languages:

*

'aa', 'ab', 'ace', 'ach', 'ada', 'ady', 'ae', 'aeb', 'af', 'afh', 'agq', 'ain', 'ak', 'akk', 'akz', 'ale', 'aln', 'alt', 'am', 'an', 'ang', 'anp', 'ar', 'arc', 'arn', 'aro', 'arp', 'arq', 'ars', 'arw', 'ary', 'arz', 'as', 'asa', 'ase', 'ast', 'av', 'avk', 'awa', 'ay', 'az', 'ba', 'bal', 'ban', 'bar', 'bas', 'bax', 'bbc', 'bbj', 'be', 'bej', 'bem', 'bew', 'bez', 'bfd', 'bfq', 'bg', 'bgn', 'bho', 'bi', 'bik', 'bin', 'bjn', 'bkm', 'bla', 'bm', 'bn', 'bo', 'bpy', 'bqi', 'br', 'bra', 'brh', 'brx', 'bs', 'bss', 'bua', 'bug', 'bum', 'byn', 'byv', 'ca', 'cad', 'car', 'cay', 'cch', 'ccp', 'ce', 'ceb', 'cgg', 'ch', 'chb', 'chg', 'chk', 'chm', 'chn', 'cho', 'chp', 'chr', 'chy', 'cic', 'ckb', 'co', 'cop', 'cps', 'cr', 'crh', 'crs', 'cs', 'csb', 'cu', 'cv', 'cy', 'da', 'dak', 'dar', 'dav', 'de', 'del', 'den', 'dgr', 'din', 'dje', 'doi', 'dsb', 'dtp', 'dua', 'dum', 'dv', 'dyo', 'dyu', 'dz', 'dzg', 'ebu', 'ee', 'efi', 'egl', 'egy', 'eka', 'el', 'elx', 'en', 'enm', 'eo', 'es', 'esu', 'et', 'eu', 'ewo', 'ext', 'fa', 'fan', 'fat', 'ff', 'fi', 'fil', 'fit', 'fj', 'fo', 'fon', 'fr', 'frc', 'frm', 'fro', 'frp', 'frr', 'frs', 'fur', 'fy', 'ga', 'gaa', 'gag', 'gan', 'gay', 'gba', 'gbz', 'gd', 'gez', 'gil', 'gl', 'glk', 'gmh', 'gn', 'goh', 'gom', 'gon', 'gor', 'got', 'grb', 'grc', 'gsw', 'gu', 'guc', 'gur', 'guz', 'gv', 'gwi', 'ha', 'hai', 'hak', 'haw', 'he', 'hi', 'hif', 'hil', 'hit', 'hmn', 'ho', 'hr', 'hsb', 'hsnht', 'hu', 'hup', 'hy', 'hz', 'ia', 'iba', 'ibb', 'id', 'ie', 'ig', 'ii', 'ik', 'ilo', 'inh', 'io', 'is', 'it', 'iu', 'izh', 'ja', 'jam', 'jbo', 'jgo', 'jmc', 'jpr', 'jrb', 'jut', 'jv', 'ka', 'kaa', 'kab', 'kac', 'kaj', 'kam', 'kaw', 'kbd', 'kbl', 'kcg', 'kde', 'kea', 'ken', 'kfo', 'kg', 'kgp', 'kha', 'kho', 'khq', 'khw', 'ki', 'kiu', 'kj', 'kk', 'kkj', 'kl', 'kln', 'km', 'kmb', 'kn', 'ko', 'koi', 'kok', 'kos', 'kpe', 'kr', 'krc', 'kri', 'krj', 'krl', 'kru', 'ks', 'ksb', 'ksf', 'ksh', 'ku', 'kum', 'kut', 'kv', 'kw', 'ky', 'la', 'lad', 'lag', 'lah', 'lam', 'lb', 'lez', 'lfn', 'lg', 'li', 'lij', 'liv', 'lkt', 'lmo', 'ln', 'lo', 'lol', 'lou', 'loz', 'lrc', 'lt', 'ltg', 'lu', 'lua', 'lui', 'lun', 'luo', 'lus', 'luy', 'lv', 'lzh', 'lzz', 'mad', 'maf', 'mag', 'mai', 'mak', 'man', 'mas', 'mde', 'mdf', 'mdr', 'men', 'mer', 'mfe', 'mg', 'mga', 'mgh', 'mgo', 'mh', 'mi', 'mic', 'min', 'mk', 'ml', 'mn', 'mnc', 'mni', 'moh', 'mos', 'mr', 'mrj', 'ms', 'mt', 'mua', 'mus', 'mwl', 'mwr', 'mwv', 'my', 'mye', 'myv', 'mzn', 'na', 'nan', 'nap', 'naq', 'nb', 'nd', 'nds', 'ne', 'new', 'ng', 'nia', 'niu', 'njo', 'nl', 'nmg', 'nn', 'nnh', 'no', 'nog', 'non', 'nov', 'nqo', 'nr', 'nso', 'nus', 'nv', 'nwc', 'ny', 'nym', 'nyn', 'nyo', 'nzi', 'oc', 'oj', 'om', 'or', 'os', 'osa', 'ota', 'pa', 'pag', 'pal', 'pam', 'pap', 'pau', 'pcd', 'pcm', 'pdc', 'pdt', 'peo', 'pfl', 'phn', 'pi', 'pl', 'pms', 'pnt', 'pon', 'prg', 'pro', 'ps', 'pt', 'qu', 'quc', 'qug', 'raj', 'rap', 'rar', 'rgn', 'rif', 'rm', 'rn', 'ro', 'rof', 'rom', 'rtm', 'ru', 'rue', 'rug', 'rup', 'rw', 'rwk', 'sa', 'sad', 'sah', 'sam', 'saq', 'sas', 'sat', 'saz', 'sba', 'sbp', 'sc', 'scn', 'sco', 'sd', 'sdc', 'sdh', 'se', 'see', 'seh', 'sei', 'sel', 'ses', 'sg', 'sga', 'sgs', 'sh', 'shi', 'shn', 'shu', 'si', 'sid', 'sk', 'sl', 'sli', 'sly', 'sm', 'sma', 'smj', 'smn', 'sms', 'sn', 'snk', 'so', 'sog', 'sq', 'sr', 'srn', 'srr', 'ss', 'ssy', 'st', 'stq', 'su', 'suk', 'sus', 'sux', 'sv', 'sw', 'swb', 'syc', 'syr', 'szl', 'ta', 'tcy', 'te', 'tem', 'teo', 'ter', 'tet', 'tg', 'th', 'ti', 'tig', 'tiv', 'tk', 'tkl', 'tkr', 'tl', 'tlh', 'tli', 'tly', 'tmh', 'tn', 'to', 'tog', 'tpi', 'tr', 'tru', 'trv', 'ts', 'tsd', 'tsi', 'tt', 'ttt', 'tum', 'tvl', 'tw', 'twq', 'ty', 'tyv', 'tzm', 'udm', 'ug', 'uga', 'uk', 'umb', 'ur', 'uz', 'vai', 've', 'vec', 'vep', 'vi', 'vls', 'vmf', 'vo', 'vot', 'vro', 'vun', 'wa', 'wae', 'wal', 'war', 'was', 'wbp', 'wo', 'wuu', 'xal', 'xh', 'xmf', 'xog', 'yao', 'yap', 'yav', 'ybb', 'yi', 'yo', 'yrl', 'yue', 'za', 'zap', 'zbl', 'zea', 'zen', 'zgh', 'zh', 'zu', 'zun', 'zza'

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['language', 'lang'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LanguageValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LanguageValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LanguageValidator#message * @type {String} * @description *

This message is shown if the string is not a valid language code.

*

Default: "This value is not a valid language."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['language', 'lang'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LengthValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a given string length is between some minimum and maximum value.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['length', 'len'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LengthValidator(data, {min: 10}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LengthValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LengthValidator#allowEmptyString * @type {Boolean} * @description *

If set to true, empty strings are considered valid.

*

The default false value considers empty strings not valid.

*

Default: false.

*/ allowEmptyString: boolean; /** * @name sogv.LengthValidator#exactMessage * @type {String} * @description *

The message that will be shown if min and max values are equal and the underlying value's length is not exactly this value.

*

Default: "This value should have exactly %%limit%% characters.".

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%limit%%The exact expected length
%%value%%The current (invalid) value
*/ exactMessage: string; /** * @name sogv.LengthValidator#max * @type {Integer} * @description This option is the "max" length value. Validation will fail if the given value's length is greater than this max value. * This option is required when the "min: option is not defined. */ max: Integer; /** * @name sogv.LengthValidator#maxMessage * @type {String} * @description *

The message that will be shown if the underlying value's length is more than the max option.

*

Default: "This value is too long. It should have %%limit%% characters or less.". *

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%limit%%The expected maximum length
%%value%%The current (invalid) value
*/ maxMessage: string; /** * @name sogv.LengthValidator#min * @type {Integer} * @description * This option is the "min" length value. Validation will fail if the given value's length is less than this min value. * This option is required when the max option is not defined. * It is important to notice that NULL values and empty strings are considered valid no matter if the constraint required a minimum length. Validators are triggered only if the value is not blank. */ min: Integer; /** * @name sogv.LengthValidator#minMessage * @type {String} * @description *

The message that will be shown if the underlying value's length is less than the min option.

*

Default: "This value is too short. It should have %%limit%% characters or more.".

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%limit%%The expected minimum length
%%value%%The current (invalid) value
*/ minMessage: string; /** * @name sogv.LengthValidator#normalize * @type {Boolean} * @description *

Normalizer string before validate (trim, etc.).

*

Default: false

*/ normalize: boolean; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['length', 'len'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LessThanOrEqualValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is less than or equal to another value, defined in the options.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['less_than_or_equal'', 'less-than-or-equal', 'max'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LessThanOrEqualValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LessThanOrEqualValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LessThanOrEqualValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not less than or equal to the comparison value.

*

Default: "This value should be less than or equal to %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.LessThanOrEqualValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or date object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['less_than_or_equal'', 'less-than-or-equal', 'max'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LessThanValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is less than another value, defined in the options.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['less_than', 'less-than', 'less'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LessThanValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LessThanValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LessThanValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not less than the comparison value.

*

Default: "This value should be less than %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.LessThanValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or date object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['less_than', 'less-than', 'less'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LocaleValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid locale.

*

The "value" for each locale is any of the {@link http://userguide.icu-project.org/locale|ICU format locale IDs}.

*

For example, the two letter {@link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes|ISO 639-1} language code (e.g. fr), or the language code followed by an underscore (_) and the {@link https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes|ISO 3166-1 alpha-2} country code (e.g. fr_FR for French/France).

*

The given locale values are canonicalized before validating them to avoid issues with wrong uppercase/lowercase values and to remove unneeded elements (e.g. FR-fr.utf8 will be validated as fr_FR).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['locale'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LocaleValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LocaleValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LocaleValidator#message * @type {String} * @description *

This message is shown if the string is not a valid locale.

*

Default: "This value is not a valid locale."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['locale'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.LuhnValidator * @extends sogv.BaseComparisonValidator * @classdesc *

This constraint is used to ensure that a credit card number passes the {@link https://en.wikipedia.org/wiki/Luhn_algorithm|Luhn algorithm}.

*

It is useful as a first step to validating a credit card: before communicating with a payment gateway.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['luhn'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.LuhnValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class LuhnValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.LuhnValidator#message * @type {String} * @description *

The default message supplied when the value does not pass the Luhn check.

*

Default: "Invalid card number."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['luhn'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NegativeOrZeroValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is a negative number or equal to zero.

*

If you don't want to allow zero as value, use sogv.Negative instead.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['negative-or-zero', 'noz'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NegativeOrZeroValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NegativeOrZeroValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NegativeOrZeroValidator#message * @type {String} * @description *

The default message supplied when the value is not less than or equal to zero.

*

Default: "This value should be either negative or zero."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['negative-or-zero', 'noz'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NegativeValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is a negative number.

*

Zero is neither positive nor negative, so you must use sogv.NegativeOrZero if you want to allow zero as value.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['negative'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NegativeValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NegativeValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NegativeValidator#message * @type {String} * @description *

The default message supplied when the value is not less than zero.

*

Default: "This value should be negative."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['negative'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NotBlankValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is not blank - meaning not equal to a blank string, a blank array, false or null (null behavior is configurable).

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['not-blank', 'not-empty', 'filled'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NotBlankValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NotBlankValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NotBlankValidator#allowNull * @type {Boolean} * @description * If set to true, null values are considered valid and won't trigger a constraint violation.

* Default: false */ allowNull: boolean; /** * @name sogv.NotBlankValidator#normalize * @type {Boolean} * @description *

Normalizer string before validate (trim, etc.).

*

Default: false

*/ normalize: boolean; /** * @name sogv.NotBlankValidator#message * @type {String} * @description * This is the message that will be shown if the value is blank.

*

Default: "This value should not be blank."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['not-blank', 'not-empty', 'filled'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NotEqualToValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is not equal to another value, defined in the options.

*

This constraint compares using !=, so 3 and "3" are considered equal. sogv.Use NotIdenticalTo to compare with !==.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['not-equal-to', 'not-equal', 'net'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NotEqualToValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NotEqualToValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NotEqualToValidator#message * @type {String} * @description *

This is the message that will be shown if the value is not equal.

*

Default: "This value should not be equal to %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.NotEqualToValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['not-equal-to', 'not-equal', 'net'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NotIdenticalToValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is not identical to another value, defined in the options.

*

This constraint compares using !==, so 3 and "3" are considered not equal.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['not-identical-to', 'not-identical', 'nit'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NotIdenticalToValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NotIdenticalToValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NotIdenticalToValidator#message * @type {String} * @description * This is the message that will be shown if the value is identical.

*

Default: "This value should not be identical to %%compared_value_type%% %%compared_value%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.NotIdenticalToValidator#value * @type {*} * @description *

This option is required.

*

It defines the value to compare to.

*

It can be a string, number or object.

*/ value: any; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['not-identical-to', 'not-identical', 'nit'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.NotNullValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is not strictly equal to null.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['not-null', 'required', 'present'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.NotNullValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class NotNullValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.NotNullValidator#message * @type {String} * @description *

This is the message that will be shown if the value is null.

*

Default: "This value should not be null."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['not-null', 'required', 'present'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.PositiveOrZeroValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is a positive number or equal to zero.

*

If you don't want to allow zero as value, use sogv.Positive instead.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['positive-or-zero', 'poz'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.PositiveOrZeroValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class PositiveOrZeroValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.PositiveOrZeroValidator#message * @type {String} * @description *

The default message supplied when the value is not greater than or equal to zero.

*

Default: "This value should be either positive or zero."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['positive-or-zero', 'poz'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.PositiveValidator * @extends sogv.BaseComparisonValidator * @classdesc *

Validates that a value is a positive number.

*

Zero is neither positive nor negative, so you must use sogv.PositiveOrZero if you want to allow zero as value.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['positive'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.PositiveValidator(data, {"value": "the value to compare to"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class PositiveValidator extends sogv.BaseComparisonValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.PositiveValidator#message * @type {String} * @description *

The default message supplied when the value is not greater than zero.

*

Default: "This value should be positive."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * * * * * *
ParameterDescription
%%compared_value%%The expected value
%%compared_value_type%%The expected value type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['positive'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.RangeValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a given number or Date object is between some minimum and maximum.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['range'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.RangeValidator('1991-12-17T03:24:00', {"min":"1990-12-17T03:24:00","max":"1995-12-17T03:24:00"}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class RangeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.RangeValidator#invalidMessage * @type {String} * @description *

The message that will be shown if the underlying value is not a number.

*

Default: "This value should be a valid number."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ invalidMessage: string; /** * @name sogv.RangeValidator#max * @type {Number|String|Date} * @description * This required option is the "max" value. Validation will fail if the given value is greater than this max value. */ max: number | string | Date; /** * @name sogv.RangeValidator#maxMessage * @type {String} * @description *

The message that will be shown if the underlying value is more than the max option.

*

Default: "This value should be %%limit%% or less."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%limit%%The upper limit
%%value%%The current (invalid) value
*/ maxMessage: string; /** * @name sogv.RangeValidator#min * @type {Number|String|Date} * @description * This required option is the "min" value. Validation will fail if the given value is less than this min value. */ min: number | string | Date; /** * @name sogv.RangeValidator#minMessage * @type {String} * @description *

The message that will be shown if the underlying value is less than the min option.

*

Default: "This value should be %%limit%% or more."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%limit%%The lower limit
%%value%%The current (invalid) value
*/ minMessage: string; /** * @name sogv.RangeValidator#notInRangeMessage * @type {String} * @description *

The message that will be shown if the underlying value is less than the min option or greater than the max option.

*

Default: "This value should be between %%min%% and %%max%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * *
ParameterDescription
%%max%%The upper limit
%%min%%The lower limit
%%value%%The current (invalid) value
*/ notInRangeMessage: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['range'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.RegexValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value matches a regular expression.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['regex', 'regexp'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.RegexValidator(data, {pattern: 'regular expression'}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class RegexValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.RegexValidator#match * @type {Boolean} * @description *

If true (or not set), this validator will pass if the given string matches the given pattern regular expression.

*

However, when this option is set to false, the opposite will occur: validation will pass only if the given string does not match the pattern regular expression.

*

Default: true.

*/ match: boolean; /** * @name sogv.RegexValidator#message * @type {String} * @description * This is the message that will be shown if this validator fails.

*

Default: "This value is not valid."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.RegexValidator#pattern * @type {String} * @description *

This required option is the regular expression pattern that the input will be matched against.

*

By default, this validator will fail if the input string does not match this regular expression.

*

However, if match is set to false, then validation will fail if the input string does match this pattern.

*/ pattern: string; /** * @name sogv.RegexValidator#normalize * @type {Boolean} * @description *

Normalizer string before validate (trim, etc.).

*

Default: false

*/ normalize: boolean; /** * @name sogv.RegexValidator#lang * @type {String} * @description Language of messages. */ lang: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['regex', 'regexp'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.TimeValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid time, meaning a string (or an object that can be cast into a string) that follows a valid HH:mm:ss format.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['time'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.TimeValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class TimeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.TimeValidator#message * @type {String} * @description *

This message is shown if the underlying data is not a valid time.

*

Default: "This value is not a valid time."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['time'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.TimezoneValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid timezone identifier (e.g. Europe/Paris).

*

{@link https://en.wikipedia.org/wiki/List_of_tz_database_time_zones|List of tz database time zones}.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['timezone', 'tz'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.TimezoneValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class TimezoneValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.TimezoneValidator#message * @type {String} * @description *

This message is shown if the underlying data is not a valid timezone identifier.

*

Default: "This value is not a valid timezone."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['timezone', 'tz'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.TypeValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is of a specific data type.

*

For example, if a variable should be an array, you can use this constraint with the array type option to validate this.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['type'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.TypeValidator(data, {type: 'array'}); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class TypeValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.TypeValidator#type * @type {String|Array} * @description * This required option defines the type or collection of types allowed for the given value.

* The following types are available: * */ type: string | any[]; /** * @name sogv.TypeValidator#any * @type {Boolean} * @description *

If true, one of data type needs to be valid, otherwise passed data should be valid for all types.

*

Default: false

*/ any: boolean; /** * @name sogv.TypeValidator#message * @type {String} * @description *

The message if the underlying data is not of the given type.

*

Default: "This value should be of type %%type%%."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * * * * * *
ParameterDescription
%%type%%The expected type
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['type'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.UniqueValidator * @extends sogv.BaseValidator * @classdesc *

Validates that all the elements of the given collection are unique (none of them is present more than once).

*

Elements are compared strictly, so '7' and 7 are considered different elements (a string and an integer, respectively).

*

It can be a string or array.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['unique'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.UniqueValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class UniqueValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.UniqueValidator#message * @type {String} * @description *

This is the message that will be shown if at least one element is repeated in the collection.

*

Default: "This collection should contain only unique elements."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The repeated value
*/ message: string; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['unique'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.UrlValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid URL string.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['url'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.UrlValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class UrlValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.UrlValidator#message * @type {String} * @description * This message is shown if the URL is invalid.

*

Default: "This value is not a valid URL."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.UrlValidator#normalize * @type {Boolean} * @description * Normalizer string before validate (trim, etc.). * Default: false. */ normalize: boolean; /** * @name sogv.UrlValidator#protocols * @type {Array} * @description * The protocols considered to be valid for the URL. * For example, if you also consider the ftp:// type URLs to be valid, redefine the protocols array, listing http, https, and also ftp. * Default: ['http', 'https', 'ftp'] */ protocols: any[]; /** * @name sogv.UrlValidator#relativeProtocol * @type {Boolean} * @description * If true, the protocol is considered optional when validating the syntax of the given URL. * This means that both http:// and https:// are valid but also relative URLs that contain no protocol (e.g. //example.com). * Default: false. */ relativeProtocol: boolean; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['url'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.UuidValidator * @extends sogv.BaseValidator * @classdesc *

Validates that a value is a valid {@link https://en.wikipedia.org/wiki/Universally_unique_identifier|Universally unique identifier (UUID)} per {@link https://tools.ietf.org/html/rfc4122|RFC 4122}.

*

By default, this will validate the format according to the RFC's guidelines, but this can be relaxed to accept non-standard UUIDs that other systems (like PostgreSQL) accept.

*

UUID versions can also be restricted using a whitelist.

* @description *

Create a new Validator.

* @param {*} data The data which needs to be validated. * @param {Object} options The setting options * @param {Object} optionRules The validation rules for setting options. * @param {String} lang The language used by the application. Default: "en". * @param {Boolean} internal If this parameter is true, it means, that validation called from core. * @property {Array} alias *

The aliases for the current validator.

*

They could be used in the short validation format.

*

Defined aliases: ['uuid'].

* @property {Object} options The description of the required options. * @example * var validator = new sogv.UuidValidator(data); * if (false === validator.isValid()) { * validator.errors().first(); * } */ class UuidValidator extends sogv.BaseValidator { constructor(data: any, options: any, optionRules: any, lang: string, internal: boolean); /** * @name sogv.UuidValidator#message * @type {String} * @description *

This message is shown if the string is not a valid UUID.

*

Default: "This is not a valid UUID."

*

You can use the following parameters in this message:

* * * * * * * * * * * * * *
ParameterDescription
%%value%%The current (invalid) value
*/ message: string; /** * @name sogv.UuidValidator#normalize * @type {Boolean} * @description *

Normalizer string before validate (trim, etc.).

*

Default: false.

*/ normalize: boolean; /** * @name sogv.UuidValidator#strict * @type {Boolean} * @description *

If this option is set to true the constraint will check if the UUID is formatted per the RFC's input format rules: 216fff40-98d9-11e3-a5e2-0800200c9a66.

*

Default: true.

*

Setting this to false will allow alternate input formats like:

*

* */ strict: boolean; /** * @name sogv.UuidValidator#versions * @type {Array} * @description *

This option can be used to only allow specific {@link https://en.wikipedia.org/wiki/Universally_unique_identifier#Variants_and_versions|UUID versions}.

*

Valid versions are 1 - 5.

*

Default: [1,2,3,4,5].

*

The following PHP constants can also be used:

* */ versions: any[]; /** * @name sogv.BaseValidator#data * @type {*} * @description Data that needs to be validated. */ data: any; /** * @name sogv.BaseValidator#lang * @type {String} * @description Language of error messages. */ lang: string; /** * @function * @name sogv.BaseValidator#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.BaseValidator#errors * @description *

Return error errors

* @returns {sogv.Error} Error messages */ errors(): sogv.Error; /** *

The aliases for the current validator.

They could be used in the short validation format.

Defined aliases: ['uuid'].

*/ alias: any[]; /** * The description of the required options. */ options: any; } /** * @constructor * @name sogv.ErrorHandler * @classdesc This service provides handling of all error messages * @description Create a new error handler. * @param {Object} options The setting options. */ class ErrorHandler { constructor(options: any); /** * @function * @name sogv.ErrorHandler#has * @description Check if messages exist * @return {Boolean} Status */ has(): boolean; /** * @function * @name sogv.ErrorHandler#add * @description Add new message * @param {String} message Message text * @param {Object} parameters Message parameters */ add(message: string, parameters: any): void; /** * @function * @name sogv.ErrorHandler#get * @description Get message by position * @param {Integer} position Message position * @return {String} Message */ get(position: Integer): string; /** * @function * @name sogv.ErrorHandler#first * @description Get first message * @return {String} Message */ first(): string; /** * @function * @name sogv.ErrorHandler#count * @description Count of messages * @return {String} Count */ count(): string; } /** * @namespace * @name sogv.I18nHandler * @description *

I18n handler

*/ namespace I18nHandler { /** * @function * @name sogv.I18nHandler#add * @description *

Add new message or messages to global collection for specific language.

* @param {String} lang The current language * @param {Array} messages Message or messages * @example * sogv.I18nHandler.add('fr', [{ * "source": "The value you selected is not a valid choice.", * "target": "Cette valeur doit être l'un des choix proposés." * }]); * * // The first part of the message: "You must select at least %%limit%% choice." - this is the singular form * // The second part of the message: "You must select at least %%limit%% choices." - this is the plural form * // The form depends on value of "%%limit%%". If value "1", "0" or "-1" - singular form, otherwise - plural form * sogv.I18nHandler.add('fr', [{ * "source": "You must select at least %%limit%% choice.|You must select at least %%limit%% choices.", * "target": "Vous devez sélectionner au moins %%limit%% choix.|Vous devez sélectionner au moins %%limit%% choix." * }]); */ function add(lang: string, messages: any[]): void; /** * @function * @name sogv.I18nHandler#get * @description *

Get translated message for specific language by origin message.

* @param {String} lang The current language * @param {String} sourceMessage The source message * @returns {String|Null} The translated message */ function get(lang: string, sourceMessage: string): string | null; /** * @function * @name sogv.I18nHandler#prepare * @description *

Prepare message.

* @param {String} message Message text * @param {Object} parameters Message parameters * @returns {String} Processed message */ function prepare(message: string, parameters: any): string; } /** * @namespace * @name sogv.ValidationSettingsHandler * @description *

Validation settings handler.

*

This handler provides different types of validation settings parsers (validator's name and settings).

* @example * var validators = sogv.ValidationSettingsHandler.parse('required|email:{"mode":"html5"}'); */ namespace ValidationSettingsHandler { /** * @function * @name sogv.ValidationSettingsHandler#parse * @description Prepare validation settings * @param {String|JSON|Object} settings Validation settings * @returns {Object} Processed settings */ function parse(settings: string | JSON | any): any; } /**add * @constructor * @name sogv.ValidatorHandler * @classdesc This service provides handling validation of form * @description *

Create a new validator handler.

*/ class ValidatorHandler { /** * @function * @name sogv.ValidatorHandler#add * @description *

Add new validator for field.

* @param {String} key Field key * @param {sogv.AllValidator} validator Validator */ add(key: string, validator: sogv.AllValidator): void; /** * @function * @name sogv.ValidatorHandler#get * @description *

Get validator for field.

* @param {String} key Field key * @returns {sogv.AllValidator} */ get(key: string): sogv.AllValidator; /** * @function * @name sogv.ValidatorHandler#isValid * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValid(): boolean; /** * @function * @name sogv.ValidatorHandler#isValidWithErrorMessage * @description *

Check if data valid.

* @returns {Boolean} Validation status */ isValidWithErrorMessage(): boolean; } /** * @constructor * @name sogv.I18n * @classdesc *

Handles translation. Responsible for the translation. Can also handle plural forms.

* @param {String} lang The current language. This parameter is required. * @example * var translator = new sogv.I18n(lang); * var translatedMessage = translator.getText(message, parameters); */ class I18n { constructor(lang: string); /** * @function * @name sogv.I18n#translate * @description Returns the translation. * @param {String} message The message which need to be translated * @param {Object} parameters The message parameters * @returns {String} Translated and processed message */ translate(message: string, parameters: any): string; } }