//#region packages/common/src/utils/swc-span.d.ts /** * SWC span position converter: UTF-8 byte offsets → UTF-16 code unit indices. * * SWC (Rust-based) returns span positions as UTF-8 byte offsets. * JavaScript strings use UTF-16 code units for indexing. * For ASCII-only content these are identical, but for multi-byte * characters the positions diverge. */ type SwcSpanConverter = { /** UTF-8 byte length of the source string */ readonly byteLength: number; /** Convert a UTF-8 byte offset (within the source) to a UTF-16 code unit index */ readonly byteOffsetToCharIndex: (byteOffset: number) => number; }; /** * Create a converter that maps UTF-8 byte offsets to UTF-16 char indices * for the given source string. * * Includes a fast path for ASCII-only sources (zero allocation). */ declare const createSwcSpanConverter: (source: string) => SwcSpanConverter; //#endregion export { createSwcSpanConverter as n, SwcSpanConverter as t }; //# sourceMappingURL=swc-span-C4QReqWr.d.mts.map