@tanstack/react-router 1.7.0 → 1.7.1
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.
- package/build/cjs/link.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +403 -403
- package/build/types/link.d.ts +3 -1
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/link.tsx +24 -16
package/build/types/link.d.ts
CHANGED
|
@@ -45,7 +45,9 @@ export type ToSubOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTr
|
|
|
45
45
|
} & CheckPath<TRouteTree, NoInfer<TResolved>, {}> & SearchParamOptions<TRouteTree, TFrom, TTo, TResolved> & PathParamOptions<TRouteTree, TFrom, TTo, TResolved>;
|
|
46
46
|
type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
|
|
47
47
|
type ParamVariant = 'PATH' | 'SEARCH';
|
|
48
|
-
|
|
48
|
+
type ExcludeRootSearchSchema<T, Excluded = Exclude<T, RootSearchSchema>> = [Excluded] extends [never] ? {} : Excluded;
|
|
49
|
+
type PostProcessParams<T, TParamVariant extends ParamVariant> = TParamVariant extends 'SEARCH' ? ExcludeRootSearchSchema<T> : T;
|
|
50
|
+
export type ParamOptions<TRouteTree extends AnyRoute, TFrom, TTo extends string, TResolved, TParamVariant extends ParamVariant, TFromRouteType extends 'allParams' | 'fullSearchSchema' = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchema', TToRouteType extends 'allParams' | 'fullSearchSchemaInput' = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchemaInput', TFromParams = PostProcessParams<RouteByPath<TRouteTree, TFrom>['types'][TFromRouteType], TParamVariant>, TToIndex = TTo extends '' ? '' : RouteByPath<TRouteTree, `${TTo}/`> extends never ? TTo : `${TTo}/`, TToParams = TToIndex extends '' ? TFromParams : never extends TResolved ? PostProcessParams<RouteByPath<TRouteTree, TToIndex>['types'][TToRouteType], TParamVariant> : PostProcessParams<RouteByPath<TRouteTree, TResolved>['types'][TToRouteType], TParamVariant>, TReducer = ParamsReducer<TFromParams, TToParams>> = Expand<WithoutEmpty<PickRequired<TToParams>>> extends never ? Partial<MakeParamOption<TParamVariant, true | TReducer>> : TFromParams extends Expand<WithoutEmpty<PickRequired<TToParams>>> ? MakeParamOption<TParamVariant, true | TReducer> : MakeParamOption<TParamVariant, TReducer>;
|
|
49
51
|
type MakeParamOption<TParamVariant extends ParamVariant, T> = TParamVariant extends 'PATH' ? MakePathParamOptions<T> : MakeSearchParamOptions<T>;
|
|
50
52
|
type MakeSearchParamOptions<T> = {
|
|
51
53
|
search: T;
|