From 0254e0068e77f18da583d8144c8747282a344878 Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Wed, 23 Dec 2015 16:18:23 +0200 Subject: [PATCH 1/4] 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; + } +} From 962e0432f162ac1f461799d3d4d9ce9175479c00 Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Wed, 23 Dec 2015 16:18:50 +0200 Subject: [PATCH 2/4] 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-tests.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/debug/debug-tests.ts b/debug/debug-tests.ts index 63a0a3ac4..a26400340 100644 --- a/debug/debug-tests.ts +++ b/debug/debug-tests.ts @@ -1,4 +1,3 @@ -/// /// import debug = require("debug"); @@ -6,7 +5,7 @@ import debug = require("debug"); debug.disable(); debug.enable("DefinitelyTyped:*"); -var log: debug.Debugger = debug("DefinitelyTyped:log"); +var log:debug.IDebugger = debug("DefinitelyTyped:log"); log("Just text"); log("Formatted test (%d arg)", 1); @@ -15,6 +14,6 @@ log("Formatted %s (%d args)", "test", 2); log("Enabled?: %s", debug.enabled("DefinitelyTyped:log")); log("Namespace: %s", log.namespace); -var error: debug.Debugger = debug("DefinitelyTyped:error"); +var error:debug.IDebugger = debug("DefinitelyTyped:error"); error.log = console.error.bind(console); error("This should be printed to stderr"); From 6df499b659e05b286273b0518fa70e4e63f5a3a2 Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Wed, 23 Dec 2015 16:25:21 +0200 Subject: [PATCH 3/4] 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debug/debug.d.ts b/debug/debug.d.ts index aca5bc046..ef750802f 100644 --- a/debug/debug.d.ts +++ b/debug/debug.d.ts @@ -1,7 +1,6 @@ // Type definitions for debug // Project: https://github.com/visionmedia/debug -// Definitions by: Seon-Wook Park -// Definitions by: Gal Talmor +// Definitions by: Seon-Wook Park , Gal Talmor // Definitions: https://github.com/borisyankov/DefinitelyTyped declare var debug:debug.IDebug; From 5ccca9a4efc3d08724ff14ea3a263c7417db0b3d Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Wed, 23 Dec 2015 16:51:51 +0200 Subject: [PATCH 4/4] Update debug.d.ts --- debug/debug.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/debug/debug.d.ts b/debug/debug.d.ts index ef750802f..b43cd238c 100644 --- a/debug/debug.d.ts +++ b/debug/debug.d.ts @@ -3,7 +3,7 @@ // Definitions by: Seon-Wook Park , Gal Talmor // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare var debug:debug.IDebug; +declare var debug: debug.IDebug; // Support AMD require declare module 'debug' { @@ -12,27 +12,27 @@ declare module '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, + (namespace: string): debug.IDebugger, + coerce: (val: any) => any, + disable: () => void, + enable: (namespaces: string) => void, + enabled: (namespaces: string) => boolean, - names:string[], - skips:string[], + names: string[], + skips: string[], - formatters:IFormatters + formatters: IFormatters } export interface IFormatters { - [formatter:string]: Function + [formatter: string]: Function } export interface IDebugger { (formatter: any, ...args: any[]): void; - enabled:boolean; - log:Function; - namespace:string; + enabled: boolean; + log: Function; + namespace: string; } }