nuqs-svelte
Version:
Svelte adaptation of the `nuqs` library for managing URL query strings as state.
15 lines (14 loc) • 579 B
TypeScript
import type { Options } from "../types";
export type AdapterOptions = Pick<Options, "history" | "scroll" | "shallow" | "throttleMs">;
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;
options?: AdapterOptions;
};