UNPKG

nuqs-svelte

Version:

Svelte adaptation of the `nuqs` library for managing URL query strings as state.

14 lines (13 loc) 534 B
import type { Options } from "../types"; export type AdapterOptions = Pick<Options, "history" | "scroll" | "shallow">; export type UpdateUrlFunction = (search: URLSearchParams, options: Required<AdapterOptions>) => void; export type UseAdapterHook = () => AdapterInterface; export type AdapterContext = { useAdapter: UseAdapterHook; }; export type AdapterInterface = { searchParams: () => URLSearchParams; updateUrl: UpdateUrlFunction; getSearchParamsSnapshot?: () => URLSearchParams; rateLimitFactor?: number; };