inkferro-core 0.1.0

Layout, text measurement, ANSI render, and frame-diff engine for inkferro — a Rust-backed, byte-for-byte drop-in for the ink terminal UI library.
Documentation
//! Port of [`@alcalzone/ansi-tokenize@0.3.0`](https://github.com/AlCalzone/ansi-tokenize)
//! to Rust.
//!
//! # Overview
//!
//! This module tokenizes ANSI-escaped terminal strings into a stream of typed
//! [`Token`]s and provides utilities to manipulate accumulated ANSI style state.
//!
//! # Quick start
//!
//! ```
//! use inkferro_core::text::ansi_tokenize::{
//!     tokenize, styled_chars_from_tokens, styled_chars_to_string,
//! };
//!
//! let tokens = tokenize("\x1B[31mhello\x1B[0m", None);
//! let styled = styled_chars_from_tokens(&tokens);
//! let out = styled_chars_to_string(&styled);
//! // `out` is semantically equivalent to the input (normalized form)
//! ```

mod ansi_codes;
mod consts;
mod diff;
mod reduce;
mod styled_chars;
mod tokenize;
mod types;
mod undo;

// ─── Public re-exports ────────────────────────────────────────────────────────

pub use diff::diff_ansi_codes;
pub use reduce::{reduce_ansi_codes, reduce_ansi_codes_incremental};
pub(crate) use styled_chars::{styled_chars_from_plain, styled_chars_to_string_into};
pub use styled_chars::{styled_chars_from_tokens, styled_chars_to_string};
pub use tokenize::tokenize;
pub use types::{AnsiToken, CharToken, ControlToken, StyledChar, Token, empty_styles};
pub use undo::undo_ansi_codes;