-
Notifications
You must be signed in to change notification settings - Fork 0
/
NavRouteConfigItem.ts
34 lines (25 loc) · 1006 Bytes
/
NavRouteConfigItem.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import type { ReactElement } from "react";
import type { RouteContentProps } from "../components/NavigatorRouteView";
import type { NavRouteItem } from "./NavRouteItem";
import type { RenderNavItem } from "./NavTypes";
import type { RouteOptions } from "./RouteOptions";
type NavRouteConfigItemBase = {
initialRouteProps?: object;
};
/** Native route config */
export type NavRouteConfigItemNative = NavRouteConfigItemBase & {
isNativeRoute: true;
};
/** JS/React route config */
export type NavRouteConfigItemJS = NavRouteConfigItemBase & {
isNativeRoute?: false | undefined;
routeOptionsDefault?: RouteOptions;
// render the route to show in the view controller
renderRoute: (routeItem: Readonly<NavRouteItem>) => ReactElement<RouteContentProps>;
// render nav bar items
renderNavBarLeftItem ?: RenderNavItem;
renderNavBarRightItem?: RenderNavItem;
renderNavBarTitleItem?: RenderNavItem;
};
export type NavRouteConfigItem =
NavRouteConfigItemNative | NavRouteConfigItemJS;