@tanstack/react-router 0.0.1-beta.56 → 0.0.1-beta.58

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.
@@ -7,31 +7,31 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "9447-103",
10
+ "uid": "c2ff-99",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
14
14
  "name": "node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
15
- "uid": "9447-105"
15
+ "uid": "c2ff-101"
16
16
  },
17
17
  {
18
18
  "name": "packages",
19
19
  "children": [
20
20
  {
21
21
  "name": "store/build/esm/index.js",
22
- "uid": "9447-107"
22
+ "uid": "c2ff-103"
23
23
  },
24
24
  {
25
25
  "name": "router/build/esm/index.js",
26
- "uid": "9447-109"
26
+ "uid": "c2ff-105"
27
27
  },
28
28
  {
29
29
  "name": "react-store/build/esm/index.js",
30
- "uid": "9447-111"
30
+ "uid": "c2ff-107"
31
31
  },
32
32
  {
33
33
  "name": "react-router/src/index.tsx",
34
- "uid": "9447-113"
34
+ "uid": "c2ff-109"
35
35
  }
36
36
  ]
37
37
  }
@@ -41,155 +41,155 @@
41
41
  "isRoot": true
42
42
  },
43
43
  "nodeParts": {
44
- "9447-103": {
44
+ "c2ff-99": {
45
45
  "renderedLength": 429,
46
46
  "gzipLength": 238,
47
47
  "brotliLength": 0,
48
- "mainUid": "9447-102"
48
+ "mainUid": "c2ff-98"
49
49
  },
50
- "9447-105": {
50
+ "c2ff-101": {
51
51
  "renderedLength": 181,
52
52
  "gzipLength": 129,
53
53
  "brotliLength": 0,
54
- "mainUid": "9447-104"
54
+ "mainUid": "c2ff-100"
55
55
  },
56
- "9447-107": {
57
- "renderedLength": 1247,
58
- "gzipLength": 489,
56
+ "c2ff-103": {
57
+ "renderedLength": 1290,
58
+ "gzipLength": 496,
59
59
  "brotliLength": 0,
60
- "mainUid": "9447-106"
60
+ "mainUid": "c2ff-102"
61
61
  },
62
- "9447-109": {
63
- "renderedLength": 43403,
64
- "gzipLength": 10501,
62
+ "c2ff-105": {
63
+ "renderedLength": 44621,
64
+ "gzipLength": 10817,
65
65
  "brotliLength": 0,
66
- "mainUid": "9447-108"
66
+ "mainUid": "c2ff-104"
67
67
  },
68
- "9447-111": {
68
+ "c2ff-107": {
69
69
  "renderedLength": 1571,
70
70
  "gzipLength": 594,
71
71
  "brotliLength": 0,
72
- "mainUid": "9447-110"
72
+ "mainUid": "c2ff-106"
73
73
  },
74
- "9447-113": {
75
- "renderedLength": 11728,
74
+ "c2ff-109": {
75
+ "renderedLength": 11729,
76
76
  "gzipLength": 3116,
77
77
  "brotliLength": 0,
78
- "mainUid": "9447-112"
78
+ "mainUid": "c2ff-108"
79
79
  }
80
80
  },
81
81
  "nodeMetas": {
82
- "9447-102": {
82
+ "c2ff-98": {
83
83
  "id": "\u0000rollupPluginBabelHelpers.js",
84
84
  "moduleParts": {
85
- "index.production.js": "9447-103"
85
+ "index.production.js": "c2ff-99"
86
86
  },
87
87
  "imported": [],
88
88
  "importedBy": [
89
89
  {
90
- "uid": "9447-112"
90
+ "uid": "c2ff-108"
91
91
  }
92
92
  ]
93
93
  },
94
- "9447-104": {
94
+ "c2ff-100": {
95
95
  "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
96
96
  "moduleParts": {
97
- "index.production.js": "9447-105"
97
+ "index.production.js": "c2ff-101"
98
98
  },
99
99
  "imported": [],
100
100
  "importedBy": [
101
101
  {
102
- "uid": "9447-108"
102
+ "uid": "c2ff-104"
103
103
  }
104
104
  ]
105
105
  },
106
- "9447-106": {
106
+ "c2ff-102": {
107
107
  "id": "/packages/store/build/esm/index.js",
108
108
  "moduleParts": {
109
- "index.production.js": "9447-107"
109
+ "index.production.js": "c2ff-103"
110
110
  },
111
111
  "imported": [],
112
112
  "importedBy": [
113
113
  {
114
- "uid": "9447-108"
114
+ "uid": "c2ff-104"
115
115
  }
116
116
  ]
117
117
  },
118
- "9447-108": {
118
+ "c2ff-104": {
119
119
  "id": "/packages/router/build/esm/index.js",
120
120
  "moduleParts": {
121
- "index.production.js": "9447-109"
121
+ "index.production.js": "c2ff-105"
122
122
  },
123
123
  "imported": [
124
124
  {
125
- "uid": "9447-104"
125
+ "uid": "c2ff-100"
126
126
  },
127
127
  {
128
- "uid": "9447-106"
128
+ "uid": "c2ff-102"
129
129
  }
130
130
  ],
131
131
  "importedBy": [
132
132
  {
133
- "uid": "9447-112"
133
+ "uid": "c2ff-108"
134
134
  }
135
135
  ]
136
136
  },
137
- "9447-110": {
137
+ "c2ff-106": {
138
138
  "id": "/packages/react-store/build/esm/index.js",
139
139
  "moduleParts": {
140
- "index.production.js": "9447-111"
140
+ "index.production.js": "c2ff-107"
141
141
  },
142
142
  "imported": [
143
143
  {
144
- "uid": "9447-115"
144
+ "uid": "c2ff-111"
145
145
  }
146
146
  ],
147
147
  "importedBy": [
148
148
  {
149
- "uid": "9447-112"
149
+ "uid": "c2ff-108"
150
150
  }
151
151
  ]
152
152
  },
153
- "9447-112": {
153
+ "c2ff-108": {
154
154
  "id": "/packages/react-router/src/index.tsx",
155
155
  "moduleParts": {
156
- "index.production.js": "9447-113"
156
+ "index.production.js": "c2ff-109"
157
157
  },
158
158
  "imported": [
159
159
  {
160
- "uid": "9447-102"
160
+ "uid": "c2ff-98"
161
161
  },
162
162
  {
163
- "uid": "9447-114"
163
+ "uid": "c2ff-110"
164
164
  },
165
165
  {
166
- "uid": "9447-108"
166
+ "uid": "c2ff-104"
167
167
  },
168
168
  {
169
- "uid": "9447-110"
169
+ "uid": "c2ff-106"
170
170
  }
171
171
  ],
172
172
  "importedBy": [],
173
173
  "isEntry": true
174
174
  },
175
- "9447-114": {
175
+ "c2ff-110": {
176
176
  "id": "react",
177
177
  "moduleParts": {},
178
178
  "imported": [],
179
179
  "importedBy": [
180
180
  {
181
- "uid": "9447-112"
181
+ "uid": "c2ff-108"
182
182
  }
183
183
  ],
184
184
  "isExternal": true
185
185
  },
186
- "9447-115": {
186
+ "c2ff-111": {
187
187
  "id": "use-sync-external-store/shim/with-selector",
188
188
  "moduleParts": {},
189
189
  "imported": [],
190
190
  "importedBy": [
191
191
  {
192
- "uid": "9447-110"
192
+ "uid": "c2ff-106"
193
193
  }
194
194
  ],
195
195
  "isExternal": true
@@ -9,7 +9,7 @@
9
9
  * @license MIT
10
10
  */
11
11
  import * as React from 'react';
12
- import { RegisteredAllRouteInfo, LinkOptions, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, ValidFromPath, RegisteredRouter, AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, Router, RouterOptions, DefaultAllRouteInfo, RouterStore, RouteMatch, Route, Expand } from '@tanstack/router';
12
+ import { RegisteredRoutesInfo, LinkOptions, ToOptions, MatchRouteOptions, RouteByPath, ResolveRelativePath, NoInfer, ValidFromPath, RegisteredRouter, AnyRoute, Route, AnyRoutesInfo, RoutesInfo, Router, RouterOptions, DefaultRoutesInfo, RouterStore, RouteMatch, Expand } from '@tanstack/router';
13
13
  export * from '@tanstack/router';
14
14
  export { useStore } from '@tanstack/react-store';
15
15
 
@@ -21,16 +21,16 @@ type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {
21
21
  declare function lazy(importer: () => Promise<{
22
22
  default: SyncRouteComponent;
23
23
  }>): RouteComponent;
24
- type LinkPropsOptions<TFrom extends RegisteredAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = LinkOptions<RegisteredAllRouteInfo, TFrom, TTo> & {
24
+ type LinkPropsOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = '.'> = LinkOptions<RegisteredRoutesInfo, TFrom, TTo> & {
25
25
  activeProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
26
26
  inactiveProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
27
27
  };
28
- type MakeUseMatchRouteOptions<TFrom extends RegisteredAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = ToOptions<RegisteredAllRouteInfo, TFrom, TTo> & MatchRouteOptions;
29
- type MakeMatchRouteOptions<TFrom extends RegisteredAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = ToOptions<RegisteredAllRouteInfo, TFrom, TTo> & MatchRouteOptions & {
30
- children?: ReactNode | ((params: RouteInfoByPath<RegisteredAllRouteInfo, ResolveRelativePath<TFrom, NoInfer<TTo>>>['allParams']) => ReactNode);
28
+ type MakeUseMatchRouteOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = '.'> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions;
29
+ type MakeMatchRouteOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = '.'> = ToOptions<RegisteredRoutesInfo, TFrom, TTo> & MatchRouteOptions & {
30
+ children?: ReactNode | ((params: RouteByPath<RegisteredRoutesInfo, ResolveRelativePath<TFrom, NoInfer<TTo>>>['__types']['allParams']) => ReactNode);
31
31
  };
32
- type MakeLinkPropsOptions<TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/', TTo extends string = '.'> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>;
33
- type MakeLinkOptions<TFrom extends RegisteredAllRouteInfo['routePaths'] = '/', TTo extends string = '.'> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
32
+ type MakeLinkPropsOptions<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = '.'> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>;
33
+ type MakeLinkOptions<TFrom extends RegisteredRoutesInfo['routePaths'] = '/', TTo extends string = '.'> = LinkPropsOptions<TFrom, TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
34
34
  children?: ReactNode | ((state: {
35
35
  isActive: boolean;
36
36
  }) => ReactNode);
@@ -45,7 +45,7 @@ declare module '@tanstack/router' {
45
45
  };
46
46
  }>;
47
47
  }
48
- interface RouterOptions<TRouteConfig, TRouterContext> {
48
+ interface RouterOptions<TRouteTree, TRouterContext> {
49
49
  }
50
50
  }
51
51
  type PromptProps = {
@@ -53,9 +53,9 @@ type PromptProps = {
53
53
  when?: boolean | any;
54
54
  children?: ReactNode;
55
55
  };
56
- declare function useLinkProps<TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/', TTo extends string = '.'>(options: MakeLinkPropsOptions<TFrom, TTo>): React.AnchorHTMLAttributes<HTMLAnchorElement>;
57
- interface LinkFn<TDefaultFrom extends RegisteredAllRouteInfo['routePaths'] = '/', TDefaultTo extends string = '.'> {
58
- <TFrom extends RegisteredAllRouteInfo['routePaths'] = TDefaultFrom, TTo extends string = TDefaultTo>(props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>): ReactNode;
56
+ declare function useLinkProps<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = '.'>(options: MakeLinkPropsOptions<TFrom, TTo>): React.AnchorHTMLAttributes<HTMLAnchorElement>;
57
+ interface LinkFn<TDefaultFrom extends RegisteredRoutesInfo['routePaths'] = '/', TDefaultTo extends string = '.'> {
58
+ <TFrom extends RegisteredRoutesInfo['routePaths'] = TDefaultFrom, TTo extends string = TDefaultTo>(props: MakeLinkOptions<TFrom, TTo> & React.RefAttributes<HTMLAnchorElement>): ReactNode;
59
59
  }
60
60
  declare const Link: LinkFn;
61
61
  type MatchesContextValue = RouteMatch[];
@@ -67,37 +67,37 @@ type MatchesProviderProps = {
67
67
  value: MatchesContextValue;
68
68
  children: ReactNode;
69
69
  };
70
- declare class ReactRouter<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>, TRouterContext = unknown> extends Router<TRouteConfig, TAllRouteInfo, TRouterContext> {
70
+ declare class ReactRouter<TRouteConfig extends AnyRoute = Route, TRoutesInfo extends AnyRoutesInfo = RoutesInfo<TRouteConfig>, TRouterContext = unknown> extends Router<TRouteConfig, TRoutesInfo, TRouterContext> {
71
71
  constructor(opts: RouterOptions<TRouteConfig, TRouterContext>);
72
72
  }
73
- type RouterProps<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouterContext = unknown> = RouterOptions<TRouteConfig, TRouterContext> & {
74
- router: Router<TRouteConfig, TAllRouteInfo, TRouterContext>;
73
+ type RouterProps<TRouteConfig extends AnyRoute = Route, TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo, TRouterContext = unknown> = RouterOptions<TRouteConfig, TRouterContext> & {
74
+ router: Router<TRouteConfig, TRoutesInfo, TRouterContext>;
75
75
  };
76
- declare function RouterProvider<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouterContext = unknown>({ router, ...rest }: RouterProps<TRouteConfig, TAllRouteInfo, TRouterContext>): JSX.Element;
76
+ declare function RouterProvider<TRouteConfig extends AnyRoute = Route, TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo, TRouterContext = unknown>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo, TRouterContext>): JSX.Element;
77
77
  declare function useRouter(): RegisteredRouter;
78
78
  declare function useRouterStore<T = RouterStore>(selector?: (state: Router['store']) => T, shallow?: boolean): T;
79
79
  declare function useMatches(): RouteMatch[];
80
- declare function useMatch<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'], TStrict extends boolean = true, TRouteMatch = RouteMatch<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TFrom]>>(opts?: {
80
+ declare function useMatch<TFrom extends keyof RegisteredRoutesInfo['routesById'], TStrict extends boolean = true, TRouteMatch = RouteMatch<RegisteredRoutesInfo, RegisteredRoutesInfo['routesById'][TFrom]>>(opts?: {
81
81
  from: TFrom;
82
82
  strict?: TStrict;
83
83
  track?: (match: TRouteMatch) => any;
84
84
  shallow?: boolean;
85
85
  }): TStrict extends true ? TRouteMatch : TRouteMatch | undefined;
86
- declare function useRoute<TId extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/'>(routeId: TId): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]>;
87
- declare function useSearch<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'], TStrict extends boolean = true, TSearch = RegisteredAllRouteInfo['routeInfoById'][TFrom]['fullSearchSchema'], TSelected = TSearch>(opts?: {
86
+ declare function useRoute<TId extends keyof RegisteredRoutesInfo['routesById'] = '/'>(routeId: TId): RegisteredRoutesInfo['routesById'][TId];
87
+ declare function useSearch<TFrom extends keyof RegisteredRoutesInfo['routesById'], TStrict extends boolean = true, TSearch = RegisteredRoutesInfo['routesById'][TFrom]['__types']['fullSearchSchema'], TSelected = TSearch>(opts?: {
88
88
  from: TFrom;
89
89
  strict?: TStrict;
90
90
  track?: (search: TSearch) => TSelected;
91
91
  }): TStrict extends true ? TSelected : TSelected | undefined;
92
- declare function useParams<TFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/', TDefaultSelected = Expand<RegisteredAllRouteInfo['allParams'] & RegisteredAllRouteInfo['routeInfoById'][TFrom]['allParams']>, TSelected = TDefaultSelected>(opts?: {
92
+ declare function useParams<TFrom extends keyof RegisteredRoutesInfo['routesById'] = '/', TDefaultSelected = Expand<RegisteredRoutesInfo['allParams'] & RegisteredRoutesInfo['routesById'][TFrom]['__types']['allParams']>, TSelected = TDefaultSelected>(opts?: {
93
93
  from: TFrom;
94
94
  track?: (search: TDefaultSelected) => TSelected;
95
95
  }): TSelected;
96
- declare function useNavigate<TDefaultFrom extends keyof RegisteredAllRouteInfo['routeInfoById'] = '/'>(defaultOpts?: {
96
+ declare function useNavigate<TDefaultFrom extends keyof RegisteredRoutesInfo['routesById'] = '/'>(defaultOpts?: {
97
97
  from?: TDefaultFrom;
98
98
  }): <TFrom extends string = TDefaultFrom, TTo extends string = ".">(opts?: MakeLinkOptions<TFrom, TTo> | undefined) => Promise<void>;
99
- declare function useMatchRoute(): <TFrom extends ValidFromPath<AnyAllRouteInfo> = "/", TTo extends string = ".">(opts: MakeUseMatchRouteOptions<TFrom, TTo>) => false;
100
- declare function MatchRoute<TFrom extends ValidFromPath<RegisteredAllRouteInfo> = '/', TTo extends string = '.'>(props: MakeMatchRouteOptions<TFrom, TTo>): any;
99
+ declare function useMatchRoute(): <TFrom extends ValidFromPath<AnyRoutesInfo> = "/", TTo extends string = ".">(opts: MakeUseMatchRouteOptions<TFrom, TTo>) => any;
100
+ declare function MatchRoute<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = '.'>(props: MakeMatchRouteOptions<TFrom, TTo>): any;
101
101
  declare function Outlet(): JSX.Element | null;
102
102
  declare function DefaultErrorBoundary({ error }: {
103
103
  error: any;