Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

index.ts

446 lines9.1 KB

1export * from './global'
2​
3export { TSR_DEFERRED_PROMISE, defer } from './defer'
4export type { DeferredPromiseState, DeferredPromise } from './defer'
5export { preloadWarning } from './link'
6export type {
7 IsRequiredParams,
8 AddTrailingSlash,
9 RemoveTrailingSlashes,
10 AddLeadingSlash,
11 RemoveLeadingSlashes,
12 ActiveOptions,
13 LinkOptionsProps,
14 ResolveCurrentPath,
15 ResolveParentPath,
16 ResolveRelativePath,
17 LinkCurrentTargetElement,
18 FindDescendantToPaths,
19 InferDescendantToPaths,
20 RelativeToPath,
21 RelativeToParentPath,
22 RelativeToCurrentPath,
23 AbsoluteToPath,
24 RelativeToPathAutoComplete,
25 NavigateOptions,
26 ToOptions,
27 ToMaskOptions,
28 ToSubOptions,
29 ResolveRoute,
30 SearchParamOptions,
31 PathParamOptions,
32 ToPathOption,
33 LinkOptions,
34 MakeOptionalPathParams,
35 FromPathOption,
36 MakeOptionalSearchParams,
37 MaskOptions,
38 ToSubOptionsProps,
39 RequiredToOptions,
40} from './link'
41​
42export { componentTypes } from './load-matches'
43​
44export type {
45 RouteToPath,
46 TrailingSlashOptionByRouter,
47 ParseRoute,
48 CodeRouteToPath,
49 RouteIds,
50 FullSearchSchema,
51 FullSearchSchemaInput,
52 AllParams,
53 RouteById,
54 AllContext,
55 RoutePaths,
56 RoutesById,
57 RoutesByPath,
58 AllLoaderData,
59 RouteByPath,
60} from './routeInfo'
61​
62export type {
63 InferFileRouteTypes,
64 FileRouteTypes,
65 FileRoutesByPath,
66 CreateFileRoute,
67 LazyRoute,
68 LazyRouteOptions,
69 CreateLazyFileRoute,
70} from './fileRoute'
71​
72export type { ParsedLocation } from './location'
73export type { Manifest, RouterManagedTag } from './manifest'
74export { isMatch } from './Matches'
75export type {
76 AnyMatchAndValue,
77 FindValueByIndex,
78 FindValueByKey,
79 CreateMatchAndValue,
80 NextMatchAndValue,
81 IsMatchKeyOf,
82 IsMatchPath,
83 IsMatchResult,
84 IsMatchParse,
85 IsMatch,
86 RouteMatch,
87 RouteMatchExtensions,
88 MakeRouteMatchUnion,
89 MakeRouteMatch,
90 AnyRouteMatch,
91 MakeRouteMatchFromRoute,
92 MatchRouteOptions,
93} from './Matches'
94export {
95 joinPaths,
96 cleanPath,
97 trimPathLeft,
98 trimPathRight,
99 trimPath,
100 removeTrailingSlash,
101 exactPathTest,
102 resolvePath,
103 parsePathname,
104 interpolatePath,
105 matchPathname,
106 matchByPath,
107} from './path'
108export type { Segment } from './path'
109export { encode, decode } from './qss'
110export { rootRouteId } from './root'
111export type { RootRouteId } from './root'
112​
113export { BaseRoute, BaseRouteApi, BaseRootRoute } from './route'
114export type {
115 AnyPathParams,
116 SearchSchemaInput,
117 AnyContext,
118 RouteContext,
119 PreloadableObj,
120 RoutePathOptions,
121 StaticDataRouteOption,
122 RoutePathOptionsIntersection,
123 SearchFilter,
124 SearchMiddlewareContext,
125 SearchMiddleware,
126 ResolveId,
127 InferFullSearchSchema,
128 InferFullSearchSchemaInput,
129 InferAllParams,
130 InferAllContext,
131 MetaDescriptor,
132 RouteLinkEntry,
133 SearchValidator,
134 AnySearchValidator,
135 DefaultSearchValidator,
136 ErrorRouteProps,
137 ErrorComponentProps,
138 NotFoundRouteProps,
139 ResolveParams,
140 ParseParamsFn,
141 StringifyParamsFn,
142 ParamsOptions,
143 UpdatableStaticRouteOption,
144 ContextReturnType,
145 ContextAsyncReturnType,
146 ResolveRouteContext,
147 ResolveLoaderData,
148 RoutePrefix,
149 TrimPath,
150 TrimPathLeft,
151 TrimPathRight,
152 ResolveSearchSchemaFnInput,
153 ResolveSearchSchemaInput,
154 ResolveSearchSchemaFn,
155 ResolveSearchSchema,
156 ResolveFullSearchSchema,
157 ResolveFullSearchSchemaInput,
158 ResolveAllContext,
159 BeforeLoadContextParameter,
160 RouteContextParameter,
161 ResolveAllParamsFromParent,
162 AnyRoute,
163 Route,
164 RouteTypes,
165 FullSearchSchemaOption,
166 RemountDepsOptions,
167 MakeRemountDepsOptionsUnion,
168 ResolveFullPath,
169 AnyRouteWithContext,
170 RouteOptions,
171 FileBaseRouteOptions,
172 BaseRouteOptions,
173 UpdatableRouteOptions,
174 RouteLoaderFn,
175 LoaderFnContext,
176 RouteContextFn,
177 ContextOptions,
178 RouteContextOptions,
179 BeforeLoadContextOptions,
180 RootRouteOptions,
181 RootRouteOptionsExtensions,
182 UpdatableRouteOptionsExtensions,
183 RouteConstraints,
184 RouteTypesById,
185 RouteMask,
186 RouteExtensions,
187 RouteLazyFn,
188 RouteAddChildrenFn,
189 RouteAddFileChildrenFn,
190 RouteAddFileTypesFn,
191 ResolveOptionalParams,
192 ResolveRequiredParams,
193 RootRoute,
194 FilebaseRouteOptionsInterface,
195} from './route'
196export { processRouteTree } from './process-route-tree'
197export type { ProcessRouteTreeResult } from './process-route-tree'
198export {
199 defaultSerializeError,
200 getLocationChangeInfo,
201 RouterCore,
202 lazyFn,
203 SearchParamError,
204 PathParamError,
205 getInitialRouterState,
206 getMatchedRoutes,
207 trailingSlashOptions,
208} from './router'
209​
210export type {
211 ViewTransitionOptions,
212 TrailingSlashOption,
213 Register,
214 AnyRouter,
215 AnyRouterWithContext,
216 RegisteredRouter,
217 RouterState,
218 BuildNextOptions,
219 RouterListener,
220 RouterEvent,
221 ListenerFn,
222 RouterEvents,
223 MatchRoutesOpts,
224 RouterOptionsExtensions,
225 DefaultRemountDepsFn,
226 PreloadRouteFn,
227 MatchRouteFn,
228 RouterContextOptions,
229 RouterOptions,
230 RouterConstructorOptions,
231 UpdateFn,
232 ParseLocationFn,
233 InvalidateFn,
234 ControllablePromise,
235 InjectedHtmlEntry,
236 EmitFn,
237 LoadFn,
238 GetMatchFn,
239 SubscribeFn,
240 UpdateMatchFn,
241 CommitLocationFn,
242 GetMatchRoutesFn,
243 MatchRoutesFn,
244 StartTransitionFn,
245 LoadRouteChunkFn,
246 ClearCacheFn,
247 CreateRouterFn,
248 SSROption,
249} from './router'
250​
251export * from './config'
252​
253export type {
254 MatchLocation,
255 CommitLocationOptions,
256 NavigateFn,
257 BuildLocationFn,
258} from './RouterProvider'
259​
260export { retainSearchParams, stripSearchParams } from './searchMiddleware'
261​
262export {
263 defaultParseSearch,
264 defaultStringifySearch,
265 parseSearchWith,
266 stringifySearchWith,
267} from './searchParams'
268export type { SearchSerializer, SearchParser } from './searchParams'
269​
270export type { OptionalStructuralSharing } from './structuralSharing'
271​
272export {
273 last,
274 functionalUpdate,
275 replaceEqualDeep,
276 isPlainObject,
277 isPlainArray,
278 deepEqual,
279 createControlledPromise,
280 isModuleNotFoundError,
281 decodePath,
282} from './utils'
283export type {
284 NoInfer,
285 IsAny,
286 PickAsRequired,
287 PickRequired,
288 PickOptional,
289 WithoutEmpty,
290 Expand,
291 DeepPartial,
292 MakeDifferenceOptional,
293 IsUnion,
294 IsNonEmptyObject,
295 Assign,
296 IntersectAssign,
297 Timeout,
298 Updater,
299 NonNullableUpdater,
300 StringLiteral,
301 ThrowOrOptional,
302 ThrowConstraint,
303 ControlledPromise,
304 ExtractObjects,
305 PartialMergeAllObject,
306 MergeAllPrimitive,
307 ExtractPrimitives,
308 PartialMergeAll,
309 Constrain,
310 ConstrainLiteral,
311 UnionToIntersection,
312 MergeAllObjects,
313 MergeAll,
314 ValidateJSON,
315 StrictOrFrom,
316 LooseReturnType,
317 LooseAsyncReturnType,
318 Awaitable,
319} from './utils'
320​
321export type {
322 StandardSchemaValidatorProps,
323 StandardSchemaValidator,
324 AnyStandardSchemaValidator,
325 StandardSchemaValidatorTypes,
326 AnyStandardSchemaValidateSuccess,
327 AnyStandardSchemaValidateFailure,
328 AnyStandardSchemaValidateIssue,
329 AnyStandardSchemaValidateInput,
330 AnyStandardSchemaValidate,
331 ValidatorObj,
332 AnyValidatorObj,
333 ValidatorAdapter,
334 AnyValidatorAdapter,
335 AnyValidatorFn,
336 ValidatorFn,
337 Validator,
338 AnyValidator,
339 AnySchema,
340 DefaultValidator,
341 ResolveSearchValidatorInputFn,
342 ResolveSearchValidatorInput,
343 ResolveValidatorInputFn,
344 ResolveValidatorInput,
345 ResolveValidatorOutputFn,
346 ResolveValidatorOutput,
347} from './validators'
348​
349export type {
350 UseRouteContextBaseOptions,
351 UseRouteContextOptions,
352 UseRouteContextResult,
353} from './useRouteContext'
354​
355export type { UseSearchResult, ResolveUseSearch } from './useSearch'
356​
357export type { UseParamsResult, ResolveUseParams } from './useParams'
358​
359export type { UseNavigateResult } from './useNavigate'
360​
361export type { UseLoaderDepsResult, ResolveUseLoaderDeps } from './useLoaderDeps'
362​
363export type { UseLoaderDataResult, ResolveUseLoaderData } from './useLoaderData'
364​
365export type {
366 Redirect,
367 RedirectOptions,
368 ResolvedRedirect,
369 AnyRedirect,
370} from './redirect'
371​
372export {
373 redirect,
374 isRedirect,
375 isResolvedRedirect,
376 parseRedirect,
377} from './redirect'
378​
379export type { NotFoundError } from './not-found'
380export { isNotFound, notFound } from './not-found'
381​
382export {
383 defaultGetScrollRestorationKey,
384 restoreScroll,
385 storageKey,
386 getCssSelector,
387 scrollRestorationCache,
388 setupScrollRestoration,
389 handleHashScroll,
390} from './scroll-restoration'
391​
392export type {
393 ScrollRestorationOptions,
394 ScrollRestorationEntry,
395} from './scroll-restoration'
396​
397export type {
398 ValidateFromPath,
399 ValidateToPath,
400 ValidateSearch,
401 ValidateParams,
402 InferFrom,
403 InferTo,
404 InferMaskTo,
405 InferMaskFrom,
406 ValidateNavigateOptions,
407 ValidateNavigateOptionsArray,
408 ValidateRedirectOptions,
409 ValidateRedirectOptionsArray,
410 ValidateId,
411 InferStrict,
412 InferShouldThrow,
413 InferSelected,
414 ValidateUseSearchResult,
415 ValidateUseParamsResult,
416} from './typePrimitives'
417​
418export type {
419 AnySerializationAdapter,
420 SerializationAdapter,
421 ValidateSerializableInput,
422 ValidateSerializableInputResult,
423 SerializerExtensions,
424 ValidateSerializable,
425 RegisteredSerializableInput,
426 SerializableExtensions,
427 DefaultSerializable,
428 Serializable,
429 TSR_SERIALIZABLE,
430 TsrSerializable,
431} from './ssr/serializer/transformer'
432​
433export {
434 createSerializationAdapter,
435 makeSerovalPlugin,
436 makeSsrSerovalPlugin,
437} from './ssr/serializer/transformer'
438​
439export { defaultSerovalPlugins } from './ssr/serializer/seroval-plugins'
440​
441export {
442 composeRewrites,
443 executeRewriteInput,
444 executeRewriteOutput,
445} from './rewrite'
446export type { LocationRewrite, LocationRewriteFunction } from './router'