Add exports

This commit is contained in:
Fabian Stamm 2021-05-08 22:24:00 +02:00
parent 6daf815ea8
commit eeed068ddd
5 changed files with 21 additions and 18 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "logging", "name": "logging",
"version": "3.0.3", "version": "3.0.4",
"description": "", "description": "",
"author": "Fabian Stamm <dev@fabianstamm.de>", "author": "Fabian Stamm <dev@fabianstamm.de>",
"contributors": [], "contributors": [],

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/logging", "name": "@hibas123/logging",
"version": "3.0.3", "version": "3.0.4",
"description": "", "description": "",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",

View File

@ -6,28 +6,13 @@ import {
Format, Format,
FormatConfig, FormatConfig,
Formatted, Formatted,
ILoggingInterface,
LoggingTypes, LoggingTypes,
Message, Message,
} from "./types.js"; } from "./types.js";
const browser = typeof window !== "undefined"; const browser = typeof window !== "undefined";
export interface ILoggingTimer {
end: () => number;
}
export interface ILoggingInterface {
debug(...message: any[]): void;
log(...message: any[]): void;
warn(...message: any[]): void;
error(...message: any[]): void;
time(name?: string): ILoggingTimer;
timeEnd(id: string): number;
getChild(name: string): ILoggingInterface;
}
export interface ILoggingOptions { export interface ILoggingOptions {
/** /**
* Name will be prefixed on Console output and added to logfiles, if not specified here * Name will be prefixed on Console output and added to logfiles, if not specified here

View File

@ -14,6 +14,8 @@ export {
TerminalFormats, TerminalFormats,
Formatted, Formatted,
IFormatted, IFormatted,
ILoggingInterface,
ILoggingTimer,
} from "./types.js"; } from "./types.js";
const Logging = new LoggingBase(); const Logging = new LoggingBase();

View File

@ -234,3 +234,19 @@ export interface Adapter {
*/ */
close?(): void; close?(): void;
} }
export interface ILoggingTimer {
end: () => number;
}
export interface ILoggingInterface {
debug(...message: any[]): void;
log(...message: any[]): void;
warn(...message: any[]): void;
error(...message: any[]): void;
time(name?: string): ILoggingTimer;
timeEnd(id: string): number;
getChild(name: string): ILoggingInterface;
}