@@ -842,6 +842,15 @@ export type CreateRouterFn = <
842842 TDehydrated
843843>
844844
845+ /**
846+ * Core, framework-agnostic router engine that powers TanStack Router.
847+ *
848+ * Provides navigation, matching, loading, preloading, caching and event APIs
849+ * used by framework adapters (React/Solid). Prefer framework helpers like
850+ * `createRouter` in app code.
851+ *
852+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType
853+ */
845854export class RouterCore <
846855 in out TRouteTree extends AnyRoute ,
847856 in out TTrailingSlashOption extends TrailingSlashOption ,
@@ -1096,6 +1105,12 @@ export class RouterCore<
10961105 }
10971106 }
10981107
1108+ /**
1109+ * Subscribe to router lifecycle events like `onBeforeNavigate`, `onLoad`,
1110+ * `onResolved`, etc. Returns an unsubscribe function.
1111+ *
1112+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterEventsType
1113+ */
10991114 subscribe : SubscribeFn = ( eventType , fn ) => {
11001115 const listener : RouterListener < any > = {
11011116 eventType,
@@ -1117,6 +1132,10 @@ export class RouterCore<
11171132 } )
11181133 }
11191134
1135+ /**
1136+ * Parse a HistoryLocation into a strongly-typed ParsedLocation using the
1137+ * current router options, rewrite rules and search parser/stringifier.
1138+ */
11201139 parseLocation : ParseLocationFn < TRouteTree > = (
11211140 locationToParse ,
11221141 previousLocation ,
@@ -1172,6 +1191,7 @@ export class RouterCore<
11721191 return location
11731192 }
11741193
1194+ /** Resolve a path against the router basepath and trailing-slash policy. */
11751195 resolvePathWithBase = ( from : string , path : string ) => {
11761196 const resolvedPath = resolvePath ( {
11771197 base : from ,
@@ -1538,6 +1558,13 @@ export class RouterCore<
15381558 } )
15391559 }
15401560
1561+ /**
1562+ * Build the next ParsedLocation from navigation options without committing.
1563+ * Resolves `to`/`from`, params/search/hash/state, applies search validation
1564+ * and middlewares, and returns a stable, stringified location object.
1565+ *
1566+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType#buildlocation-method
1567+ */
15411568 buildLocation : BuildLocationFn = ( opts ) => {
15421569 const build = (
15431570 dest : BuildNextOptions & {
@@ -1785,6 +1812,10 @@ export class RouterCore<
17851812
17861813 commitLocationPromise : undefined | ControlledPromise < void >
17871814
1815+ /**
1816+ * Commit a previously built location to history (push/replace), optionally
1817+ * using view transitions and scroll restoration options.
1818+ */
17881819 commitLocation : CommitLocationFn = ( {
17891820 viewTransition,
17901821 ignoreBlocker,
@@ -1875,6 +1906,7 @@ export class RouterCore<
18751906 return this . commitLocationPromise
18761907 }
18771908
1909+ /** Convenience helper: build a location from options, then commit it. */
18781910 buildAndCommitLocation = ( {
18791911 replace,
18801912 resetScroll,
@@ -1911,6 +1943,13 @@ export class RouterCore<
19111943 } )
19121944 }
19131945
1946+ /**
1947+ * Imperatively navigate using standard `NavigateOptions`. When `reloadDocument`
1948+ * or an absolute `href` is provided, performs a full document navigation.
1949+ * Otherwise, builds and commits a client-side location.
1950+ *
1951+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType
1952+ */
19141953 navigate : NavigateFn = ( { to, reloadDocument, href, ...rest } ) => {
19151954 if ( ! reloadDocument && href ) {
19161955 try {
0 commit comments