From 0254e0068e77f18da583d8144c8747282a344878 Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Wed, 23 Dec 2015 16:18:23 +0200 Subject: [PATCH] Improved visionmedia/debug to include non-amd version Improved visionmedia/debug, a tiny npm package for debugging. Added both AMD and non-AMD definition support --- debug/debug.d.ts | 53 ++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/debug/debug.d.ts b/debug/debug.d.ts index 1a71725a8..aca5bc046 100644 --- a/debug/debug.d.ts +++ b/debug/debug.d.ts @@ -1,30 +1,39 @@ // Type definitions for debug // Project: https://github.com/visionmedia/debug // Definitions by: Seon-Wook Park +// Definitions by: Gal Talmor // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "debug" { - - function d(namespace: string): d.Debugger; - - module d { - export var log: Function; - - function enable(namespaces: string): void; - function disable(): void; - - function enabled(namespace: string): boolean; - - export interface Debugger { - (formatter: any, ...args: any[]): void; - - enabled: boolean; - log: Function; - namespace: string; - } - } - - export = d; +declare var debug:debug.IDebug; +// Support AMD require +declare module 'debug' { + export = debug; } +declare module debug { + export interface IDebug { + (namespace: string):debug.IDebugger, + coerce:(val:any)=>any, + disable:()=>void, + enable:(namespaces:string)=>void, + enabled:(namespaces:string)=>boolean, + + names:string[], + skips:string[], + + formatters:IFormatters + } + + export interface IFormatters { + [formatter:string]: Function + } + + export interface IDebugger { + (formatter: any, ...args: any[]): void; + + enabled:boolean; + log:Function; + namespace:string; + } +}