import { Disposable } from '../../../util/vs/base/common/lifecycle';
import { IObservable, IObservableWithChange, ISettableObservable, ITransaction } from '../../../util/vs/base/common/observableInternal';
import { URI } from '../../../util/vs/base/common/uri';
import { StringEdit } from '../../../util/vs/editor/common/core/edits/stringEdit';
import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange';
import { StringText } from '../../../util/vs/editor/common/core/text/abstractText';
import { DiagnosticData } from './dataTypes/diagnosticData';
import { DocumentId } from './dataTypes/documentId';
import { LanguageId } from './dataTypes/languageId';
import { EditReason } from './editReason';
export declare abstract class ObservableWorkspace {
    abstract get openDocuments(): IObservableWithChange<readonly IObservableDocument[], {
        added: readonly IObservableDocument[];
        removed: readonly IObservableDocument[];
    }>;
    abstract getWorkspaceRoot(documentId: DocumentId): URI | undefined;
    getFirstOpenDocument(): IObservableDocument | undefined;
    getDocument(documentId: DocumentId): IObservableDocument | undefined;
    private _version;
    /**
     * Is fired when any open document changes.
    */
    readonly onDidOpenDocumentChange: IObservableWithChange<number, unknown>;
    readonly lastActiveDocument: IObservable<IObservableDocument | undefined>;
}
export interface IObservableDocument {
    readonly id: DocumentId;
    readonly value: IObservableWithChange<StringText, StringEditWithReason>;
    /**
     * Increases whenever the value changes. Is also used to reference document states from the past.
    */
    readonly version: IObservable<number>;
    /**
     * `selection` is an array because of `multi-cursor` support.
     */
    readonly selection: IObservable<readonly OffsetRange[]>;
    /**
     * 0-based line number of the primary cursor.
     */
    readonly primarySelectionLine: IObservable<number | undefined>;
    readonly visibleRanges: IObservable<readonly OffsetRange[]>;
    readonly languageId: IObservable<LanguageId>;
    readonly diagnostics: IObservable<readonly DiagnosticData[]>;
}
export declare class StringEditWithReason extends StringEdit {
    readonly reason: EditReason;
    constructor(replacements: StringEdit['replacements'], reason: EditReason);
}
export declare class MutableObservableWorkspace extends ObservableWorkspace {
    private readonly _openDocuments;
    readonly openDocuments: ISettableObservable<readonly IObservableDocument[], {
        added: readonly IObservableDocument[];
        removed: readonly IObservableDocument[];
    }>;
    private readonly _documents;
    /**
     * Dispose to remove.
    */
    addDocument(options: {
        id: DocumentId;
        workspaceRoot?: URI;
        initialValue?: string;
        initialVersionId?: number;
        languageId?: LanguageId;
    }, tx?: ITransaction | undefined): MutableObservableDocument;
    getDocument(id: DocumentId): MutableObservableDocument | undefined;
    clear(): void;
    getWorkspaceRoot(documentId: DocumentId): URI | undefined;
}
export declare class MutableObservableDocument extends Disposable implements IObservableDocument {
    readonly id: DocumentId;
    readonly workspaceRoot: URI | undefined;
    private readonly _value;
    get value(): IObservableWithChange<StringText, StringEditWithReason>;
    private readonly _selection;
    get selection(): IObservable<readonly OffsetRange[]>;
    private readonly _primarySelectionLine;
    get primarySelectionLine(): IObservable<number | undefined>;
    private readonly _visibleRanges;
    get visibleRanges(): IObservable<readonly OffsetRange[]>;
    private readonly _languageId;
    get languageId(): IObservable<LanguageId>;
    private readonly _version;
    get version(): IObservable<number>;
    private readonly _diagnostics;
    get diagnostics(): IObservable<readonly DiagnosticData[]>;
    constructor(id: DocumentId, value: StringText, selection: readonly OffsetRange[], languageId: LanguageId, onDispose: () => void, versionId: number, workspaceRoot: URI | undefined);
    setSelection(selection: readonly OffsetRange[], tx?: ITransaction | undefined, primaryLine?: number): void;
    setVisibleRange(visibleRanges: readonly OffsetRange[], tx?: ITransaction | undefined): void;
    applyEdit(edit: StringEdit | StringEditWithReason, tx?: ITransaction | undefined, newVersion?: number | undefined): void;
    updateSelection(selection: readonly OffsetRange[], tx?: ITransaction | undefined, primaryLine?: number): void;
    setValue(value: StringText, tx?: ITransaction | undefined, newVersion?: number | undefined): void;
    updateDiagnostics(diagnostics: readonly DiagnosticData[], tx?: ITransaction | undefined): void;
}
//# sourceMappingURL=observableWorkspace.d.ts.map