@asgerami/zemenay-blog
Version:
Plug-and-play blog system for Next.js - Get a fully functional blog running in minutes with zero configuration
17 lines (16 loc) • 489 B
TypeScript
import type { BlogPost } from "../types";
export interface UseSearchOptions {
searchFields?: ("title" | "content")[];
debounceMs?: number;
minSearchLength?: number;
}
export interface UseSearchResult {
posts: BlogPost[];
loading: boolean;
error: string | null;
searchQuery: string;
setSearchQuery: (query: string) => void;
totalResults: number;
hasSearched: boolean;
}
export declare function useSearch(options?: UseSearchOptions): UseSearchResult;