import chalk , { Chalk } from "chalk" ; author CaMnter
  export const red = chalk . hex ( '#C13928' ) ; export const cyan = chalk . hex ( '#6AC2CC' ) ; export const gray = chalk . hex ( '#6F7783' ) ; export const white = chalk . hex ( '#FFFFFF' ) ; export const green = chalk . hex ( '#007F00' ) ; export const orange = chalk . hex ( '#DAAA7C' ) ; export const yellow = chalk . hex ( '#ECEA38' ) ; export const magenta = chalk . hex ( '#D192E2' ) ; enum LogType { info , warn , error } param logType param chalk param text export function main ( logType , chalk , ... text ) { const themeText = text . map ( ( value ) => { return chalk ( value ) ; } ) ; console . log ( getLogTitle ( logType ) , ... themeText ) ; } param logType export function getLogTitle ( logType ) { let title ; switch ( logType ) { default : case LogType . info : title = gray ( '[info]' ) ; break ; case LogType . warn : title = orange ( '[warn]' ) ; break ; case LogType . error : title = red ( '[error]' ) ; break ; } return title ; } param chalk param text export function info ( chalk , ... text ) { main ( LogType . info , chalk , ... text ) ; } param chalk param text export function warn ( chalk , ... text ) { main ( LogType . warn , chalk , ... text ) ; } param chalk param text export function error ( chalk , ... text ) { main ( LogType . error , chalk , ... text ) ; } param logType param any function mainAny ( logType , ... any ) { console . log ( getLogTitle ( logType ) , any ) ; } param any export function infoAny ( ... any ) { mainAny ( LogType . info , ... any ) ; } param any export function warnAny ( ... any ) { mainAny ( LogType . warn , ... any ) ; } param any export function errorAny ( ... any ) { mainAny ( LogType . error , ... any ) ; }