mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-23 21:35:37 +08:00
- extend bunyan in the export instead of augmenting it globally - add tests from the project's README
32 lines
953 B
TypeScript
32 lines
953 B
TypeScript
// Type definitions for browser-bunyan 0.4
|
|
// Project: https://github.com/philmander/browser-bunyan
|
|
// Definitions by: Paul Lockwood <https://github.com/PaulLockwood>
|
|
// Michael Strobel <https://github.com/kryops>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference types="node" />
|
|
|
|
import * as bunyan from 'bunyan';
|
|
|
|
declare namespace BrowserBunyan {
|
|
interface ConsoleFormattedStreamOptions {
|
|
logByLevel?: boolean;
|
|
}
|
|
|
|
interface ConsoleFormattedStream {
|
|
new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream;
|
|
}
|
|
|
|
interface ConsoleRawStream {
|
|
new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream;
|
|
}
|
|
}
|
|
|
|
type BrowserBunyan = typeof bunyan & {
|
|
ConsoleFormattedStream: BrowserBunyan.ConsoleFormattedStream
|
|
ConsoleRawStream: BrowserBunyan.ConsoleRawStream
|
|
};
|
|
|
|
declare const browserBunyan: BrowserBunyan;
|
|
export = browserBunyan;
|