diy-log
Version:
Various console log level prefixes with support for color symbols and tags.
50 lines (46 loc) • 1.33 kB
TypeScript
import * as picocolors_types from 'picocolors/types';
export { default as colors } from 'picocolors';
import timestamp from 'time-stamp';
export { default as timestamp } from 'time-stamp';
interface Symbols {
info: string;
done: string;
success: string;
warn: string;
error: string;
}
declare const symbols: Symbols;
type LogFunc = (...args: any[]) => void;
declare const log: LogFunc;
declare const time: LogFunc;
declare const info: LogFunc;
declare const error: LogFunc;
declare const done: LogFunc;
declare const warn: LogFunc;
type TagTypeFunc = (message: string, label?: string) => void;
interface ITagTypes {
info: TagTypeFunc;
warn: TagTypeFunc;
done: TagTypeFunc;
error: TagTypeFunc;
success?: TagTypeFunc;
}
interface ITag extends ITagTypes {
(message: string, type?: keyof ITagTypes, label?: string): void;
}
declare const tag: ITag;
declare const _default: {
log: LogFunc;
time: LogFunc;
info: LogFunc;
error: LogFunc;
done: LogFunc;
warn: LogFunc;
symbols: Symbols;
colors: picocolors_types.Colors & {
createColors: (enabled?: boolean | undefined) => picocolors_types.Colors;
};
tag: ITag;
timestamp: typeof timestamp;
};
export { _default as default, done, error, info, log, done as success, symbols, tag, time, warn };