nuqs-zod-adapter
Version:
A Nuqs adapter to safely bind Zod schemas with query parameters using type safety, debouncing and auto-reset support.
12 lines (11 loc) • 338 B
TypeScript
import { type Options as BaseOptions } from 'nuqs';
import { z } from 'zod';
type Options = BaseOptions & {
delay?: number;
resetKeys?: string[];
};
export declare function useSafeQueryStateFromZod<S extends z.ZodTypeAny>(key: string, schema: S, options?: Options): [
z.infer<S>,
(value: z.infer<S>) => void
];
export {};