use serde::{Deserialize, Serialize};

use super::BlockId;

/// A character-range anchor into a block's visible text.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct TextAnchor {
    /// Identifier of the anchored block.
    pub block_id: BlockId,
    /// Start character offset within the block text.
    pub char_start: usize,
    /// End character offset within the block text.
    pub char_end: usize,
}
