@intlayer/config
Version:
Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.
64 lines (63 loc) • 2.73 kB
TypeScript
import { CustomIntlayerConfig, Locale } from "@intlayer/types";
//#region src/logger.d.ts
type Details = {
isVerbose?: boolean;
level?: 'info' | 'warn' | 'error' | 'debug';
config?: CustomIntlayerConfig['log'];
};
type Logger = (content: any, details?: Details) => void;
declare const logger: Logger;
declare enum ANSIColors {
RESET = "\u001B[0m",
GREY = "\u001B[90m",
GREY_DARK = "\u001B[38;5;239m",
GREY_LIGHT = "\u001B[38;5;252m",
BLUE = "\u001B[34m",
RED = "\u001B[31m",
GREEN = "\u001B[32m",
YELLOW = "\u001B[38;5;226m",
MAGENTA = "\u001B[35m",
BEIGE = "\u001B[38;5;3m",
ORANGE = "\u001B[38;5;208m",
CYAN = "\u001B[36m",
WHITE = "\u001B[37m",
BOLD = "\u001B[1m",
}
declare const spinnerFrames: string[];
/**
* The appLogger function takes the logger and merges it with the configuration from the intlayer config file.
* It allows overriding the default configuration by passing a config object in the details parameter.
* The configuration is merged with the default configuration from the intlayer config file.
*/
declare const getAppLogger: (configuration?: CustomIntlayerConfig, globalDetails?: Details) => (content: any, details?: Details) => void;
declare const colorize: (s: string, color?: ANSIColors, reset?: boolean | ANSIColors) => string;
declare const colorizeLocales: (locales: Locale | Locale[], color?: ANSIColors, reset?: boolean | ANSIColors) => string;
declare const colorizeKey: (keyPath: string | string[], color?: ANSIColors, reset?: boolean | ANSIColors) => string;
declare const colorizePath: (path: string | string[], color?: ANSIColors, reset?: boolean | ANSIColors) => string;
/**
* Colorize numeric value using Intl.NumberFormat and optional ANSI colors.
*
* Examples:
* colorizeNumber(2, [{ pluralRule: 'one' , color: ANSIColors.GREEN}, { pluralRule: 'other' , color: ANSIColors.RED}]) // "'\x1b[31m2\x1b[0m"
*/
declare const colorizeNumber: (number: number, options?: Partial<Record<Intl.LDMLPluralRule, ANSIColors>>) => string;
declare const removeColor: (text: string) => string;
/**
* Create a string of spaces of a given length.
*
* @param colSize - The length of the string to create.
* @returns A string of spaces.
*/
declare const colon: (text: string | string[], options?: {
colSize?: number | number[] | string | string[];
minSize?: number;
maxSize?: number;
pad?: "left" | "right";
padChar?: string;
}) => string;
declare const x: string;
declare const v: string;
declare const clock: string;
//#endregion
export { ANSIColors, Details, Logger, clock, colon, colorize, colorizeKey, colorizeLocales, colorizeNumber, colorizePath, getAppLogger, logger, removeColor, spinnerFrames, v, x };
//# sourceMappingURL=logger.d.ts.map