Skip to content

Commit

Permalink
fix: add TypeScript definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoulb authored Nov 5, 2019
1 parent 909d8b2 commit c31b3c7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/exports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Types.
export type BlorkChecker = (value: any) => boolean;

// Errors.
export declare class ValueError extends TypeError {
name: string;
message: string;
value: any;
constructor(message: string, value?: any);
}
export declare class BlorkError extends ValueError {}

// Functions.
export declare function check(value: any, type: string, error?: Function): void;
export declare function checker(type: string): BlorkChecker;
export declare function add(name: string, checker: string | BlorkChecker, description?: string): void;
export declare function debug(value: any): string;

0 comments on commit c31b3c7

Please sign in to comment.