UNPKG

781 BTypeScriptView Raw
1// Type definitions for type-check v0.3.1
2// Project: https://github.com/gkz/type-check
3// Definitions by: Hans Windhoff <https://github.com/hansrwindhoff>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6
7declare 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
29declare var typecheck: TypeCheck.TC;
30
31declare module "type-check" {
32 export=typecheck;
33}