/********************************************************************************
 * Copyright (c) 2020-2026 EclipseSource and others.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * This Source Code may also be made available under the following Secondary
 * Licenses when the conditions for such availability set forth in the Eclipse
 * Public License v. 2.0 are satisfied: GNU General Public License, version 2
 * with the GNU Classpath Exception which is available at
 * https://www.gnu.org/software/classpath/license.html.
 *
 * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
 ********************************************************************************/
import { ExternalMarkerManager, Marker } from '@eclipse-glsp/client/lib';
import { Disposable, DisposableCollection, URI } from '@theia/core';
import { Container } from '@theia/core/shared/inversify';
import { ProblemManager } from '@theia/markers/lib/browser/problem/problem-manager';
import { Diagnostic } from 'vscode-languageserver-types';
import { ApplicationShell, Widget } from '@theia/core/lib/browser';
export declare const TheiaMarkerManagerFactory: unique symbol;
export declare function connectTheiaMarkerManager(container: Container, markerManagerFactory: () => ExternalMarkerManager, languageLabel: string): void;
type ValidationMarker = Marker & {
    reason?: string;
};
declare class DiagnosticMarkers {
    protected diagnostic2marker: Map<Diagnostic, ValidationMarker>;
    get size(): number;
    all(): IterableIterator<ValidationMarker>;
    marker(diagnostic: Diagnostic): ValidationMarker | undefined;
    add(diagnostic: Diagnostic, marker: ValidationMarker): Map<Diagnostic, ValidationMarker>;
    getMarkerByOrigin(origin?: string): ValidationMarker[];
    getByOrigin(origin?: string): Diagnostic[];
    deleteByOrigin(origin?: string): void;
    delete(diagnostic: Diagnostic): boolean;
    clear(): void;
}
export declare class TheiaMarkerManager extends ExternalMarkerManager implements Disposable {
    protected markerReasonsToKeep: "live"[];
    protected readonly problemManager?: ProblemManager;
    protected readonly shell?: ApplicationShell;
    protected uri2markers: Map<string, DiagnosticMarkers>;
    protected toDispose: DisposableCollection;
    protected markers(uri: URI): DiagnosticMarkers;
    protected initialize(): void;
    protected refreshMarker(uri: URI): Promise<void>;
    setMarkers(markers: Marker[], reason?: string, sourceUri?: string): void;
    protected createDiagnostic(uri: URI, marker: Marker, origin?: string): Diagnostic;
    protected toSeverity(kind: string): 1 | 2 | 3 | 4 | undefined;
    dispose(): void;
    protected handleWidgetClose(widget: Widget): void;
    protected clearMarkers(uri: URI, exceptThoseWithReasons: string[]): void;
}
export {};
//# sourceMappingURL=theia-marker-manager.d.ts.map