forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtype-check.d.ts
33 lines (25 loc) · 781 Bytes
/
type-check.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Type definitions for type-check v0.3.1
// Project: https://github.com/gkz/type-check
// Definitions by: Hans Windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace TypeCheck {
export interface CustomType {
[typeName: string]: {
typeOf: string;
validate: (x: any)=> any;
}
}
export interface Options {
customTypes: CustomType;
}
export interface TC{
VERSION: string;
typeCheck: (typeDescription: string , inst: any, options?: Options) => boolean;
parseType: (typeDescription: string) => Object;
parsedTypeCheck: (parsedType: any, obj: any) => boolean;
}
}
declare var typecheck: TypeCheck.TC;
declare module "type-check" {
export=typecheck;
}