forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery-validation-unobtrusive.d.ts
38 lines (32 loc) · 1.55 KB
/
jquery-validation-unobtrusive.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Type definitions for Microsoft jQuery Unobtrusive Validation v3.2.3
// Project: https://github.com/aspnet/jquery-validation-unobtrusive
// Definitions by: Matt Brooks <https://github.com/EnableSoftware>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery.validation/jquery.validation.d.ts" />
declare namespace MicrosoftJQueryUnobtrusiveValidation {
type JQuerySelector = string | Document | Element | JQuery;
interface Adapter {
name: string;
params: string[];
adapt: Function
}
interface Adapters extends Array<Adapter> {
add(adapterName: string, fn: Function): Adapters;
add(adapterName: string, params: string[], fn: Function): Adapters;
addMinMax(adapterName: string, minRuleName: string, maxRuleName: string, minMaxRuleName: string, minAttribute?: string, maxAttribute?: string): Adapters;
addSingleVal(adapterName: string, ruleName: string): Adapters;
addSingleVal(adapterName: string, attribute: string, ruleName: string): Adapters;
addBool(adapterName: string, ruleName?: string): Adapters;
addMethod(adapterName: string, fn: (value: string, element: Element, params: any) => any): Adapters;
}
interface Validator {
adapters: Adapters;
parseElement(element: JQuerySelector, skipAttach?: boolean): void;
parse(selector: JQuerySelector): void;
}
}
declare namespace JQueryValidation {
interface ValidatorStatic {
unobtrusive: MicrosoftJQueryUnobtrusiveValidation.Validator;
}
}