From a468035b5fe60b5a75becba230e977ebdb7d63a9 Mon Sep 17 00:00:00 2001 From: Jakub Tkacz Date: Mon, 1 Jun 2026 18:45:21 +0200 Subject: [PATCH 1/2] feat: export missing types from standard-navigator --- src/index.tsx | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 0913e5a..d542487 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -58,7 +58,7 @@ export type NavigatorDescriptor = { render: () => React.ReactNode; }; -type NavigatorEventMapBase = Record< +export type NavigatorEventMapBase = Record< string, { data: object | undefined; @@ -90,22 +90,43 @@ export type NavigatorArgs< }; }; +export type StandardNavigatorContent< + NavigatorOptions extends {}, + NavigatorEventMap extends NavigatorEventMapBase, + NavigatorProps extends object = {}, +> = React.ComponentType< + NavigatorArgs & + Omit> +>; + +export type StandardNavigator< + NavigatorOptions extends {}, + NavigatorEventMap extends NavigatorEventMapBase, + NavigatorProps extends object = {}, +> = { + readonly type: 'standard'; + readonly version: 1; + readonly NavigatorContent: StandardNavigatorContent< + NavigatorOptions, + NavigatorEventMap, + NavigatorProps + >; +}; + export function createStandardNavigator< NavigatorOptions extends {}, NavigatorEventMap extends NavigatorEventMapBase, NavigatorProps extends object = {}, >( - NavigatorContent: React.ComponentType< - NavigatorArgs & - Omit< - NavigatorProps, - keyof NavigatorArgs - > + NavigatorContent: StandardNavigatorContent< + NavigatorOptions, + NavigatorEventMap, + NavigatorProps >, -) { +): StandardNavigator { return { type: 'standard', version: 1, NavigatorContent, - } as const; + }; } From a390b528fb3ec1d7dba8873e3fd1a4db4c29da88 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 3 Jun 2026 19:28:08 +0200 Subject: [PATCH 2/2] refactor: remove NavigatorEventMapBase export --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index d542487..e35d0ca 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -58,7 +58,7 @@ export type NavigatorDescriptor = { render: () => React.ReactNode; }; -export type NavigatorEventMapBase = Record< +type NavigatorEventMapBase = Record< string, { data: object | undefined;