mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for spected 0.26
|
||||
// Project: https://github.com/25th-floor/spected
|
||||
// Definitions by: Benjamin Makus <https://github.com/benneq>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
declare var spected: Spected;
|
||||
|
||||
export type Spected = (spec: Spec, input: any) => Result;
|
||||
|
||||
export type Predicate = (value: any, inputs: any) => boolean;
|
||||
|
||||
export type ErrorMsg =
|
||||
| string
|
||||
| ((value: any, field: string) => string);
|
||||
|
||||
export interface Spec {
|
||||
[key: string]: SpecValue;
|
||||
}
|
||||
|
||||
export type SpecValue =
|
||||
| ReadonlyArray<[Predicate, ErrorMsg]>
|
||||
| ((value: any) => any)
|
||||
| Spec;
|
||||
|
||||
export interface Result {
|
||||
[key: string]: true | string[] | Result;
|
||||
}
|
||||
|
||||
export default spected;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user