/** * `` custom element for declarative SPA navigation. * * Exposes an accessible custom element that behaves like a link for * client-side routing. Automatically toggles an active class when the * target path matches the current route. * * @module bquery/router * * @example * ```html * Home * About * Settings * ``` */ /** @internal SSR-safe base class for environments without HTMLElement. */ declare const BQ_LINK_BASE: { new (): HTMLElement; prototype: HTMLElement; }; /** * `` — A navigation custom element for bQuery routers. * * Attributes: * - `to` — Target path (required). Example: `to="/dashboard"`. * - `replace` — If present, replaces the current history entry instead of pushing. * - `exact` — If present, the active class is only applied on an exact path match. * - `active-class` — CSS class added when the route is active (default: `'active'`). * * The custom element itself acts as the interactive link target using * `role="link"` and keyboard handling. It does not render a native ``, * so browser-native link affordances like context-menu "open in new tab" * are not provided automatically. * * @example * ```ts * import { registerBqLink } from '@bquery/bquery/router'; * * // Register the element (idempotent) * registerBqLink(); * * // Then use in HTML: * // About * ``` */ export declare class BqLinkElement extends BQ_LINK_BASE { /** @internal */ private _cleanup; /** @internal */ private _trackedActiveClasses; static get observedAttributes(): string[]; /** The target path for navigation. */ get to(): string; set to(value: string); /** Whether to replace the current history entry. */ get replace(): boolean; set replace(value: boolean); /** Whether to match the path exactly for active class. */ get exact(): boolean; set exact(value: boolean); /** CSS class applied when the route is active. */ get activeClass(): string; set activeClass(value: string); /** @internal */ connectedCallback(): void; /** @internal */ disconnectedCallback(): void; /** @internal */ attributeChangedCallback(name: string, _oldValue: string | null, _newValue: string | null): void; /** * Sets up the reactive effect that toggles the active CSS class * based on the current route. * @internal */ private _setupActiveTracking; /** @internal */ private _clearTrackedActiveClasses; /** * Handles click events for SPA navigation. * @internal */ private _handleClick; /** * Handles keyboard activation (Enter). * @internal */ private _handleKeydown; /** * Performs the actual navigation. * @internal */ private _navigate; } /** * Registers the `` custom element. * * This function is idempotent — calling it multiple times is safe. * The element is registered under the tag name `bq-link`. * * @example * ```ts * import { registerBqLink } from '@bquery/bquery/router'; * * registerBqLink(); * * // Now use About in HTML * ``` */ export declare const registerBqLink: () => void; export {}; //# sourceMappingURL=bq-link.d.ts.map