topkat-utils
Version:
A comprehensive collection of TypeScript/JavaScript utility functions for common programming tasks. Includes validation, object manipulation, date handling, string formatting, and more. Zero dependencies, fully typed, and optimized for performance.
45 lines (44 loc) • 1.53 kB
TypeScript
import { Color } from './types';
export declare type Config = {
env: string;
isProd: boolean;
nbOfLogsToKeep: number;
customTypes: object;
preprocessLog?: Function;
terminal: {
noColor: boolean;
theme: {
primary: Color;
shade1: Color;
shade2: Color;
bgColor?: Color;
paddingX: number;
paddingY: number;
fontColor?: Color;
pageWidth: number;
debugModeColor: Color;
};
};
};
/** Allow dynamic changing of config */
export declare function configFn(): Config;
/** Register custom config
* @param {object} customConfig { 'email': email => /.+@.+/.test(email), type2 : myTestFunction() }
* * env: 'development',
* * customTypes: {},
* * terminal: {
* * noColor: false, // disable colored escape sequences like /mOO35...etc
* * theme: {
* * primary: [61, 167, 32], // main color (title font)
* * shade1: [127, 192, 39], // gradient shade 1
* * shade2: [194, 218, 47], // gradient shade 2
* * bgColor: false, // background color
* * paddingX: 2, // nb spaces added before an outputted str
* * paddingY: 2, //
* * fontColor: false, // default font color
* * pageWidth: 53, // page size in character
* * debugModeColor: [147, 212, 6], // usually orange
* * }
* * },
*/
export declare function registerConfig(customConfig: any): void;