mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-30 23:30:06 +00:00
add typings for spected
This commit is contained in:
26
types/spected/index.d.ts
vendored
26
types/spected/index.d.ts
vendored
@@ -1,26 +1,30 @@
|
||||
// Type definitions for yup 0.26
|
||||
// Type definitions for spected 0.26
|
||||
// Project: https://github.com/25th-floor/spected
|
||||
// Definitions by: Benjamin Makus <https://github.com/benneq>,
|
||||
// Definitions by: Benjamin Makus <https://github.com/benneq>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.2
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
declare var spected: Spected;
|
||||
|
||||
export type Spected = (spec: Spec, input: any) => Result
|
||||
export type Spected = (spec: Spec, input: any) => Result;
|
||||
|
||||
export type Predicate = (value: any, inputs: any) => boolean
|
||||
export type Predicate = (value: any, inputs: any) => boolean;
|
||||
|
||||
export type ErrorMsg =
|
||||
| string
|
||||
| ((value: any, field: string) => string)
|
||||
| ((value: any, field: string) => string);
|
||||
|
||||
export type Spec = {[key: string]: SpecValue }
|
||||
export interface Spec {
|
||||
[key: string]: SpecValue;
|
||||
}
|
||||
|
||||
export type SpecValue =
|
||||
export type SpecValue =
|
||||
| ReadonlyArray<[Predicate, ErrorMsg]>
|
||||
| ((value: any) => any)
|
||||
| Spec
|
||||
| Spec;
|
||||
|
||||
export type Result = {[key: string]: true | Array<string> | Result}
|
||||
export interface Result {
|
||||
[key: string]: true | string[] | Result;
|
||||
}
|
||||
|
||||
export default spected;
|
||||
export default spected;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -16,7 +17,6 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"spected-tests.ts"
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user