bknd
Version:
Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.
10 lines (9 loc) • 493 B
TypeScript
import { type s } from "bknd/utils";
export type UseSearchOptions<Schema extends s.Schema = s.Schema> = {
defaultValue?: Partial<s.StaticCoerced<Schema>>;
beforeEncode?: (search: Partial<s.StaticCoerced<Schema>>) => object;
};
export declare function useSearch<Schema extends s.Schema = s.Schema>(schema: Schema, options?: UseSearchOptions<Schema>): {
value: Required<s.StaticCoerced<Schema>>;
set: <Update extends Partial<s.StaticCoerced<Schema>>>(update: Update) => void;
};