import { LitElement, nothing } from 'lit'; import { OutputLevel, ThemeMode, BeforeAnnotationCreateHook } from '../core/types'; /** * Annotation Web Component * * Usage: * ```html * * ``` * * Events: * - annotation:create - Fired when an annotation is created * - annotation:update - Fired when an annotation is updated * - annotation:delete - Fired when an annotation is deleted * - annotation:clear - Fired when all annotations are cleared * - annotation:copy - Fired when output is copied */ export declare class AnnotationElement extends LitElement { static styles: import('lit').CSSResult; static properties: { theme: { type: StringConstructor; reflect: boolean; }; outputLevel: { type: StringConstructor; attribute: string; }; annotationColor: { type: StringConstructor; attribute: string; }; disabled: { type: BooleanConstructor; }; }; theme: ThemeMode; outputLevel: OutputLevel; annotationColor: string; disabled: boolean; constructor(); private core; private unsubscribe; private beforeCreateHook; private appState; private popupComment; private popupShaking; private mouseX; private mouseY; private hoveredMarkerId; private toolbarShownOnce; private settingsPanelAnimated; private annotationsPanelAnimated; private animatedMarkerTooltipId; private lastRenderedSettings; private showCountSummary; private boundHandleResize; private boundHandleMouseMove; private boundHandleDocumentClick; private boundHandleScroll; private boundHandleToolbarPointerMove; private boundHandleToolbarPointerUp; private scrollRafPending; private toolbarDrag; private dragPosition; private suppressToolbarClick; private textareaRef; private popupPosition; private currentRoute; private routeListenerCleanup; private devtoolsApi; connectedCallback(): void; disconnectedCallback(): void; updated(changedProperties: Map): void; /** * Public API */ /** * Set the hook called before creating annotations. * This must be called before connectedCallback runs (i.e., before the element is added to the DOM) * OR the component must be re-initialized after setting. * * For framework adapters, call this immediately after element creation. */ setBeforeCreateHook(hook: BeforeAnnotationCreateHook | null): void; activate(): void; deactivate(): void; toggle(): void; copyOutput(level?: OutputLevel): Promise; getOutput(level?: OutputLevel): string; clearAll(): void; /** * Private methods */ private getSettingsFromAttributes; private updateThemeAttribute; private handleWindowResize; /** * Attempt to re-find DOM elements for persisted annotations that * lost their element reference (e.g., after page reload). * Uses the stored selectorPath, ID, classes, and text content. * Retries up to MAX_RETRIES times for dynamically loaded content. */ private refindAnnotationElements; private handleDocumentClick; /** * Keep markers tracking their elements on ANY scroll event. * Uses capture-phase listener on document to catch nested scroll * containers (not just the main page scroll). * This listener runs at all times (not just when activated) so that * dots-mode markers also move correctly when the toolbar is closed. */ private handleScroll; private bindRouteListeners; private handleMouseMove; private closeAnnotationsPanel; private toggleMarkerVisibility; private toggleTheme; private toggleSettingsPanel; private toggleAnnotationsPanel; private navigateToRoute; private openAnnotationPopup; private handleAction; private handleClick; private handleSettingChange; private handleMouseOver; private handleMouseOut; private handlePopupKeyDown; private handlePopupInput; private handlePopupSubmit; private handlePopupDelete; private dispatchAnnotationEvent; /** * Generate route-grouped annotation count summary HTML */ private generateCountSummary; private escapeHtmlStr; private buildToolbarAndPanelHtml; /** * Render popup using Lit's html template for proper IME/input handling */ private renderPopupTemplate; render(): typeof nothing | import('lit').TemplateResult<1>; protected firstUpdated(): void; protected willUpdate(): void; private popupResizeObserver; private syncPopupPosition; private teardownPopupObserver; private handleToolbarPointerDown; private handleToolbarPointerMove; private handleToolbarPointerUp; private teardownToolbarDrag; private clampAndPersistToolbarPosition; private positionToolbar; } /** * Register the custom element */ export declare function registerAnnotationElement(tagName?: string): void; //# sourceMappingURL=annotation-element.d.ts.map