/** * @file ANSI escape-code regex factory and stripping helper. Provides * `ansiRegex()` for matching CSI/OSC sequences and `stripAnsi()` for removing * ANSI formatting from terminal output. */ /** * Create a regular expression for matching ANSI escape codes. * * Inlined ansi-regex: https://socket.dev/npm/package/ansi-regexp/overview/6.2.2 * MIT License Copyright (c) Sindre Sorhus * [sindresorhus@gmail.com](mailto:sindresorhus@gmail.com) * (https://sindresorhus.com) * * @example * ;```typescript * const regex = ansiRegex() * '\u001b[31mHello\u001b[0m'.match(regex) // ['\u001b[31m', '\u001b[0m'] * ansiRegex({ onlyFirst: true }) // matches only the first code * ``` */ export declare function ansiRegex(options?: { onlyFirst?: boolean | undefined; } | undefined): RegExp; /** * Strip ANSI escape codes from text. Uses the inlined ansi-regex for matching. * * @example * ;```typescript * stripAnsi('\u001b[31mError\u001b[0m') // 'Error' * stripAnsi('\u001b[1mBold\u001b[0m') // 'Bold' * ``` */ export declare function stripAnsi(text: string): string;