DefinitelyTyped/type-check/type-check.d.ts
2015-05-19 16:29:28 -06:00

34 lines
774 B
TypeScript

// 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/borisyankov/DefinitelyTyped
declare module 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;
}