/** * Core Annotation Engine * Handles text selection, range serialization, and annotation rendering */ import type { Annotation, AnnotationTarget } from "./types"; export declare class AnnotationEngine { private root; private rendered; constructor(root?: HTMLElement); /** * Create annotation from current text selection */ createFromSelection(): AnnotationTarget | null; /** * Render annotation on page */ render(annotation: Annotation): boolean; /** * Remove annotation from page */ remove(annotationId: string): void; /** * Remove all annotations */ removeAll(): void; /** * Clean up any malformed annotation marks (e.g., from previous versions) */ cleanupMalformed(): void; /** * Find suitable container element for annotation */ private findContainer; /** * Generate CSS selector for element */ private generateSelector; /** * Get character offsets relative to container */ private getOffsets; /** * Create Range from serialized target */ private createRange; /** * Apply visual highlight to range */ private applyHighlight; /** * Get all text nodes within a range with their offsets */ private getTextNodesInRange; /** * Check if a node is within a range */ private isNodeInRange; /** * Apply annotation styles */ private applyStyle; } export declare const engine: AnnotationEngine;