@tanstack/router-core 0.0.1-beta.164 → 0.0.1-beta.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189,7 +189,7 @@ interface RouterOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<
189
189
  defaultPreload?: false | 'intent';
190
190
  defaultPreloadDelay?: number;
191
191
  defaultComponent?: RegisteredRouteComponent<RouteProps<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>>;
192
- defaultErrorComponent?: RegisteredRouteErrorComponent<RouteProps<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>>;
192
+ defaultErrorComponent?: RegisteredRouteErrorComponent<ErrorRouteProps<AnySearchSchema, AnyPathParams, AnyContext, AnyContext>>;
193
193
  defaultPendingComponent?: RegisteredRouteComponent<RouteProps<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>>;
194
194
  defaultMaxAge?: number;
195
195
  defaultGcMaxAge?: number;
@@ -212,11 +212,11 @@ interface RouterOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<
212
212
  interface RouterState<TRouteTree extends AnyRoute = AnyRoute> {
213
213
  status: 'idle' | 'pending';
214
214
  isFetching: boolean;
215
- matchesById: Record<string, RouteMatch<TRouteTree, AnyRoute>>;
215
+ matchesById: Record<string, RouteMatch<TRouteTree, ParseRoute<TRouteTree>>>;
216
216
  matchIds: string[];
217
217
  pendingMatchIds: string[];
218
- matches: RouteMatch<TRouteTree, AnyRoute>[];
219
- pendingMatches: RouteMatch<TRouteTree, AnyRoute>[];
218
+ matches: RouteMatch<TRouteTree, ParseRoute<TRouteTree>>[];
219
+ pendingMatches: RouteMatch<TRouteTree, ParseRoute<TRouteTree>>[];
220
220
  location: ParsedLocation<FullSearchSchema<TRouteTree>>;
221
221
  resolvedLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
222
222
  lastUpdated: number;
@@ -412,6 +412,10 @@ type RouteProps<TLoader extends any = unknown, TFullSearchSchema extends AnySear
412
412
  select?: (context: TDefaultSelected) => TSelected;
413
413
  }) => TSelected;
414
414
  };
415
+ type PendingRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TContext extends AnyContext = AnyContext> = Omit<RouteProps<any, TFullSearchSchema, TAllParams, TRouteContext, TContext>, 'useLoader'>;
416
+ type ErrorRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TContext extends AnyContext = AnyContext> = PendingRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext> & {
417
+ error: unknown;
418
+ };
415
419
  type RouteOptions<TParentRoute extends AnyRoute = AnyRoute, TCustomId extends string = string, TPath extends string = string, TLoader = unknown, TParentSearchSchema extends AnySearchSchema = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParams extends AnyPathParams = AnyPathParams, TAllParams extends AnyPathParams = TParams, TParentContext extends AnyContext = AnyContext, TAllParentContext extends AnyContext = AnyContext, TRouteContext extends RouteContext = RouteContext, TAllContext extends AnyContext = AnyContext> = BaseRouteOptions<TParentRoute, TCustomId, TPath, TLoader, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TAllContext> & UpdatableRouteOptions<TLoader, TSearchSchema, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
416
420
  type ParamsFallback<TPath extends string, TParams> = unknown extends TParams ? Record<ParsePathParams<TPath>, string> : TParams;
417
421
  type BaseRouteOptions<TParentRoute extends AnyRoute = AnyRoute, TCustomId extends string = string, TPath extends string = string, TLoader = unknown, TParentSearchSchema extends AnySearchSchema = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParams extends AnyPathParams = {}, TAllParams = ParamsFallback<TPath, TParams>, TParentContext extends AnyContext = AnyContext, TAllParentContext extends AnyContext = AnyContext, TRouteContext extends RouteContext = RouteContext, TAllContext extends AnyContext = AnyContext> = RoutePathOptions<TCustomId, TPath> & {
@@ -447,10 +451,8 @@ type UpdatableRouteOptions<TLoader, TSearchSchema extends AnySearchSchema, TFull
447
451
  caseSensitive?: boolean;
448
452
  wrapInSuspense?: boolean;
449
453
  component?: RegisteredRouteComponent<RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>>;
450
- errorComponent?: RegisteredRouteErrorComponent<{
451
- error: unknown;
452
- } & Partial<RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>>>;
453
- pendingComponent?: RegisteredRouteComponent<RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>>;
454
+ errorComponent?: RegisteredRouteErrorComponent<ErrorRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext>>;
455
+ pendingComponent?: RegisteredRouteComponent<PendingRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext>>;
454
456
  preSearchFilters?: SearchFilter<TFullSearchSchema>[];
455
457
  postSearchFilters?: SearchFilter<TFullSearchSchema>[];
456
458
  preloadMaxAge?: number;
@@ -621,10 +623,8 @@ declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute e
621
623
  caseSensitive?: boolean | undefined;
622
624
  wrapInSuspense?: boolean | undefined;
623
625
  component?: ((props: RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>) => unknown) | undefined;
624
- errorComponent?: ((props: {
625
- error: unknown;
626
- } & Partial<RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>>) => unknown) | undefined;
627
- pendingComponent?: ((props: RouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TContext>) => unknown) | undefined;
626
+ errorComponent?: ((props: ErrorRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext>) => unknown) | undefined;
627
+ pendingComponent?: ((props: PendingRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TContext>) => unknown) | undefined;
628
628
  preSearchFilters?: SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
629
629
  postSearchFilters?: SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
630
630
  preloadMaxAge?: number | undefined;
@@ -761,4 +761,4 @@ type ScrollRestorationOptions = {
761
761
  declare function watchScrollPositions(router: AnyRouter, opts?: ScrollRestorationOptions): () => void;
762
762
  declare function restoreScrollPositions(router: AnyRouter, opts?: ScrollRestorationOptions): void;
763
763
 
764
- export { ActiveOptions, AllParams, AnyContext, AnyPathParams, AnyRedirect, AnyRootRoute, AnyRoute, AnyRouteMatch, AnyRouteProps, AnyRouter, AnySearchSchema, BaseRouteOptions, BuildNextOptions, CheckId, CheckIdError, CheckPath, CheckPathError, CheckRelativePath, CleanPath, ComponentFromRoute, ComponentPropsFromRoute, DeepAwaited, DefinedPathParamWarning, DehydratedRouter, DehydratedRouterState, Expand, FileRoute, FileRoutePath, FileRoutesByPath, FromLocation, FullSearchSchema, GetKeyFn, HydrationCtx, InferFullSearchSchema, IsAny, IsAnyBoolean, IsKnown, Join, Last, LinkInfo, LinkOptions, ListenerFn, LoaderContext, LoaderFn, LocationState, MatchLocation, MatchRouteOptions, MergeParamsFromParent, MergeUnion, MetaOptions, NavigateOptions, NoInfer, ParamsFallback, ParentParams, ParseParamsFn, ParseParamsObj, ParseParamsOption, ParsePathParams, ParseRoute, ParseRouteChildren, ParsedLocation, ParsedPath, PathParamError, PathParamMask, PathParamOptions, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickRequired, PickUnsafe, PreloadableObj, Redirect, Register, RegisterRouteComponent, RegisterRouteErrorComponent, RegisteredRouteComponent, RegisteredRouteErrorComponent, RegisteredRouter, RelativeToPathAutoComplete, RemoveUnderScores, ResolveFilePath, ResolveFullPath, ResolveFullSearchSchema, ResolveId, ResolveRelativePath, RootRoute, RootRouteId, Route, RouteById, RouteByPath, RouteConstraints, RouteContext, RouteIds, RouteLoaderFromRoute, RouteMatch, RouteMeta, RouteOptions, RoutePathOptions, RoutePathOptionsIntersection, RoutePaths, RouteProps, Router, RouterConstructorOptions, RouterContext, RouterContextOptions, RouterEvent, RouterEvents, RouterHistory, RouterListener, RouterLocation, RouterOptions, RouterState, RoutesById, RoutesByPath, ScrollRestorationOptions, SearchFilter, SearchParamError, SearchParamOptions, SearchParser, SearchSchemaValidator, SearchSchemaValidatorFn, SearchSchemaValidatorObj, SearchSerializer, Segment, Split, StreamedPromise, Timeout, ToIdOption, ToOptions, ToPathOption, Trim, TrimLeft, TrimPath, TrimPathLeft, TrimPathRight, TrimRight, UnionToIntersection, UnloaderFn, UpdatableRouteOptions, Updater, UseLoaderResult, UseLoaderResultPromise, ValueKeys, Values, cleanPath, componentTypes, createBrowserHistory, createHashHistory, createMemoryHistory, decode, defaultParseSearch, defaultStringifySearch, encode, functionalUpdate, interpolatePath, isPlainObject, isRedirect, joinPaths, last, lazyFn, matchByPath, matchPathname, parsePathname, parseSearchWith, partialDeepEqual, pick, redirect, replaceEqualDeep, resolvePath, restoreScrollPositions, rootRouteId, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, watchScrollPositions };
764
+ export { ActiveOptions, AllParams, AnyContext, AnyPathParams, AnyRedirect, AnyRootRoute, AnyRoute, AnyRouteMatch, AnyRouteProps, AnyRouter, AnySearchSchema, BaseRouteOptions, BuildNextOptions, CheckId, CheckIdError, CheckPath, CheckPathError, CheckRelativePath, CleanPath, ComponentFromRoute, ComponentPropsFromRoute, DeepAwaited, DefinedPathParamWarning, DehydratedRouter, DehydratedRouterState, ErrorRouteProps, Expand, FileRoute, FileRoutePath, FileRoutesByPath, FromLocation, FullSearchSchema, GetKeyFn, HydrationCtx, InferFullSearchSchema, IsAny, IsAnyBoolean, IsKnown, Join, Last, LinkInfo, LinkOptions, ListenerFn, LoaderContext, LoaderFn, LocationState, MatchLocation, MatchRouteOptions, MergeParamsFromParent, MergeUnion, MetaOptions, NavigateOptions, NoInfer, ParamsFallback, ParentParams, ParseParamsFn, ParseParamsObj, ParseParamsOption, ParsePathParams, ParseRoute, ParseRouteChildren, ParsedLocation, ParsedPath, PathParamError, PathParamMask, PathParamOptions, PendingRouteProps, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickRequired, PickUnsafe, PreloadableObj, Redirect, Register, RegisterRouteComponent, RegisterRouteErrorComponent, RegisteredRouteComponent, RegisteredRouteErrorComponent, RegisteredRouter, RelativeToPathAutoComplete, RemoveUnderScores, ResolveFilePath, ResolveFullPath, ResolveFullSearchSchema, ResolveId, ResolveRelativePath, RootRoute, RootRouteId, Route, RouteById, RouteByPath, RouteConstraints, RouteContext, RouteIds, RouteLoaderFromRoute, RouteMatch, RouteMeta, RouteOptions, RoutePathOptions, RoutePathOptionsIntersection, RoutePaths, RouteProps, Router, RouterConstructorOptions, RouterContext, RouterContextOptions, RouterEvent, RouterEvents, RouterHistory, RouterListener, RouterLocation, RouterOptions, RouterState, RoutesById, RoutesByPath, ScrollRestorationOptions, SearchFilter, SearchParamError, SearchParamOptions, SearchParser, SearchSchemaValidator, SearchSchemaValidatorFn, SearchSchemaValidatorObj, SearchSerializer, Segment, Split, StreamedPromise, Timeout, ToIdOption, ToOptions, ToPathOption, Trim, TrimLeft, TrimPath, TrimPathLeft, TrimPathRight, TrimRight, UnionToIntersection, UnloaderFn, UpdatableRouteOptions, Updater, UseLoaderResult, UseLoaderResultPromise, ValueKeys, Values, cleanPath, componentTypes, createBrowserHistory, createHashHistory, createMemoryHistory, decode, defaultParseSearch, defaultStringifySearch, encode, functionalUpdate, interpolatePath, isPlainObject, isRedirect, joinPaths, last, lazyFn, matchByPath, matchPathname, parsePathname, parseSearchWith, partialDeepEqual, pick, redirect, replaceEqualDeep, resolvePath, restoreScrollPositions, rootRouteId, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, watchScrollPositions };