/** * Pure helpers for nav state derivation. * * Extracted so the recursive active/expanded logic can be unit-tested * without needing to mount Svelte components. * * No DOM, no Svelte runes, no SvelteKit imports — these are SSR-safe and * deterministic given their inputs. */ import type { NavItem } from './types.js'; /** * Default activeness check for a nav item against a current path. * * - Exact match → active * - `item.exact === true` → only exact match counts * - `item.href === '/'` → only matches `currentPath === '/'`; otherwise * the descendant-path fallback would degrade to `startsWith('//')` * and never fire (and we don't want every path counting the root as * active by ancestry). * - Otherwise, active when `currentPath` starts with `item.href + '/'` * (the trailing slash avoids `/foo` matching `/foobar`). */ export declare function defaultIsActive(item: NavItem, currentPath: string): boolean; /** * True if the item or any descendant is active under `isActive`. */ export declare function isItemOrChildActive(item: NavItem, currentPath: string, isActive?: (item: NavItem, currentPath: string) => boolean): boolean; /** * True when an item's children container should render as expanded. * * Children are expanded when: * - the item has children, AND * - one of its descendants is active, OR `item.defaultExpanded` is set. */ export declare function isExpanded(item: NavItem, currentPath: string, isActive?: (item: NavItem, currentPath: string) => boolean): boolean; //# sourceMappingURL=nav-helpers.d.ts.map