UNPKG

logsdx

Version:

<div align="center"><img alt="logsdx" width="300" src="https://github.com/user-attachments/assets/cc2a3b55-5bfd-44e8-a330-bfa146b50059" /></div>

39 lines (38 loc) 2.94 kB
import type { TokenList, Token } from "../schema/types"; import type { Theme } from "../types"; import type { RenderOptions, StyleCode } from "./types"; export declare function isWhitespaceToken(token: Token): boolean; export declare function shouldTrimToken(token: Token): boolean; export declare function handleTrimmedSpaces(token: Token): string; export declare function applyStyleCodes(text: string, styleCodes: ReadonlyArray<StyleCode> | undefined): string; export declare function tokenToString(token: Token, colorSupport: boolean): string; export declare function tokensToString(tokens: TokenList, forceColors?: boolean): string; export declare function handleWhitespaceHtml(token: Token): string; export declare function handleSpecialHtmlTokens(token: Token): string | null; export declare function buildCssStyles(style: NonNullable<Token["metadata"]>["style"], styleCodes: ReadonlyArray<StyleCode> | undefined): ReadonlyArray<string>; export declare function wrapInSpan(content: string, styles: ReadonlyArray<string>): string; export declare function tokenToHtml(token: Token, options: RenderOptions): string; export declare function tokensToHtml(tokens: TokenList, options?: RenderOptions): string; export declare function buildCssClasses(style: NonNullable<Token["metadata"]>["style"], styleCodes: ReadonlyArray<StyleCode> | undefined): ReadonlyArray<string>; export declare function wrapInSpanWithClass(content: string, classes: ReadonlyArray<string>): string; export declare function tokenToClassName(token: Token, options: RenderOptions): string; export declare function tokensToClassNames(tokens: TokenList, options?: RenderOptions): string; export declare function renderLine(line: string, theme?: Theme, options?: RenderOptions): string; export declare function highlightLine(line: string): string; export declare function applyColor(text: string, color: string): string; export declare function applyBold(text: string): string; export declare function applyItalic(text: string): string; export declare function applyUnderline(text: string): string; export declare function applyDim(text: string): string; export declare function applyBackgroundColor(text: string, color: string): string; export declare function fg256(code: number): string; export declare function fgRGB(r: number, g: number, b: number): string; export declare function renderLines(lines: ReadonlyArray<string>, theme?: Theme, options?: RenderOptions): ReadonlyArray<string>; export { renderLightBox, renderLightBoxLine, isLightTheme } from "./lightBox"; export { detectBackground, detectTerminalBackground, detectBrowserBackground, detectSystemBackground, isDarkBackground, isLightBackground, getRecommendedThemeMode, watchBackgroundChanges, } from "./detectBackground"; export type { BackgroundInfo, ColorScheme } from "./types"; declare const _default: { renderLine: typeof renderLine; renderLines: typeof renderLines; }; export default _default;