DefinitelyTyped/types/console-log-level/index.d.ts
Ali Ijaz Sheikh 045d74baf3 [console-log-level] initial types (#27506)
* [console-log-level] initial types

* [squash] address review feedback

* [squash] export more types in namespace
2018-07-24 10:19:59 -07:00

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;