/**
 * @fileoverview String manipulation utilities including ANSI code handling.
 * Provides string processing, prefix application, and terminal output utilities.
 */
import { ansiRegex, stripAnsi } from './ansi';
// Import get-east-asian-width from external wrapper.
// This library implements Unicode Standard Annex #11 (East Asian Width).
// https://www.unicode.org/reports/tr11/
// Re-export ANSI utilities for backward compatibility.
export { ansiRegex, stripAnsi };
// Type definitions
declare const BlankStringBrand: unique symbol;
export type BlankString = string & {
    [BlankStringBrand]: true;
};
declare const EmptyStringBrand: unique symbol;
export type EmptyString = string & {
    [EmptyStringBrand]: true;
};
// IMPORTANT: Do not use destructuring here - use direct assignment instead.
// tsgo has a bug that incorrectly transpiles destructured exports, resulting in
// `exports.SomeName = void 0;` which causes runtime errors.
// See: https://github.com/SocketDev/socket-packageurl-js/issues/3
export declare const fromCharCode: (...codes: number[]) => string;
export interface ApplyLinePrefixOptions {
    prefix?: string;
}
/**
 * Apply a prefix to each line of a string.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function applyLinePrefix(str: string, options?: ApplyLinePrefixOptions | undefined): string;
/**
 * Convert a camelCase string to kebab-case.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function camelToKebab(str: string): string;
export interface IndentStringOptions {
    count?: number;
}
/**
 * Indent each line of a string with spaces.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function indentString(str: string, options?: IndentStringOptions | undefined): string;
/**
 * Check if a value is a blank string (empty or only whitespace).
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function isBlankString(value: unknown): value is BlankString;
/**
 * Check if a value is a non-empty string.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function isNonEmptyString(value: unknown): value is Exclude<string, EmptyString>;
export interface SearchOptions {
    fromIndex?: number;
}
/**
 * Search for a regular expression in a string starting from an index.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function search(str: string, regexp: RegExp, options?: SearchOptions | undefined): number;
/**
 * Strip the Byte Order Mark (BOM) from the beginning of a string.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function stripBom(str: string): string;
/**
 * Get the visual width of a string in terminal columns.
 * Strips ANSI escape codes and accounts for wide characters.
 *
 * Based on string-width:
 * https://socket.dev/npm/package/string-width/overview/7.2.0
 * MIT License
 * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
 *
 * Terminal emulators display characters in a grid of cells (columns).
 * Most ASCII characters take 1 column, but some characters (especially
 * emoji and CJK characters) take 2 columns.
 *
 * This function calculates how many columns a string will occupy when
 * displayed in a terminal, which is crucial for:
 * - Aligning text properly
 * - Preventing text from jumping when characters change
 * - Calculating padding/spacing
 *
 * Logic:
 * - Segment graphemes to match how terminals render clusters.
 * - Width rules:
 *   1. Skip non-printing clusters (Default_Ignorable, Control, pure Mark, lone Surrogates).
 *   2. RGI emoji clusters (\p{RGI_Emoji}) are double-width.
 *   3. Otherwise use East Asian Width of the cluster's first visible code point.
 *   4. Add widths for trailing Halfwidth/Fullwidth Forms within the same cluster.
 *
 * East Asian Width categories (Unicode Standard Annex #11):
 * - F (Fullwidth): 2 columns - e.g., fullwidth Latin letters (Ａ, Ｂ)
 * - W (Wide): 2 columns - e.g., CJK ideographs (漢字), emoji (⚡, 😀)
 * - H (Halfwidth): 1 column - e.g., halfwidth Katakana (ｱ, ｲ)
 * - Na (Narrow): 1 column - e.g., ASCII (a-z, 0-9)
 * - A (Ambiguous): Context-dependent, we treat as 1 column
 * - N (Neutral): 1 column - e.g., most symbols (✦, ✧, ⋆)
 *
 * Why this matters for Socket spinners:
 * - Lightning bolt (⚡) takes 2 columns
 * - Stars (✦, ✧, ⋆) take 1 column
 * - Without compensation, text jumps when frames change
 * - We use this to calculate padding for consistent alignment
 *
 * @example
 * stringWidth('hello') // => 5 (5 ASCII chars = 5 columns)
 * stringWidth('⚡') // => 2 (lightning bolt is wide)
 * stringWidth('✦') // => 1 (star is narrow)
 * stringWidth('\x1b[31mred\x1b[0m') // => 3 (ANSI codes stripped, 'red' = 3)
 *
 * @throws {TypeError} When input is not a string.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function stringWidth(text: string): number;
/**
 * Convert a string to kebab-case (handles camelCase and snake_case).
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function toKebabCase(str: string): string;
/**
 * Trim newlines from the beginning and end of a string.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function trimNewlines(str: string): string;
/**
 * Repeat a string n times.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function repeatString(str: string, count: number): string;
/**
 * Center text within a given width.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function centerText(text: string, width: number): string;
