mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
knockout.validation header was normalized.
This commit is contained in:
49
knockout.validation/knockout.validation.d.ts
vendored
49
knockout.validation/knockout.validation.d.ts
vendored
@@ -1,11 +1,16 @@
|
||||
// Type definitions for Knockout Validation
|
||||
// Project: https://github.com/ericmbarnard/Knockout-Validation
|
||||
// Definitions by: Dan Ludwig <https://github.com/danludwig>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../knockouot/knockout.d.ts" />
|
||||
|
||||
interface KnockoutValidationGroupingOptions {
|
||||
interface KnockoutValidationGroupingOptions {
|
||||
deep?: bool;
|
||||
observable?: bool;
|
||||
}
|
||||
|
||||
interface KnockoutValidationConfiguration {
|
||||
interface KnockoutValidationConfiguration {
|
||||
registerExtenders?: bool;
|
||||
messagesOnModified?: bool;
|
||||
messageTemplate?: string;
|
||||
@@ -19,7 +24,7 @@ interface KnockoutValidationConfiguration {
|
||||
grouping?: KnockoutValidationGroupingOptions;
|
||||
}
|
||||
|
||||
interface KnockoutValidationUtils {
|
||||
interface KnockoutValidationUtils {
|
||||
isArray(o: any): bool;
|
||||
isObject(o: any): bool;
|
||||
values(o: any): any[];
|
||||
@@ -35,31 +40,31 @@ interface KnockoutValidationUtils {
|
||||
isEmptyVal(val: any): bool;
|
||||
}
|
||||
|
||||
interface KnockoutValidationAsyncCallbackArgs {
|
||||
interface KnockoutValidationAsyncCallbackArgs {
|
||||
isValid: bool;
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface KnockoutValidationAsyncCallback {
|
||||
interface KnockoutValidationAsyncCallback {
|
||||
(result: bool): void;
|
||||
(result: KnockoutValidationAsyncCallbackArgs): void;
|
||||
}
|
||||
|
||||
interface KnockoutValidationRuleDefinition {
|
||||
interface KnockoutValidationRuleDefinition {
|
||||
message: string;
|
||||
validator(value: any, params: any): bool;
|
||||
}
|
||||
|
||||
interface KnockoutValidationAsyncRuleDefinition extends KnockoutValidationRuleDefinition {
|
||||
interface KnockoutValidationAsyncRuleDefinition extends KnockoutValidationRuleDefinition {
|
||||
async: bool;
|
||||
validator(value: any, params: any, callback: KnockoutValidationAsyncCallback): void;
|
||||
}
|
||||
|
||||
interface KnockoutValidationAnonymousRuleDefinition {
|
||||
interface KnockoutValidationAnonymousRuleDefinition {
|
||||
validation: KnockoutValidationRuleDefinition;
|
||||
}
|
||||
|
||||
interface KnockoutValidationRuleDefinitions {
|
||||
interface KnockoutValidationRuleDefinitions {
|
||||
date: KnockoutValidationRuleDefinition;
|
||||
dateISO: KnockoutValidationRuleDefinition;
|
||||
digit: KnockoutValidationRuleDefinition;
|
||||
@@ -78,30 +83,30 @@ interface KnockoutValidationRuleDefinitions {
|
||||
unique: KnockoutValidationRuleDefinition;
|
||||
}
|
||||
|
||||
interface KnockoutValidationRule {
|
||||
interface KnockoutValidationRule {
|
||||
rule: string;
|
||||
params: any;
|
||||
message?: string;
|
||||
condition?: () => bool;
|
||||
}
|
||||
|
||||
interface KnockoutValidationErrors {
|
||||
interface KnockoutValidationErrors {
|
||||
(): string[];
|
||||
showAllMessages(): void;
|
||||
showAllMessages(show: bool): void;
|
||||
}
|
||||
|
||||
interface KnockoutValidationGroup {
|
||||
errors?: KnockoutValidationErrors;
|
||||
isValid?: () => bool;
|
||||
isAnyMessageShown?: () => bool;
|
||||
interface KnockoutValidationGroup {
|
||||
errors?: KnockoutValidationErrors;
|
||||
isValid?: () => bool;
|
||||
isAnyMessageShown?: () => bool;
|
||||
}
|
||||
|
||||
interface KnockoutValidationStatic {
|
||||
init(options?: KnockoutValidationConfiguration, force?: bool): void;
|
||||
configure(options: KnockoutValidationConfiguration): void;
|
||||
reset(): void;
|
||||
|
||||
interface KnockoutValidationStatic {
|
||||
init(options?: KnockoutValidationConfiguration, force?: bool): void;
|
||||
configure(options: KnockoutValidationConfiguration): void;
|
||||
reset(): void;
|
||||
|
||||
group(obj: any, options?: any): () => string[];
|
||||
|
||||
formatMessage(message: string, params: string): string;
|
||||
@@ -132,8 +137,8 @@ interface KnockoutStatic {
|
||||
applyBindingsWithValidation(viewModel: any, rootNode?: any, options?: KnockoutValidationConfiguration): void;
|
||||
}
|
||||
|
||||
interface KnockoutSubscribableFunctions {
|
||||
isValid: KnockoutComputed;
|
||||
interface KnockoutSubscribableFunctions {
|
||||
isValid: KnockoutComputed;
|
||||
isValidating: KnockoutObservableBool;
|
||||
rules: KnockoutObservableArray;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user