/** * Segments state returned by useSegments hook */ export interface SegmentsState { /** URL path segments (e.g., /shop/products/123 → ["shop", "products", "123"]) */ path: readonly string[]; /** Matched segment IDs in order (layouts and routes only, e.g., ["L0", "L0L1", "L0L1R0"]) */ segmentIds: readonly string[]; /** Current URL location */ location: URL; } /** * Initialize segments data synchronously for SSR. * Called before rendering to populate state for useState initializer. * * @param matched - Segment order from RSC metadata * @param pathname - Current pathname */ export declare function initSegmentsSync(matched?: string[], pathname?: string): void; /** * Hook to access current route segments with optional selector for performance * * Provides information about the current URL path and matched route segments. * Uses the event controller for reactive state management. * * @example * ```tsx * // Get full segments state * const { path, segmentIds, location } = useSegments(); * * // Use selector for specific values (better performance) * const path = useSegments(s => s.path); * const isShopRoute = useSegments(s => s.path[0] === "shop"); * ``` */ export declare function useSegments(): SegmentsState; export declare function useSegments(selector: (state: SegmentsState) => T): T; //# sourceMappingURL=use-segments.d.ts.map