import { Event } from '../../../../../base/common/event.js';
import { Terminal, ITheme } from '@xterm/xterm';
import { ISearchOptions, SearchAddon } from '@xterm/addon-search';
import { Unicode11Addon } from '@xterm/addon-unicode11';
import { WebglAddon } from '@xterm/addon-webgl';
import { SerializeAddon } from '@xterm/addon-serialize';
import { ImageAddon } from '@xterm/addon-image';
import { ClipboardAddon } from '@xterm/addon-clipboard';
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
import { Disposable } from '../../../../../base/common/lifecycle.js';
import { IShellIntegration } from '../../../../../platform/terminal/common/terminal.js';
import { ITerminalLogService } from '../../../../../platform/terminal/common/terminal.service.js';
import { ITerminalFont } from '../../common/terminal.js';
import { IXtermTerminal, IDetachedXtermTerminal, IInternalXtermTerminal, IMarkTracker, IXtermColorProvider, IXtermAttachToElementOptions } from '../terminal.js';
import { ITerminalConfigurationService } from '../terminal.service.js';
import { INotificationService } from '../../../../../platform/notification/common/notification.service.js';
import { ScrollPosition } from './markNavigationAddon.js';
import { IColorTheme } from '../../../../../platform/theme/common/themeService.js';
import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
import { ITerminalCommand, ITerminalCapabilityStore } from '../../../../../platform/terminal/common/capabilities/capabilities.js';
import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.service.js';
import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.service.js';
import { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.service.js';
import { ILayoutService } from '../../../../../platform/layout/browser/layoutService.service.js';
import { IAccessibilitySignalService } from '../../../../../platform/accessibilitySignal/browser/accessibilitySignalService.service.js';

/**
 * Wraps the xterm object with additional functionality. Interaction with the backing process is out
 * of the scope of this class.
 */
declare class XtermTerminal extends Disposable implements IXtermTerminal, IDetachedXtermTerminal, IInternalXtermTerminal {
    private readonly _xtermColorProvider;
    private readonly _capabilities;
    private readonly _configurationService;
    private readonly _instantiationService;
    private readonly _logService;
    private readonly _notificationService;
    private readonly _themeService;
    private readonly _telemetryService;
    private readonly _terminalConfigurationService;
    private readonly _clipboardService;
    private readonly _accessibilitySignalService;
    /** The raw xterm.js instance */
    readonly raw: Terminal;
    private _core;
    private static _suggestedRendererType;
    private static _checkedWebglCompatible;
    private _attached?;
    private _isPhysicalMouseWheel;
    private _markNavigationAddon;
    private _shellIntegrationAddon;
    private _decorationAddon;
    private _clipboardAddon?;
    private _searchAddon?;
    private _unicode11Addon?;
    private _webglAddon?;
    private _serializeAddon?;
    private _imageAddon?;
    private readonly _attachedDisposables;
    private readonly _anyTerminalFocusContextKey;
    private readonly _anyFocusedTerminalHasSelection;
    private _lastFindResult;
    get findResult(): {
        resultIndex: number;
        resultCount: number;
    } | undefined;
    get isStdinDisabled(): boolean;
    get isGpuAccelerated(): boolean;
    private readonly _onDidRequestRunCommand;
    readonly onDidRequestRunCommand: Event<{
        command: ITerminalCommand;
        copyAsHtml?: boolean;
        noNewLine?: boolean;
    }>;
    private readonly _onDidRequestFocus;
    readonly onDidRequestFocus: Event<void>;
    private readonly _onDidRequestSendText;
    readonly onDidRequestSendText: Event<string>;
    private readonly _onDidRequestFreePort;
    readonly onDidRequestFreePort: Event<string>;
    private readonly _onDidChangeFindResults;
    readonly onDidChangeFindResults: Event<{
        resultIndex: number;
        resultCount: number;
    }>;
    private readonly _onDidChangeSelection;
    readonly onDidChangeSelection: Event<void>;
    private readonly _onDidChangeFocus;
    readonly onDidChangeFocus: Event<boolean>;
    private readonly _onDidDispose;
    readonly onDidDispose: Event<void>;
    get markTracker(): IMarkTracker;
    get shellIntegration(): IShellIntegration;
    get textureAtlas(): Promise<ImageBitmap> | undefined;
    get isFocused(): boolean;
    /**
     * @param xtermCtor The xterm.js constructor, this is passed in so it can be fetched lazily
     * outside of this class such that {@link raw} is not nullable.
     */
    constructor(xtermCtor: typeof Terminal, cols: number, rows: number, _xtermColorProvider: IXtermColorProvider, _capabilities: ITerminalCapabilityStore, shellIntegrationNonce: string, disableShellIntegrationReporting: boolean, _configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ITerminalLogService, _notificationService: INotificationService, _themeService: IThemeService, _telemetryService: ITelemetryService, _terminalConfigurationService: ITerminalConfigurationService, _clipboardService: IClipboardService, contextKeyService: IContextKeyService, _accessibilitySignalService: IAccessibilitySignalService, layoutService: ILayoutService);
    getBufferReverseIterator(): IterableIterator<string>;
    getContentsAsHtml(): Promise<string>;
    getSelectionAsHtml(command?: ITerminalCommand): Promise<string>;
    attachToElement(container: HTMLElement, partialOptions?: Partial<IXtermAttachToElementOptions>): HTMLElement;
    private _setFocused;
    write(data: string | Uint8Array, callback?: () => void): void;
    resize(columns: number, rows: number): void;
    updateConfig(): void;
    private _updateSmoothScrolling;
    private _shouldLoadWebgl;
    forceRedraw(): void;
    clearDecorations(): void;
    forceRefresh(): void;
    findNext(term: string, searchOptions: ISearchOptions): Promise<boolean>;
    findPrevious(term: string, searchOptions: ISearchOptions): Promise<boolean>;
    private _updateFindColors;
    private _searchAddonPromise;
    private _getSearchAddon;
    clearSearchDecorations(): void;
    clearActiveSearchDecoration(): void;
    getFont(): ITerminalFont;
    getLongestViewportWrappedLineLength(): number;
    private _getWrappedLineCount;
    scrollDownLine(): void;
    scrollDownPage(): void;
    scrollToBottom(): void;
    scrollUpLine(): void;
    scrollUpPage(): void;
    scrollToTop(): void;
    scrollToLine(line: number, position?: ScrollPosition): void;
    clearBuffer(): void;
    hasSelection(): boolean;
    clearSelection(): void;
    selectMarkedRange(fromMarkerId: string, toMarkerId: string, scrollIntoView?: boolean): void;
    selectAll(): void;
    focus(): void;
    copySelection(asHtml?: boolean, command?: ITerminalCommand): Promise<void>;
    private _setCursorBlink;
    private _setCursorStyle;
    private _setCursorStyleInactive;
    private _setCursorWidth;
    private _enableWebglRenderer;
    private _disableWebglForThisSession;
    private _refreshImageAddon;
    protected _getClipboardAddonConstructor(): Promise<typeof ClipboardAddon>;
    protected _getImageAddonConstructor(): Promise<typeof ImageAddon>;
    protected _getSearchAddonConstructor(): Promise<typeof SearchAddon>;
    protected _getUnicode11Constructor(): Promise<typeof Unicode11Addon>;
    protected _getWebglAddonConstructor(): Promise<typeof WebglAddon>;
    protected _getSerializeAddonConstructor(): Promise<typeof SerializeAddon>;
    private _disposeOfWebglRenderer;
    getXtermTheme(theme?: IColorTheme): ITheme;
    private _updateTheme;
    refresh(): void;
    private _updateUnicodeVersion;
    _writeText(data: string): void;
    dispose(): void;
}

export { XtermTerminal };
