import type { ComponentType, FC, ReactNode } from 'react'; import type { PressableProps, GestureResponderEvent } from 'react-native'; export type ExtractRouteParams = string extends T ? Record : T extends `${infer Start}:${infer Param}/${infer Rest}` ? { [k in Param | keyof ExtractRouteParams]: string; } : T extends `${infer Start}:${infer Param}` ? { [k in Param]: string; } : {}; export interface BaseScreen { path: string; element: ComponentType; preload: (params: any) => any; options?: ScreenOptions; } export interface FluentParams { rootKey: string; tab?: BottomTabType; } export interface FluentScreen { screen: BaseScreen; params: ExtractRouteParams; } export interface BottomTabType { child: BaseScreen; path: string; title: () => string; icon?: any; selectedIcon?: any; /** Uses Apple's native UISearchTab when the platform supports it. */ searchTab?: boolean; } export type BottomTabComponent = FC<{ orientation: Orientation; }>; export type BottomTabOverrideComponent = FC; export type BottomTabOverrideProps = { originalBottomTabs: ReactNode; orientation: Orientation; children: any; }; export interface BottomTabComponents { start?: BottomTabComponent; end?: BottomTabComponent; /** * Native-only chrome rendered inside every tab stack scene. This is useful * for platform-owned tab accessories that must survive pushed screens. */ nativeAccessory?: ComponentType; override?: BottomTabOverrideComponent; } export interface SideMenuItem { child: BaseScreen; title: () => string; icon: string; } export interface RootChildBottomTabs { type: 'bottomTabs'; children: BottomTabType[]; components?: BottomTabComponents; breakingPointWidth: undefined | null | number; } export interface RootChildNormal { type: 'normal'; child: BaseScreen; } export type Orientation = 'vertical' | 'horizontal'; export declare function createBottomTabsRoot(children: BottomTabType[], extra?: { components?: BottomTabComponents; breakingPointWidth?: number | null; } | undefined | null): RootChildBottomTabs; export declare function createNormalRoot(child: BaseScreen): RootChildNormal; export type RootValue = RootChildNormal | RootChildBottomTabs; export type Root = Record; export type ScreenOptions = { title?: string; description?: string; hidesTabBar?: boolean; /** Keep UINavigationBar visible for screens that render native chrome. */ nativeHeader?: boolean; sharedElements?: string | string[] | ((state: any, data: any, crumbs: any[]) => string | string[] | null | undefined); }; export declare function getSharedElementsForState(state: any, data: any, crumbs: any[]): string | string[]; export declare function registerScreen) => any>(path: Path, element: E, preload: Preload, options?: ScreenOptions): { path: Path; element: E; preload: Preload; options: ScreenOptions | undefined; }; export type LinkRenderProps = { onPressIn?: (event: GestureResponderEvent) => void; onHoverIn?: (event: any) => void; onHoverOut?: (event: any) => void; onFocus?: (event: any) => void; onBlur?: (event: any) => void; onPress: (event: GestureResponderEvent) => void; accessibilityRole?: 'link'; href?: string; }; export type LinkProps = { to: T; toBottomTab?: BottomTabType; params: ExtractRouteParams; children: (p: LinkRenderProps) => any; /** * Web preloading of the destination's code and data: * - 'default': on intent — hover or focus that rests 50 ms, else on press. * - 'sensitive': on hover, immediately (pickers whose items open on press). * - 'press': data only on press; hover preloads just the code. */ linkMode?: 'default' | 'sensitive' | 'press'; onPress?: PressableProps['onPress']; onPressIn?: PressableProps['onPressIn']; onHoverIn?: PressableProps['onHoverIn']; onHoverOut?: PressableProps['onHoverOut']; onFocus?: PressableProps['onFocus']; onBlur?: PressableProps['onBlur']; skipLinkBehaviourIfPressIsDefined?: boolean; replace?: boolean; refresh?: boolean; /** * Push FULL-SCREEN over an enclosing SplitView / TripleSplitView (via the main * navigator) instead of into the detail pane. No-op outside a split. */ fullScreen?: boolean; }; export type BottomTabLinkRenderProps = LinkRenderProps & { isSelected: boolean; testID?: string; }; export type BottomTabLinkProps = { to: BottomTabType; params: ExtractRouteParams; children: (p: BottomTabLinkRenderProps) => any; mode?: 'default' | 'sensitive' | 'press'; onPress?: PressableProps['onPress']; }; export declare function createScreens(screenMap: Record): BaseScreen[]; export declare function skipUrlSegment(tab: BottomTabType | undefined, screenPath: string | undefined): boolean; export declare function getScreenKey(rootKey: string, tab: BottomTabType | undefined, ...paths: (string | undefined)[]): string; export declare function rootKeyAndPaths(rootKey: string, ...paths: (string | undefined)[]): string; export declare function makeVariablesNavigationFriendly(s: string): string; export declare function generatePath(path: string, params: Record): string; export declare function getRootKeyFromPath(path: string): string | undefined; export declare function getBottomTabKeyFromPath(path: string): string | undefined; export declare function tabIndexOrFirst(tabs: readonly BottomTabType[], tabKey: string | undefined): number; export declare function getPaths(path: string, hasBottomTabs: boolean): string[]; export declare function splitPath(path: string): string[]; export declare function getPathFromUrl(url: string): string; export declare function partMatches(urlPart: string | undefined, routePart: string | undefined): boolean; export declare function getParams(urlPathSplit: string[], routePathSplit: string[]): Record; export declare function getBreakingPointFromRoot(v?: RootValue): number; export declare function useAboveBreakingPoint(breakingPoint: number): boolean; export declare function fluentRootBottomTabs(rootKey: string, tab?: BottomTabType): FluentParams; export declare function fluentRootNormal(rootKey: string): FluentParams; export declare function fluentScreen(screen: T, params: ExtractRouteParams): FluentScreen; //# sourceMappingURL=navigationUtils.d.ts.map