/** * Utility class for detecting and identifying Nerd Fonts installed on the system. * Supports Windows, macOS, and Linux platforms. * * Nerd Fonts are patched fonts that include additional glyphs such as icons, * file type symbols, and powerline characters commonly used in terminal applications. * * @example * // Check if any Nerd Fonts are installed * const hasNerd = await Font.hasNerdFonts() * * @example * // Get list of installed Nerd Fonts * const fonts = await Font.findNerdFonts() * console.log(fonts) // ["FiraCode", "JetBrainsMono", ...] */ export default class Font { static #cache: Map; /** * Finds all Nerd Fonts installed on the system. * Detects the current platform and uses platform-specific methods * to locate font files or query the font database. * * @returns {Promise>} Array of Nerd Font family names, or empty array if none found. * @example * const nerdFonts = await Font.findNerdFonts() * console.log(nerdFonts) // ["FiraCode Nerd Font", "JetBrains Mono NF", ...] */ static findNerdFonts(): Promise>; /** * Checks whether any Nerd Fonts are installed on the system. * * @returns {Promise} True if at least one Nerd Font is installed. * @example * if(await Font.hasNerdFonts()) { * console.log("Nerd Fonts available - using fancy icons!") * } */ static hasNerdFonts(): Promise; /** * Gets the base family names of installed Nerd Fonts. * Strips the "NF" or "Nerd Font" suffix to return the core font name. * * @returns {Promise>} Array of base font family names. * @example * const families = await Font.getNerdFontFamilies() * console.log(families) // ["FiraCode", "JetBrains Mono", ...] */ static getNerdFontFamilies(): Promise>; /** * Strips font style suffixes from a font name. * * @param {string} fontName - The font name to clean. * @returns {string} The font name without style suffixes. * @private */ private static #stripStyles; /** * Tests if a font name matches any Nerd Font naming patterns. * * @param {string} fontName - The font name to test. * @param {Array} tests - Array of regex patterns to match against. * @returns {boolean} True if the font name matches any pattern. * @private */ private static #isNerdFontName; /** * Finds Nerd Fonts on Windows by scanning system and user font directories. * * @returns {Promise>} Array of Nerd Font family names. * @private */ private static #findNerdFontsWindows; /** * Finds Nerd Fonts on macOS by scanning system and user font directories. * * @returns {Promise>} Array of Nerd Font family names. * @private */ private static #findNerdFontsMac; /** * Finds Nerd Fonts on Linux using the fc-list command. * * @returns {Promise>} Array of Nerd Font family names. * @private */ private static #findNerdFontsLinux; /** @type {Array} Patterns to identify Nerd Fonts by filename */ static #nerdTests: Array; /** @type {Array} Patterns to identify Nerd Fonts in fc-list output */ static #nerdTestsLinux: Array; /** * Identifies Nerd Fonts from a list of font file objects. * * @param {Array} fileObjects - Array of FileObject instances representing font files. * @returns {Array} Sorted array of unique Nerd Font family names. * @private */ private static #identifyNerdFonts; /** * Gets spinner animation frames appropriate for the current font environment. * Returns Unicode braille characters if Nerd Fonts are available, * otherwise returns ASCII fallback characters. * * @returns {Promise>} Promise resolving to array of spinner frame characters. * @example * const frames = await Font.spinFrames * // With Nerd Fonts: ["⠋", "⠙", "⠹", ...] * // Without: ["|", "/", "-", "\\"] */ static get spinFrames(): Promise>; } //# sourceMappingURL=Font.d.ts.map