From c31b3c7ac647b578fdbb69e53000ed652e937bec Mon Sep 17 00:00:00 2001 From: Dave Houlbrooke Date: Tue, 5 Nov 2019 16:38:53 +0000 Subject: [PATCH] fix: add TypeScript definitions --- lib/exports.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/exports.d.ts diff --git a/lib/exports.d.ts b/lib/exports.d.ts new file mode 100644 index 0000000..e54082a --- /dev/null +++ b/lib/exports.d.ts @@ -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;