/** One half-open source range; omitted ranges also own insertions at both boundaries. */ type SourceRange = Readonly<{ start: number; end: number; }>; /** * Collects range edits, then compiles one immutable, source-ordered plan for every rendered view. * * Final Mini Program development chunks do not request source maps. Hoisted functions and the remaining module body * are disjoint views of the same plan, rather than repeated scans/sorts followed by destructive function removals. * * For E edits and F hoisted functions, compilation costs O(E log E) plus insertion text assembly. Each view uses binary * searches followed by forward-only cursors over its edits. Rendering all functions and the remaining body costs * O(E + F log E + output characters); views never scan the complete insertion journal per replacement or function. * Storage is O(E + inserted text) plus rendered output, owned by this compilation only. */ export declare class StringEditor { #private; readonly original: string; constructor(original: string); /** Records a replacement, including empty replacements for removed import declarations. */ overwrite(start: number, end: number, content: string): void; /** Records prepend order in O(1), avoiding unshift's repeated movement of earlier insertions. */ prependLeft(position: number, content: string): void; appendLeft(position: number, content: string): void; /** Matches the subset of appendRight ordering used by the capsule compiler. */ appendRight(position: number, content: string): void; /** Sorts once after semantic edits finish; all function/body views share this immutable snapshot. */ compile(): { /** Includes boundary insertions so relocated functions keep every edit they own. */ render: (start: number, end: number) => string; /** Ranges must be disjoint and in source order, as direct Program function declarations are. */ renderOutside: (ranges: readonly SourceRange[]) => string; }; } export {};