Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

§Classes

AbortedDeferredError
ErrorResponse
UNSAFE_DeferredData

§Enums

Action

Actions represent the type of change to a location value.

§Variables

defer
IDLE_BLOCKER
IDLE_FETCHER
IDLE_NAVIGATION
joinPaths
json

This is a shortcut for creating application/json responses. Converts data to JSON and sets the Content-Type header.

normalizePathname
redirect

A redirect response. Sets the status code and the Location header. Defaults to "302 Found".

UNSAFE_DEFERRED_SYMBOL

§Functions

createBrowserHistory

Browser history stores the location in regular URLs. This is the standard for most web apps, but it requires some configuration on the server to ensure you serve the same app at multiple URLs.

createHashHistory

Hash history stores the location in window.location.hash. This makes it ideal for situations where you don't want to send the location to the server for some reason, either because you do cannot configure it or the URL space is reserved for something else.

createMemoryHistory

Memory history stores the current location in memory. It is designed for use in stateful non-browser environments like tests and React Native.

createPath

Creates a string URL path from the given pathname, search, and hash components.

createRouter

Create a router and listen to history POP navigations

createStaticHandler
generatePath

Returns a path with params interpolated.

getStaticContextFromError

Given an existing StaticHandlerContext and an error thrown at render time, provide an updated StaticHandlerContext suitable for a second SSR render

getToPathname
isRouteErrorResponse

Check if the given error is an ErrorResponse generated from a 4xx/5xx Response thrown from an action/loader

matchPath

Performs pattern matching on a URL pathname and returns information about the match.

matchRoutes

Matches the given routes to a location and returns the match data.

parsePath

Parses a string URL path into its separate pathname, search, and hash components.

resolvePath

Returns a resolved path object relative to the given pathname.

resolveTo
stripBasename
UNSAFE_convertRoutesToDataRoutes
UNSAFE_getPathContributingMatches
UNSAFE_invariant
warning

§Interfaces

ActionFunction

Route action function signature

ActionFunctionArgs

Arguments passed to action functions

AgnosticDataRouteMatch
AgnosticRouteMatch

A RouteMatch contains info about how a route matched a URL.

BrowserHistory

A browser history stores the current location in regular URLs in a web browser environment. This is the standard for most web apps and provides the cleanest URLs the browser's address bar.

GetScrollPositionFunction

Function signature for determining the current scroll position

GetScrollRestorationKeyFunction

Function signature for determining the key to be used in scroll restoration for a given location

HashHistory

A hash history stores the current location in the fragment identifier portion of the URL in a web browser environment.

History

A history is an interface to the navigation stack. The history serves as the source of truth for the current location, as well as provides a set of methods that may be used to change it.

LoaderFunction

Route loader function signature

LoaderFunctionArgs

Arguments passed to loader functions

Location

An entry in a history stack. A location contains information about the URL path, as well as possibly some arbitrary state and a key.

MemoryHistory

A memory history stores locations in memory. This is useful in stateful environments where there is no web browser, such as node tests or React Native.

Path

The pathname, search, and hash values of a URL.

PathMatch

A PathMatch contains info about how a PathPattern matched on a URL pathname.

PathPattern

A PathPattern is used to match on some portion of a URL pathname.

Router

A Router instance manages all navigation and data loading/mutations

RouterInit

Initialization options for createRouter

RouterState

State maintained internally by the router. During a navigation, all states reflect the the "old" location unless otherwise noted.

RouterSubscriber

Subscriber function signature for changes to router state

ShouldRevalidateFunction

Route shouldRevalidate function signature. This runs after any submission (navigation or fetcher), so we flatten the navigation/fetcher submission onto the arguments. It shouldn't matter whether it came from a navigation or a fetcher, what really matters is the URLs and the formData since loaders have to re-run based on the data models that were potentially mutated.

StaticHandler

A StaticHandler instance manages a singular SSR navigation/fetch event

StaticHandlerContext

State returned from a server-side query() call

Submission
TrackedPromise

§Type Aliases

AgnosticDataIndexRouteObject
AgnosticDataNonIndexRouteObject
AgnosticDataRouteObject

A data route object, which is just a RouteObject with a required unique ID

AgnosticIndexRouteObject

Index routes must not have children

AgnosticNonIndexRouteObject

Non-index routes may have children, but cannot have index

AgnosticRouteObject

A route object represents a logical route, with (optionally) its child routes organized in a tree-like structure.

Blocker
BlockerFunction
BrowserHistoryOptions
Fetcher
FormEncType
FormMethod
HashHistoryOptions
HydrationState

Data that can be passed into hydrate a Router from SSR

InitialEntry

A user-supplied object that describes a location. Used when providing entries to createMemoryHistory via its initialEntries option.

JsonFunction
MemoryHistoryOptions
Navigation
NavigationStates

Potential states for state.navigation

ParamParseKey
Params

The parameters that were parsed from the URL path.

RedirectFunction
RevalidationState
RouterFetchOptions

Options to pass to fetch()

RouterNavigateOptions

Options to pass to navigate() for either a Link or Form navigation

To

Describes a location that is the destination of some navigation, either via history.push or history.replace. May be either a URL or the pieces of a URL path.