Just for example, if you're using jQuery Validation in JavaScript you might write something like this
$("#loginForm").validate({
"rules": {
"emailAddress": "required",
"password": "required"
},
"messages": {
"emailAddress": "Required",
"password": "Required"
}
});
But in TypeScript perhaps it would be something like this
let validator: Validator = new Validator("formName");
validator.rules.add( ... );
validator.messages.add( ... );
if (validator.valid())
{
// submit or whatever ...
}
I'm not suggesting that's correct, just trying to explain what I mean.
So my questions are
1, How do you understand a TypeScript definition file and know how to code with it from a fundamental point of view?
2, How would you use jQuery Validation in TypeScript in a TypeScript way, using jquery.validation.d.ts? In other words please correct my TypeScript code above.
