textchecker-element
Version:
Overlay text checker web compoentns.
34 lines (33 loc) • 1.27 kB
TypeScript
import { AnnotationItem, TextCheckerElementRectItem, TextCheckerState } from "./text-checker-store";
export type TextCheckerElementAttributes = {
onEnter?: () => void;
onLeave?: () => void;
targetElement: HTMLTextAreaElement;
hoverPadding: number;
};
export declare class TextCheckerElement extends HTMLElement {
private annotationBox;
private targetElement;
private store;
private hoverPadding;
private target;
isFocus: boolean;
isHovering: boolean;
private onEnter;
private onLeave;
constructor(args: TextCheckerElementAttributes);
static get observedAttributes(): readonly ["target", "hoverPadding"];
attributeChangedCallback: (name: (typeof TextCheckerElement.observedAttributes)[number], _oldValue: any, newValue: any) => void;
connectedCallback(): void;
disconnectedCallback(): void;
private onMouseEnter;
private onMouseLeave;
resetAnnotations(): void;
resetHoverState(): void;
updateAnnotations(annotationItems: AnnotationItem[]): void;
renderAnnotationMarkers: (state: TextCheckerState) => void;
onFocus: () => void;
onBlur: () => void;
isHoverRectItem: (rectItem: TextCheckerElementRectItem) => boolean;
onMouseUpdate: (event: MouseEvent) => void;
}