import EventEmitter from './util/event.emitter'; import HighlightSource from './model/source'; import Cache from './data/cache'; import Painter from './painter'; import type { DomMeta, HookMap, HighlighterOptions, SelectionDirection } from './types'; import { EventType } from './types'; export default class Highlighter extends EventEmitter { static event: typeof EventType; static isHighlightWrapNode: ($node: HTMLElement) => boolean; options: HighlighterOptions; hooks: HookMap; painter: Painter; cache: Cache; private _hoverId; private readonly event; constructor(options?: HighlighterOptions); static isHighlightSource: (d: any) => boolean; run: () => () => void; stop: () => void; addClass: (className: string, id?: string) => void; removeClass: (className: string, id?: string) => void; getIdByDom: ($node: HTMLElement) => string; getExtraIdByDom: ($node: HTMLElement) => string[]; getDoms: (id?: string) => HTMLElement[]; dispose: () => void; setOption: (options?: HighlighterOptions) => void; fromRange: (range: Range, direction: SelectionDirection) => HighlightSource; fromStore: (start: DomMeta, end: DomMeta, text: string, id: string, direction: SelectionDirection, extra?: unknown) => HighlightSource; remove(id: string): void; removeAll(): void; private readonly _getHooks; private readonly _highlightFromHRange; private _highlightFromHSource; private readonly _handleSelection; private readonly _handleHighlightHover; private readonly _handleError; private readonly _handleHighlightClick; }