/** * Copyright 2026 - present Nazmul Hassan * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { _ as Hex } from "../Color-dKkfOam0.mjs"; import { a as AnsiSequence, n as Stylog, o as BGColor, t as LogStyler, u as TextStyle } from "../Stylog-DZ4KOg7X.mjs"; //#region src/stylog/utils.d.ts /** * * Detects color support level of the current terminal/shell. * @returns `0 = none`, `1 = basic (16 colors)`, `2 = 256 colors`, `3 = truecolor` */ declare function detectColorSupport(): 0 | 1 | 2 | 3; /** * * Convert `RGB` color components into an `ANSI` escape code sequence. * * @param r Red component (`0-255`). * @param g Green component (`0-255`). * @param b Blue component (`0-255`). * @param isBg Whether the color should be applied as background (`true`) or foreground (`false`). Defaults to `false`. * @returns Tuple containing the opening and closing `ANSI` escape sequences. */ declare function rgbToAnsi(r: number, g: number, b: number, isBg?: boolean): AnsiSequence; /** * * Convert a HEX color into an `ANSI` escape code sequence. * * @param hex HEX color string. e.g. `#000000` * @param isBg Whether the color should be applied as background (`true`) or foreground (`false`). Defaults to `false`. * @returns Tuple containing the opening and closing `ANSI` escape sequences. */ declare function hexToAnsi(hex: Hex, isBg?: boolean): AnsiSequence; /** * Check if a string represents `bgColor` with valid CSS color name. */ declare function isBGColor(value: string): value is BGColor; /** * Check if a string represent `TextStyle` used in `LogStyler`. */ declare function isTextStyle(value: string): value is TextStyle; //#endregion export { LogStyler, Stylog, detectColorSupport, hexToAnsi, isBGColor, isTextStyle, rgbToAnsi };