import type { AnnotationLabels, AnnotationStore, AnnotationTheme, PatchMarkErrorContext, ThemeName } from './types.js'; declare const BaseHTMLElement: typeof HTMLElement; export declare class PatchMark extends BaseHTMLElement { private _store; private _labels; private _pageKey; get store(): AnnotationStore; /** * Replacing a store is a data-boundary change, not a cosmetic assignment. * Abort the old store's in-flight work and re-check protected sessions so * React/custom-element users cannot retain data or auth from a prior store. */ set store(value: AnnotationStore | null | undefined); get labels(): AnnotationLabels; /** Labels are reactive and always start from the complete package defaults. */ set labels(value: Partial | null | undefined); /** * Optional stable identity for the currently rendered page. When unset, * PatchMark uses pathname + query + hash so query/hash-routed views do not * silently share annotation records. */ get pageKey(): string | null; set pageKey(value: string | null | undefined); /** * Error reporter for failed store operations. When set, it replaces the * default console.warn — wire it to your monitoring to detect incomplete * backends (e.g. a missing PATCH endpoint) early. */ onError: ((error: Error, context: PatchMarkErrorContext) => void) | null; private _theme; /** * Fine-grained color overrides, applied on top of the active preset. * Reactive: reassigning applies immediately (and clears keys left out). */ get theme(): AnnotationTheme; set theme(value: AnnotationTheme | null | undefined); /** * Preset theme name, reflected to the theme attribute. Unknown values are * passed through so host CSS can define custom presets * (patch-mark[theme="brand"] { --pm-accent: ... }). */ get themeName(): ThemeName | (string & {}); set themeName(value: string | null | undefined); private mode; private hoveredTarget; private selectedTarget; private selectedPagePath; /** Live range for text annotations; keeps its highlight aligned after reflow. */ private selectedRange; private message; private annotations; private annotationsPagePath; private lastKnownPagePath; private isLoading; private isSubmitting; private status; private statusType; private authState; private validatedAuthToken; private authAttempt; private listGeneration; private listAbortController; private submitGeneration; private submitAbortController; private reorderGeneration; private reorderAbortController; private resolveGeneration; private resolveAllGeneration; private isResolvingAll; private resolveRequests; private locatedTarget; private selectedElement; private selectionPath; private dodgeX; private launcherCollapsed; private launcherFloating; private launcherPos; private dragState; private suppressNextClick; private showProperties; private propertyChanges; private dragSrcId; private dragOverId; private dragOverPos; private shadow; private overlayEl; private panelEl; private launcherWrapEl; private launcherEl; private collapseButtonEl; private boundMove; private boundClick; /** Videos we paused on entering picking mode; resumed on cleanup. */ private pausedVideos; private pointerRef; private locateTimeout; private rafId; static get observedAttributes(): string[]; attributeChangedCallback(name: string, _old: string, value: string): void; get visible(): boolean; set visible(value: boolean); /** * When enabled, the tool stays locked until a valid access token is * present (captured from ?pm_token= sharing links, or entered into the * lock panel). Off by default — small sites should not have to bother. */ get requireAuth(): boolean; set requireAuth(value: boolean); /** * Attribute changes may happen while a panel is already open. Resetting the * validated session here prevents a late `require-auth` toggle from leaving * the old picker/list controls usable without a server round-trip. */ private syncAuthRequirement; /** * Dock position of the launcher/panel: right-center (default), right-top, * right-bottom, left-center, left-top, left-bottom. The panel slides to * the opposite side when it covers the selection (dodge), so left positions * dodge rightwards. */ get position(): string; set position(value: string); private get dockSide(); private applyDodgeSign; private applyTheme; private updateVisibility; connectedCallback(): void; disconnectedCallback(): void; open(): void; close(): void; private claimActiveInstance; private releaseActiveInstance; private currentPagePath; /** * Browser back/forward and hash navigation are observable without patching * the host app's History API. Apps using pushState should set pageKey from * their router; its setter takes the same safe transition below. */ private routeChangeHandler; private syncPageIdentity; private handleStoreChange; private cancelListRequest; private cancelSubmitRequest; private cancelMutationRequests; /** Move the open panel to a non-interactive state without retaining data. */ private enterLockedMode; /** * In require-auth mode, a token must have been validated by the store for * this exact browser session. Presence in localStorage alone is not access. */ private ensureAuthorizedSession; private validateAccess; private openTool; private closeTool; private startPicking; private openList; private setupPicking; private cleanupPicking; private getTargetAtPoint; private handleMove; private updatePickingGhost; private handleClick; private handleMouseUp; private enterCompose; private globalKeyDownHandler; private refreshHover; private refreshSelected; private setupComposeTracking; private cleanupComposeTracking; private canExpandSelection; private canShrinkSelection; private expandSelection; private shrinkSelection; private applySelectedElement; private setDodgeSide; private updateComposeDodge; private reportError; /** * Reports a store failure and, when the backend rejected the token (401), * drops into locked mode. Returns true for auth failures so the caller can * skip its generic error handling. */ private handleStoreError; private loadAnnotations; private getChanges; private hasSameChanges; private submitAnnotation; private locateAnnotation; private resolveAnnotation; /** * Resolve the open annotations visible at click time. The snapshot boundary * matters for collaboration: feedback another reviewer creates while this * batch is running must remain open for an explicit later review. */ private resolveAllOpenAnnotations; /** Validate a token entered in the lock panel by loading the list. */ private unlock; private handleDragHandleDown; private resetDraggable; private handleDragStart; private handleDragOver; private clearDragIndicators; private handleDrop; private handleDragEnd; private copyAsPrompt; private writeClipboard; private copyHandoff; private setupLauncherInteraction; private onLauncherPointerDown; private boundLauncherMove; private boundLauncherUp; private snapToEdge; private collapseLauncher; private expandLauncher; private persistLauncherState; private restoreLauncherState; private handlePanelClick; private handlePanelKeyDown; private handlePanelInput; private updatePropToggleBadge; private clearOverlay; private createOverlayHighlight; private createOverlayLabel; /** Appends and measures a label before choosing a collision-aware position. */ private positionOverlayLabel; private renderOverlayFrame; private updateOverlay; private renderSelectedOverlay; private updatePanel; private renderPanelContent; private renderPickerNote; private renderLocked; private renderCompose; private renderPropertyPanel; private renderList; /** Mounts store-owned values with textContent/setAttribute, never HTML. */ private mountListItems; private createListMessage; /** Inline SVG is a package-owned constant; no store or page value reaches this sink. */ private appendIcon; private createActionButton; private createAnnotationItem; } export {};