Package-level declarations

Types

Link copied to clipboard
typealias BlockerFn = (args: BlockerFnArgs) -> Any?
Link copied to clipboard
external interface BlockerFnArgs
Link copied to clipboard
external interface CreateBrowserHistoryOpts
Link copied to clipboard
external interface CreateHashHistoryOpts
Link copied to clipboard
external interface CreateHistoryOpts
Link copied to clipboard
external interface CreateMemoryHistoryOpts
Link copied to clipboard
sealed external interface HistoryAction
Link copied to clipboard
external interface HistoryLocation : ParsedPath
Link copied to clipboard
external interface HistoryState
Link copied to clipboard
external interface NavigateOptions
Link copied to clipboard
external interface NavigationBlocker
Link copied to clipboard
external interface ParsedHistoryState : HistoryState
Link copied to clipboard
external interface ParsedPath
Link copied to clipboard
external interface RouterHistory
Link copied to clipboard
Link copied to clipboard
external interface SubscriberArgs
Link copied to clipboard

Functions

Link copied to clipboard
external fun createBrowserHistory(opts: CreateBrowserHistoryOpts = definedExternally): RouterHistory

Creates a history object that can be used to interact with the browser's navigation. This is a lightweight API wrapping the browser's native methods. It is designed to work with TanStack Router, but could be used as a standalone API as well. IMPORTANT: This API implements history throttling via a microtask to prevent excessive calls to the history API. In some browsers, calling history.pushState or history.replaceState in quick succession can cause the browser to ignore subsequent calls. This API smooths out those differences and ensures that your application state will eventually match the browser state. In most cases, this is not a problem, but if you need to ensure that the browser state is up to date, you can use the history.flush method to immediately flush all pending state changes to the browser URL.

Link copied to clipboard
external fun createHashHistory(opts: CreateHashHistoryOpts = definedExternally): RouterHistory

Create a hash-based history implementation. Useful for static hosts or environments without server URL rewriting.

Link copied to clipboard
Link copied to clipboard
external fun createMemoryHistory(opts: CreateMemoryHistoryOpts = definedExternally): RouterHistory

Create an in-memory history implementation. Ideal for server rendering, tests, and non-DOM environments.

Link copied to clipboard
external fun parseHref(href: String, state: ParsedHistoryState?): HistoryLocation