mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* [console-log-level] initial types * [squash] address review feedback * [squash] export more types in namespace
24 lines
734 B
TypeScript
24 lines
734 B
TypeScript
// Type definitions for console-log-level 1.4
|
|
// Project: https://github.com/watson/console-log-level
|
|
// Definitions by: Ali Ijaz Sheikh <https://github.com/ofrobots>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.1
|
|
|
|
type PrefixFunction = (level: string) => string;
|
|
|
|
declare namespace consoleLogLevel {
|
|
type LogLevelNames =
|
|
"trace" | "debug" | "info" | "warn" | "error" | "fatal";
|
|
type Logger = Record<LogLevelNames, (...args: any[]) => void>;
|
|
}
|
|
|
|
interface Options {
|
|
level?: consoleLogLevel.LogLevelNames;
|
|
prefix?: string | PrefixFunction;
|
|
stderr?: boolean;
|
|
}
|
|
|
|
declare function consoleLogLevel(opts: Options): consoleLogLevel.Logger;
|
|
|
|
export = consoleLogLevel;
|