/**
 * Code-context scanning shared by the chat chip pipeline and the server-side
 * reference parser. Both need to know which character ranges of a markdown
 * string the reader treats as code (fenced blocks + inline code spans), so that
 * XML reference tags appearing inside code — i.e. deliberate syntax examples —
 * are NOT treated as real references.
 *
 * Pure string functions (no DOM, no Node-only APIs); compiled into both the
 * client and server builds via `src/shared`.
 *
 * Known gap: 4-space indented code blocks are NOT detected (rare in agent
 * output and on spec pages, which use fences/inline). markdown-it does detect
 * them, so the editor render path diverges here; closeable later if needed.
 */
export type CodeRange = [start: number, end: number];
export interface InlineCodeSpan {
    start: number;
    end: number;
    innerStart: number;
    innerEnd: number;
}
/**
 * Scan fenced code blocks (``` / ~~~), returning the fenced ranges and the
 * gaps between them. An unclosed fence extends to end-of-string — matching how
 * react-markdown parses a mid-stream message (everything after an open fence is
 * code until it closes), so the streaming-transient case shows the raw tag.
 *
 * Tilde fences are handled; tildes never start inline code.
 */
export declare function scanFences(text: string): {
    fenced: CodeRange[];
    gaps: CodeRange[];
};
/**
 * Inline code spans within the given (non-fenced) gaps. A run of N backticks
 * opens; the next run of exactly N backticks closes. Unmatched runs are literal
 * text, not code.
 */
export declare function findInlineCodeSpans(text: string, gaps: CodeRange[]): InlineCodeSpan[];
/**
 * Char ranges markdown treats as code (fenced blocks + inline code spans), so
 * callers can leave tags inside them untouched.
 */
export declare function computeCodeRanges(text: string): CodeRange[];
/** True when [start, end) overlaps any of the (sorted) code ranges. */
export declare function intersectsCode(start: number, end: number, ranges: CodeRange[]): boolean;
