@types/yup
Advanced tools
Comparing version 0.26.4 to 0.26.5
@@ -11,3 +11,3 @@ // Type definitions for yup 0.26 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.2 | ||
// TypeScript Version: 2.8 | ||
@@ -27,8 +27,2 @@ export function reach<T>( | ||
export function lazy<T>(fn: (value: T) => Schema<T>): Lazy; | ||
export function ValidationError( | ||
errors: string | string[], | ||
value: any, | ||
path: string, | ||
type?: any | ||
): ValidationError; | ||
export function setLocale(customLocale: LocaleObject): void; | ||
@@ -54,3 +48,4 @@ | ||
export type TestOptionsMessage = string | ||
export type TestOptionsMessage = | ||
| string | ||
| ((params: object & Partial<TestMessageParams>) => string); | ||
@@ -177,3 +172,5 @@ | ||
export type ObjectSchemaDefinition<T extends object> = { [field in keyof T]: Schema<T[field]> | Ref }; | ||
export type ObjectSchemaDefinition<T extends object> = { | ||
[field in keyof T]: Schema<T[field]> | Ref | ||
}; | ||
@@ -185,3 +182,6 @@ /** | ||
*/ | ||
export type Shape<T extends object, U extends object> = { [P in keyof T]: P extends keyof U ? U[P] : T[P] } & U; | ||
export type Shape<T extends object, U extends object> = { | ||
[P in keyof T]: P extends keyof U ? U[P] : T[P] | ||
} & | ||
U; | ||
@@ -199,3 +199,6 @@ export interface ObjectSchemaConstructor { | ||
from(fromKey: string, toKey: string, alias?: boolean): ObjectSchema<T>; | ||
noUnknown(onlyKnownKeys?: boolean, message?: TestOptionsMessage): ObjectSchema<T>; | ||
noUnknown( | ||
onlyKnownKeys?: boolean, | ||
message?: TestOptionsMessage | ||
): ObjectSchema<T>; | ||
transformKeys(callback: (key: any) => any): void; | ||
@@ -301,3 +304,8 @@ camelCase(): ObjectSchema<T>; | ||
export interface ValidationError { | ||
// ValidationError works a lot more like a class vs. a constructor | ||
// function that returns an interface. It's also got a couple of | ||
// static methods and it inherits from the generic Error class in | ||
// the [yup codebase][1]. | ||
// [1]: (https://github.com/jquense/yup/blob/master/src/ValidationError.js) | ||
export class ValidationError extends Error { | ||
name: string; | ||
@@ -321,2 +329,15 @@ message: string; | ||
params?: object; | ||
static isError(err: any): err is ValidationError; | ||
static formatError( | ||
message: string | ((params?: any) => string), | ||
params?: any | ||
): string | ((params?: any) => string); | ||
constructor( | ||
errors: string | string[], | ||
value: any, | ||
path: string, | ||
type?: any | ||
); | ||
} | ||
@@ -323,0 +344,0 @@ |
{ | ||
"name": "@types/yup", | ||
"version": "0.26.4", | ||
"version": "0.26.5", | ||
"description": "TypeScript definitions for yup", | ||
@@ -51,4 +51,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "736012aeca6158962cf8327dcaee0a154e84468a44cd39ce2dc2ac04b77d3938", | ||
"typeScriptVersion": "2.2" | ||
"typesPublisherContentHash": "e357bf813adddfe41d2c6da9329ab5c2bb0b1fb71666a05d9197bcc857225ccb", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 31 Dec 2018 18:36:33 GMT | ||
* Last updated: Sat, 19 Jan 2019 01:04:20 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16185
335