This page documents all major TypeScript types exported by nuqs. These types help you build type-safe applications with full IntelliSense support.
Options Types
Options
The main options object for configuring URL updates and navigation behavior.
Usage:
HistoryOptions
Controls how URL updates affect browser history.
'replace' (default): Updates the current history entry
'push': Creates a new history entry (enables back/forward navigation)
LimitUrlUpdates
Configuration for rate-limiting URL updates.
Usage:
SearchParams
Type representing URL search parameters as an object.
Usage:
Parser Types
SingleParser
Defines a parser for single-value query parameters.
Usage:
MultiParser
Defines a parser for multi-value query parameters (e.g., ?tag=a&tag=b).
Usage:
SingleParserBuilder
Enhanced parser with builder methods for setting defaults and options.
Usage:
GenericParser
Union type for single or multi parsers.
GenericParserBuilder
Union type for parser builders.
ParserMap
Object mapping keys to parsers, used with useQueryStates.
Usage:
Hook Return Types
UseQueryStateReturn
Return type for the useQueryState hook.
Usage:
UseQueryStatesReturn
Return type for the useQueryStates hook.
Usage:
Utility Types
inferParserType
Type helper to extract the returned data type from a parser or parser map.
Usage:
Nullable
Makes all properties of an object nullable.
Usage:
UrlKeys
Helper type to define URL key mappings for renaming search params.
Usage:
Adapter Types
AdapterInterface
Interface that framework adapters must implement.
UpdateUrlFunction
Function signature for updating the URL.
AdapterOptions
Options available to adapters.
UseAdapterHook
Hook signature for creating adapters.
Usage:
Loader Types
Accepted input types for loaders.
LoaderFunction
Function signature for loader functions created with createLoader.
LoaderFunctionOptions
Options for loader functions.
CreateLoaderOptions
Options for creating a loader.
Usage:
Deprecated Types
Parser (deprecated)
Use SingleParser instead. This type is kept for backwards compatibility.
ParserBuilder (deprecated)
Use SingleParserBuilder instead. This type is kept for backwards compatibility.
See Also