import { ComponentType, ReactNode } from 'react'; import { LibraryIntegration } from './library-integration'; /** * Routing flag keys */ export declare const ROUTING_FLAG_KEYS: { /** Enable route prefetching */ readonly ROUTING_PREFETCH_ENABLED: "routing-prefetch-enabled"; /** Enable lazy loading of routes */ readonly ROUTING_LAZY_LOAD_ENABLED: "routing-lazy-load-enabled"; /** Enable predictive navigation */ readonly ROUTING_PREDICTIVE_ENABLED: "routing-predictive-enabled"; /** Enable parallel routes */ readonly ROUTING_PARALLEL_ENABLED: "routing-parallel-enabled"; /** Enable route interception */ readonly ROUTING_INTERCEPT_ENABLED: "routing-intercept-enabled"; /** Enable route analytics */ readonly ROUTING_ANALYTICS_ENABLED: "routing-analytics-enabled"; /** Enable route guards */ readonly ROUTING_GUARDS_ENABLED: "routing-guards-enabled"; /** Enable route transitions */ readonly ROUTING_TRANSITIONS_ENABLED: "routing-transitions-enabled"; /** Enable scroll restoration */ readonly ROUTING_SCROLL_RESTORE_ENABLED: "routing-scroll-restore-enabled"; /** Enable breadcrumbs */ readonly ROUTING_BREADCRUMBS_ENABLED: "routing-breadcrumbs-enabled"; /** Use new router implementation */ readonly ROUTING_ROUTER_V2: "routing-router-v2"; /** Enable route caching */ readonly ROUTING_CACHE_ENABLED: "routing-cache-enabled"; /** Enable error boundaries per route */ readonly ROUTING_ERROR_BOUNDARIES_ENABLED: "routing-error-boundaries-enabled"; /** Enable loading states per route */ readonly ROUTING_LOADING_STATES_ENABLED: "routing-loading-states-enabled"; }; export type RoutingFlagKey = (typeof ROUTING_FLAG_KEYS)[keyof typeof ROUTING_FLAG_KEYS]; /** * Routing flag configuration */ export interface RoutingFlagConfig { /** Enable prefetching */ readonly prefetchEnabled: boolean; /** Enable lazy loading */ readonly lazyLoadEnabled: boolean; /** Enable predictive navigation */ readonly predictiveEnabled: boolean; /** Enable parallel routes */ readonly parallelEnabled: boolean; /** Enable route interception */ readonly interceptEnabled: boolean; /** Enable route analytics */ readonly analyticsEnabled: boolean; /** Enable route guards */ readonly guardsEnabled: boolean; /** Enable route transitions */ readonly transitionsEnabled: boolean; /** Enable scroll restoration */ readonly scrollRestoreEnabled: boolean; /** Enable breadcrumbs */ readonly breadcrumbsEnabled: boolean; /** Use router v2 */ readonly routerV2: boolean; /** Enable route caching */ readonly cacheEnabled: boolean; /** Enable error boundaries */ readonly errorBoundariesEnabled: boolean; /** Enable loading states */ readonly loadingStatesEnabled: boolean; /** Index signature for Record compatibility */ [key: string]: unknown; } /** * Flagged route configuration */ export interface FlaggedRouteConfig { /** Route path */ readonly path: string; /** Feature flag key */ readonly flagKey: string; /** Component when flag is enabled */ readonly enabledComponent: ComponentType; /** Component when flag is disabled */ readonly fallbackComponent?: ComponentType; /** Redirect path when flag is disabled */ readonly fallbackRedirect?: string; /** Layout when flag is enabled */ readonly enabledLayout?: ComponentType<{ children: ReactNode; }>; /** Layout when flag is disabled */ readonly fallbackLayout?: ComponentType<{ children: ReactNode; }>; } /** * Route visibility configuration */ export interface RouteVisibilityConfig { /** Route path */ readonly path: string; /** Feature flags that control visibility */ readonly flags: readonly { key: string; required: boolean; }[]; /** Match strategy */ readonly strategy: 'all' | 'any'; } /** * Default routing flag configuration */ export declare const DEFAULT_ROUTING_FLAG_CONFIG: RoutingFlagConfig; /** * Create routing flag integration */ export declare function createRoutingFlagIntegration(): LibraryIntegration; declare const routingIntegration: LibraryIntegration; /** * Routing flags helper class */ declare class RoutingFlagsHelper { setFlagGetter(getter: (flagKey: string) => boolean): void; isPrefetchEnabled(): boolean; isLazyLoadEnabled(): boolean; isPredictiveEnabled(): boolean; isParallelEnabled(): boolean; isInterceptEnabled(): boolean; isAnalyticsEnabled(): boolean; isGuardsEnabled(): boolean; isTransitionsEnabled(): boolean; isScrollRestoreEnabled(): boolean; isBreadcrumbsEnabled(): boolean; isRouterV2Enabled(): boolean; isCacheEnabled(): boolean; isErrorBoundariesEnabled(): boolean; isLoadingStatesEnabled(): boolean; getAllFlags(): Record; private getFlag; } /** * Global routing flags helper instance */ export declare const routingFlags: RoutingFlagsHelper; /** * Hook to get routing flag configuration */ export declare function useRoutingFlagConfig(): RoutingFlagConfig; /** * Hook to check a specific routing flag */ export declare function useRoutingFlag(flagKey: RoutingFlagKey): boolean; /** * Register a flagged route */ export declare function registerFlaggedRoute(config: FlaggedRouteConfig): void; /** * Get component for a flagged route */ export declare function getFlaggedRouteComponent(path: string, getFlag: (flagKey: string) => boolean): ComponentType | null; /** * Get redirect for a flagged route */ export declare function getFlaggedRouteRedirect(path: string, getFlag: (flagKey: string) => boolean): string | null; /** * Register route visibility configuration */ export declare function registerRouteVisibility(config: RouteVisibilityConfig): void; /** * Check if a route is visible based on flags */ export declare function isRouteVisible(path: string, getFlag: (flagKey: string) => boolean): boolean; /** * Get all visible routes */ export declare function getVisibleRoutes(routes: string[], getFlag: (flagKey: string) => boolean): string[]; /** * Clear all registered flagged routes */ export declare function clearFlaggedRoutes(): void; /** * Create flagged navigation links */ export declare function createFlaggedNavLinks(links: Array<{ path: string; label: string; icon?: ReactNode; flagKey?: string; }>, getFlag: (flagKey: string) => boolean): Array<{ path: string; label: string; icon?: ReactNode; visible: boolean; }>; /** * Hook for flagged navigation */ export declare function useFlaggedNavigation(links: Array<{ path: string; label: string; icon?: ReactNode; flagKey?: string; }>, getFlag: (flagKey: string) => boolean): Array<{ path: string; label: string; icon?: ReactNode; }>; export { routingIntegration };