From dbb2bb1731fc4830340398509d594e7013d663cd Mon Sep 17 00:00:00 2001 From: Ashley Abbott Date: Fri, 15 Nov 2019 19:24:24 -0500 Subject: [PATCH] bunyan-format: Add merged function declaration to support calling default export as a function (#40257) * Add merged function declaration to support calling as a function Signed-off-by: Ashley Abbott * Add tests for function call Signed-off-by: Ashley Abbott * Add contributor and set Typescript Version to 3.6 Signed-off-by: Ashley Abbott * Missing line ending for tests.ts Signed-off-by: Ashley Abbott * Update library version number Signed-off-by: Ashley Abbott * Removing patch version from index.d.ts to satisfy Jenkins constraints Signed-off-by: Ashley Abbott --- types/bunyan-format/bunyan-format-tests.ts | 4 ++++ types/bunyan-format/index.d.ts | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/bunyan-format/bunyan-format-tests.ts b/types/bunyan-format/bunyan-format-tests.ts index 3f4c2a658d..159c3cde17 100644 --- a/types/bunyan-format/bunyan-format-tests.ts +++ b/types/bunyan-format/bunyan-format-tests.ts @@ -3,3 +3,7 @@ import BunyanFormatWritable = require('bunyan-format'); const formatOut = new BunyanFormatWritable({ outputMode: 'short' }); const formatOut2 = new BunyanFormatWritable({ outputMode: 'bunyan', levelInString: true }); + +const formatOut3 = BunyanFormatWritable({ outputMode: 'short' }); + +const formatOut4 = BunyanFormatWritable({ outputMode: 'bunyan', levelInString: true }); diff --git a/types/bunyan-format/index.d.ts b/types/bunyan-format/index.d.ts index 06a37ba2e5..867e724785 100644 --- a/types/bunyan-format/index.d.ts +++ b/types/bunyan-format/index.d.ts @@ -1,8 +1,9 @@ // Type definitions for bunyan-format 0.2 // Project: https://github.com/thlorenz/bunyan-format // Definitions by: Piotr Roszatycki +// Ashley Abbott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 3.6 /// @@ -27,4 +28,6 @@ declare class BunyanFormatWritable extends Writable { constructor(options: BunyanFormatWritable.Options, output?: Writable); } +declare function BunyanFormatWritable(options: BunyanFormatWritable.Options, output?: Writable): BunyanFormatWritable; + export = BunyanFormatWritable;