1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | declare namespace TypeCheck {
|
8 |
|
9 | export interface CustomType {
|
10 | [typeName: string]: {
|
11 | typeOf: string;
|
12 | validate: (x: any)=> any;
|
13 | }
|
14 | }
|
15 |
|
16 | export interface Options {
|
17 | customTypes: CustomType;
|
18 | }
|
19 |
|
20 | export interface TC{
|
21 | VERSION: string;
|
22 | typeCheck: (typeDescription: string , inst: any, options?: Options) => boolean;
|
23 | parseType: (typeDescription: string) => Object;
|
24 | parsedTypeCheck: (parsedType: any, obj: any) => boolean;
|
25 |
|
26 | }
|
27 | }
|
28 |
|
29 | declare var typecheck: TypeCheck.TC;
|
30 |
|
31 | declare module "type-check" {
|
32 | export=typecheck;
|
33 | }
|