import type tsStatic from 'typescript';
import type { CodeSourceSpanV1 } from './types.js';
import type { TreeSitterNode } from './tree-sitter.js';
/**
 * Maps JavaScript UTF-16 source positions to canonical UTF-8 byte offsets.
 * Non-ASCII input gets a per-parse table discarded with the compiler tree;
 * ASCII is already an identity mapping and allocates no table.
 */
export declare class Utf8SourceIndex {
    readonly source: string;
    private readonly byteAtUtf16;
    constructor(source: string);
    byteOffset(utf16Offset: number): number;
}
export declare function typeScriptNodeSpan(sourceFile: tsStatic.SourceFile, sourceIndex: Utf8SourceIndex, node: tsStatic.Node): CodeSourceSpanV1;
export declare function treeSitterNodeSpan(node: TreeSitterNode, sourceIndex: Utf8SourceIndex): CodeSourceSpanV1;
export declare function inexactLineSpan(startLine: number, endLine?: number): CodeSourceSpanV1;
export declare function sliceUtf8Span(source: string, span: CodeSourceSpanV1): string | undefined;
