diff --git a/packages/remix-react/routeModules.ts b/packages/remix-react/routeModules.ts index 621276375e7..ae54fc4f2ce 100644 --- a/packages/remix-react/routeModules.ts +++ b/packages/remix-react/routeModules.ts @@ -55,7 +55,10 @@ export interface MetaMatch< } export type MetaMatches< - MatchLoaders extends Record = Record + MatchLoaders extends Record = Record< + string, + LoaderFunction + > > = Array< { [K in keyof MatchLoaders]: MetaMatch< @@ -67,7 +70,10 @@ export type MetaMatches< export interface MetaArgs< Loader extends LoaderFunction | unknown = unknown, - MatchLoaders extends Record = Record + MatchLoaders extends Record = Record< + string, + LoaderFunction + > > { data: | (Loader extends LoaderFunction ? SerializeFrom : AppData) @@ -80,7 +86,10 @@ export interface MetaArgs< export interface MetaFunction< Loader extends LoaderFunction | unknown = unknown, - MatchLoaders extends Record = Record + MatchLoaders extends Record = Record< + string, + LoaderFunction + > > { (args: MetaArgs): MetaDescriptor[] | undefined; } diff --git a/packages/remix-server-runtime/routeModules.ts b/packages/remix-server-runtime/routeModules.ts index c23f4bccbb3..fe000257bc8 100644 --- a/packages/remix-server-runtime/routeModules.ts +++ b/packages/remix-server-runtime/routeModules.ts @@ -131,7 +131,10 @@ export interface LoaderFunction { */ export interface ServerRuntimeMetaFunction< Loader extends LoaderFunction | unknown = unknown, - ParentsLoaders extends Record = {} + ParentsLoaders extends Record = Record< + string, + LoaderFunction + > > { ( args: ServerRuntimeMetaArgs @@ -148,10 +151,14 @@ interface ServerRuntimeMetaMatch< handle?: unknown; params: AgnosticRouteMatch["params"]; meta: ServerRuntimeMetaDescriptor[]; + error?: unknown; } type ServerRuntimeMetaMatches< - MatchLoaders extends Record = Record + MatchLoaders extends Record = Record< + string, + LoaderFunction + > > = Array< { [K in keyof MatchLoaders]: ServerRuntimeMetaMatch< @@ -163,7 +170,10 @@ type ServerRuntimeMetaMatches< export interface ServerRuntimeMetaArgs< Loader extends LoaderFunction | unknown = unknown, - MatchLoaders extends Record = Record + MatchLoaders extends Record = Record< + string, + LoaderFunction + > > { data: | (Loader extends LoaderFunction ? SerializeFrom : AppData)