import { TargetState, TransitionOptions, UIRouter } from "@uirouter/core"; import type { SrefStatus, TransEvt } from "./ui-sref-active.js"; import type { UiView } from "./ui-view.js"; /** * Event name dispatched when a uiSref target state changes. * @internal */ export declare const UI_SREF_TARGET_EVENT = "uiSrefTarget"; /** * Interface for elements that have been enhanced with uiSref. * @internal */ export interface UiSrefElement extends Element { /** The href attribute value for the link */ href: string; /** The target state for the link */ targetState: TargetState; } /** * Custom event dispatched when a uiSref target state changes. * Used internally by uiSrefActive to track which states are being linked to. * @internal */ export interface UiSrefTargetEvent extends CustomEvent<{ targetState: TargetState; }> { target: UiSrefElement; } /** * Create a uiSrefTarget event with the given target state. * @param targetState - The target state for the event * @returns A custom event with the target state in the detail * @internal */ export declare function uiSrefTargetEvent(targetState: TargetState): UiSrefTargetEvent; /** * Event name dispatched when a link's part leaves the DOM, so an enclosing * container drops its target at once instead of on the next transition. * @internal */ export declare const UI_SREF_TARGET_REMOVED_EVENT = "uiSrefTargetRemoved"; /** * @internal */ export declare function uiSrefTargetRemovedEvent(): Event; /** * The link a composed sref event came from: past a nested shadow root * `target` is the host, not the link. * @internal */ export declare function srefEventLink(event: Event): Element; /** * Whether two target states resolve to the same definition with the same params. * @internal */ export declare function sameTarget(a: TargetState | null, b: TargetState): boolean; /** * Core's transition options as an sref sends them: relative to the enclosing * view's state, inheriting params, attributed to `sref`. Shared by the * element-part {@link uiSref} and the attribute-part `srefHref`. * @internal */ export declare function srefTransitionOptions(parentView: UiView | null, opts?: TransitionOptions): TransitionOptions; /** * Whether the element navigates on its own. `localName` is lowercase for HTML * and SVG alike, so SVG `` needs no namespace check. * * **Tag-based on purpose.** This decides where an `href` may be written, and * `href` is a property of the tag, not of the role: `
` * is inert noise. `uiSrefActive`'s `isLinkElement` asks the neighbouring * *role*-based question for `aria-current`, which `
` * legitimately takes. The two overlap on ``/`` and nowhere else — do * not unify them. * * @internal */ export declare function isNativeLink(element: Element): boolean; /** * Whether a click on an sref element is the browser's to handle, so the * directive must not navigate. Shared by the element-part {@link uiSref} and * the attribute-part `srefHref`, so both answer the same question the same way. * * Author signals (`preventDefault`, `download`) apply whatever the element is. * The modifier and off-app guards are scoped to links with an `href`: they hand * the click back to the browser, and without one it has nothing to act on. * * @internal */ export declare function clickBelongsToBrowser(event: MouseEvent, element: Element): boolean; /** * @internal */ export declare function mergeSrefStatus(left: SrefStatus, right: SrefStatus): SrefStatus; /** * The {@link SrefStatus} of one target for a transition event — or, with no * event, against the router's current state. Shared by the element-part * {@link uiSrefActive}, the attribute-part `srefActiveClass` / * `srefAriaCurrent`, and `SrefStatusController`. * * @internal */ export declare function srefStatus(router: UIRouter, event: TransEvt | undefined, srefTarget: TargetState): SrefStatus; //# sourceMappingURL=sref-internals.d.ts.map