import "../defs-BFMOAnmN.js"; import { a as AdapterInterface, n as AdapterProps, o as AdapterOptions } from "../context-C1cpdknp.js"; import { ReactElement, ReactNode } from "react"; //#region src/adapters/testing.d.ts type UrlUpdateEvent = { searchParams: URLSearchParams; queryString: string; options: Required; }; type OnUrlUpdateFunction = (event: UrlUpdateEvent) => void; type TestingAdapterProps = Pick & { /** * An initial value for the search params. */ searchParams?: string | Record | URLSearchParams; /** * A function that will be called whenever the URL is updated. * Connect that to a spy in your tests to assert the URL updates. */ onUrlUpdate?: OnUrlUpdateFunction; /** * Internal: enable throttling during tests. * * @default 0 (no throttling) */ rateLimitFactor?: number; /** * Internal: Whether to reset the url update queue on mount. * * Since the update queue is a shared global, each test clears * it on mount to avoid interference between tests. * * @default true */ resetUrlUpdateQueueOnMount?: boolean; /** * If true, the adapter will store the search params in memory and * update that memory on each updateUrl call, to simulate a real adapter. * * Otherwise, the search params will be frozen to the initial value. * * @default false */ hasMemory?: boolean; children: ReactNode; } & AdapterProps; declare function NuqsTestingAdapter({ resetUrlUpdateQueueOnMount, autoResetQueueOnUpdate, defaultOptions, processUrlSearchParams, rateLimitFactor, hasMemory, onUrlUpdate, children, searchParams: initialSearchParams }: TestingAdapterProps): ReactElement; /** * A higher order component that wraps the children with the NuqsTestingAdapter * * It allows creating wrappers for testing purposes by providing only the * necessary props to the NuqsTestingAdapter. * * Usage: * ```tsx * render(, { * wrapper: withNuqsTestingAdapter({ searchParams: '?foo=bar' }) * }) * ``` */ declare function withNuqsTestingAdapter(props?: Omit): ({ children }: { children: ReactNode; }) => ReactElement; //#endregion export { NuqsTestingAdapter, OnUrlUpdateFunction, UrlUpdateEvent, withNuqsTestingAdapter }; //# sourceMappingURL=testing.d.ts.map