import { IDisposable } from 'monaco-editor';
/**
 * Undocumented Monaco APIs
 *
 * We use an internal undocumented monaco-editor APIs to patch some shadow DOM issues in monaco-editor / vscode.
 *
 * Using these APIs introduces risk of breakages with future updates to monaco-editor, as they are not part of the public API.
 *
 * This file contains type definitions and helper functions to work with these internal APIs safely.
 *
 */
type PointerHandlerDisposable = {
    _type?: string;
    dispose?: () => void;
};
export type EditorMouseEventInstance = {
    readonly event?: Event;
    readonly target?: EventTarget | null;
};
export type MouseEventFactoryInstance = {
    onMouseMove: (domNode: HTMLElement, callback: (e: Event) => void) => IDisposable;
};
type PointerHandler = {
    _store: {
        _toDispose: Set<PointerHandlerDisposable>;
    };
    viewHelper: {
        viewDomNode: HTMLElement;
    };
    _onMouseMove: (e: unknown) => void;
    _onMouseLeave: (e: unknown) => void;
    _mouseLeaveMonitor: IDisposable | null;
    _register: (disposable: IDisposable) => IDisposable;
};
export type UndocumentedMonacoEditorInstanceApi = {
    _modelData?: {
        view?: {
            _pointerHandler?: {
                handler?: PointerHandler;
            };
        };
    };
};
type AddDisposableListener = (element: Document | HTMLElement | Window, type: string, listener: (event: Event) => void) => IDisposable;
type GetShadowRoot = (element: HTMLElement) => ShadowRoot | null;
export type MonacoDomApi = {
    addDisposableListener: AddDisposableListener;
    getShadowRoot: GetShadowRoot;
};
export type MonacoStaticMemberContainer = Record<string, unknown> | ((...args: unknown[]) => unknown);
export declare function getPointerHandler(editor: unknown): PointerHandler | null;
declare function getMonacoDomApi(): MonacoDomApi | null;
declare function createMouseEventFactory(domNode: HTMLElement): MouseEventFactoryInstance | null;
declare function createEditorMouseEvent(e: Event, isFromTouch: boolean, target: HTMLElement): EditorMouseEventInstance | null;
export declare function assertHasPointerHandler(editor: unknown): editor is UndocumentedMonacoEditorInstanceApi;
export { getMonacoDomApi, createMouseEventFactory, createEditorMouseEvent };
export type ActualDoHitTestFn = (ctx: unknown, coords: {
    clientX: number;
    clientY: number;
}) => unknown;
export declare function isShadowDomSelectionRangeNodeError(message: string): boolean;
export declare function getMouseTargetFactoryContainer(): MonacoStaticMemberContainer | null;
export declare function getActualDoHitTestWithCaretRangeFromPoint(factory: MonacoStaticMemberContainer): ActualDoHitTestFn | null;
export type HitTestResultUnknownLike = {
    type: 0;
    hitTarget: unknown;
};
