import * as ts from "typescript"; import { Project } from "./project"; export declare class SourceFile { constructor(filename: string, sourceText: string); readonly filename: string; readonly sourceText: string; readonly source: ts.SourceFile; private readonly _componentNames; private _lineMap; private _fragmentMap; private _fragments; static isSourceFile(filename: string): boolean; ids(): Set; verify(context: SourceFile.VerifyContext): boolean; get fragmentsById(): ReadonlyMap; get fragments(): SourceFile.Fragment[]; fragmentAt(offset: number): SourceFile.Fragment | undefined; fragmentsAt(start: number, end: number): SourceFile.Fragment[]; update(context: SourceFile.UpdateContext): SourceFile.UpdateResult; get lineMap(): number[]; positionToOffset(pos: SourceFile.Position): number; offsetToPosition(offset: number): SourceFile.Position | undefined; } export declare namespace SourceFile { interface VerifyContext { verifyPair(id: string, value: string | undefined): boolean; } interface Position { readonly line: number; readonly character: number; } interface Fragment { readonly id: string; readonly start: number; readonly end: number; } interface UpdateContext { updateId(id?: string): string; } interface UpdateResult { readonly changed: boolean; readonly sourceText: string; readonly fragments: Map; } namespace UpdateResult { interface Fragment { readonly value?: Project.Value; readonly oldId?: string; } } }