@hookstate/validation
Advanced tools
Comparing version 4.0.0-rc2 to 4.0.0-rc3
@@ -1,2 +0,2 @@ | ||
import { Path, InferStateValueType, Extension } from '@hookstate/core'; | ||
import { Path, InferStateValueType, ExtensionFactory } from '@hookstate/core'; | ||
export declare type ValidationSeverity = 'error' | 'warning'; | ||
@@ -8,3 +8,3 @@ export interface ValidationError { | ||
} | ||
export interface Validation<K = string> { | ||
export interface Validation { | ||
validate(rule: (value: InferStateValueType<this>) => boolean, message: string | ((value: InferStateValueType<this>) => string), severity?: ValidationSeverity): void; | ||
@@ -20,3 +20,3 @@ valid(options?: { | ||
} | ||
export declare function validation<K extends string = string>(): () => Extension<Validation<K>>; | ||
export declare function validation<S, E>(): ExtensionFactory<S, E, Validation>; | ||
//# sourceMappingURL=validation.d.ts.map |
{ | ||
"name": "@hookstate/validation", | ||
"version": "4.0.0-rc2", | ||
"version": "4.0.0-rc3", | ||
"description": "Plugin for @hookstate/core to enable validation of data state.", | ||
@@ -32,3 +32,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@hookstate/core": "^4.0.0-rc17" | ||
"@hookstate/core": "^4.0.0-rc18" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45259