import { Token, TokenType, Item, Items } from './tokens.js'; import { Pos } from './position.js'; import { SpanInfo } from './span.js'; export interface SourceMap { version: 3; file?: string; sourceRoot?: string; sources: Array; sourcesContent?: Array; names: Array; mappings: string; } export interface NoSourceMapping { generatedStartColumn: number; } export interface SourceMapping extends NoSourceMapping { sourceIndex: number; sourceStartLine: number; sourceStartColumn: number; } export interface SourceNameMapping extends SourceMapping { nameIndex: number; } export type NonEmptyMapping = NoSourceMapping | SourceMapping | SourceNameMapping; export type Mapping = {} | NonEmptyMapping; export declare class CodeWriter { readonly file: string | null; readonly pos: Pos; readonly sources: Array; readonly chunks: Array; readonly mappings: Array>; readonly targetToSourceMap: SpanInfo; readonly sourceToTargetMap: SpanInfo; previous: Partial; previousPos: Pos | null; constructor(file: string | null); get text(): string; get map(): SourceMap; finishLine(): void; sourceIndexFor(name: string): number; addMapping(p: Pos, type: TokenType): void; chunk(p: Pos, s: string, type: TokenType): void; emit(i: Item | Items): void; }