one
Version:
One is a new React Framework that makes Vite serve both native and web.
37 lines • 1.94 kB
TypeScript
import type { EventMapBase, NavigationState, ParamListBase, RouteProp, ScreenListeners } from '@react-navigation/native';
import React from 'react';
import { type RouteNode } from './Route';
export declare const Screen: any, Group: any;
export type ScreenProps<TOptions extends Record<string, any> = Record<string, any>, State extends NavigationState = NavigationState, EventMap extends EventMapBase = EventMapBase> = {
/** Name is required when used inside a Layout component. */
name?: string;
/**
* Redirect to the nearest sibling route.
* If all children are redirect={true}, the layout will render `null` as there are no children to render.
*/
redirect?: boolean;
initialParams?: Record<string, any>;
options?: TOptions;
listeners?: ScreenListeners<State, EventMap> | ((prop: {
route: RouteProp<ParamListBase, string>;
navigation: any;
}) => ScreenListeners<State, EventMap>);
getId?: ({ params }: {
params?: Record<string, any>;
}) => string | undefined;
};
/**
* @returns React Navigation screens sorted by the `route` property.
*/
export declare function useSortedScreens(order: ScreenProps[], options?: {
onlyMatching?: boolean;
/** Set of route names to filter out (protected routes with guard=false) */
protectedScreens?: Set<string>;
}): React.ReactNode[];
/** Wrap the component with various enhancements and add access to child routes. */
export declare function getQualifiedRouteComponent(value: RouteNode): React.ComponentType<any> | React.NamedExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
/** @returns a function which provides a screen id that matches the dynamic route name in params. */
export declare function createGetIdForRoute(route: Pick<RouteNode, 'dynamic' | 'route' | 'contextKey' | 'children'>): ({ params }?: {
params?: Record<string, any>;
}) => string;
//# sourceMappingURL=useScreens.d.ts.map