hookli-mcp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/data/catalog.json","../src/catalog.ts","../src/prompts/index.ts","../src/resources/index.ts","../src/tools/index.ts","../src/server.ts"],"sourcesContent":["[\n {\n \"slug\": \"use-toggle\",\n \"name\": \"useToggle\",\n \"description\": \"Boolean state with toggle and explicit set.\",\n \"category\": \"state\",\n \"signature\": \"useToggle(initialValue?: boolean): [boolean, () => void, (value: boolean) => void]\",\n \"parameters\": [\n {\n \"name\": \"initialValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"The value the toggle starts from.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] value\",\n \"type\": \"boolean\",\n \"description\": \"The current boolean state.\"\n },\n {\n \"name\": \"[1] toggle\",\n \"type\": \"() => void\",\n \"description\": \"Flips the value.\"\n },\n {\n \"name\": \"[2] setValue\",\n \"type\": \"(value: boolean) => void\",\n \"description\": \"Sets the value explicitly.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [on, toggle, setOn] = useToggle(false);\\n\\n return (\\n <div>\\n <button onClick={toggle}>{on ? \\\"On\\\" : \\\"Off\\\"}</button>\\n <button onClick={() => setOn(true)}>Set on</button>\\n <button onClick={() => setOn(false)}>Set off</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useState } from \\\"react\\\";\\n\\n/**\\n * A custom hook to toggle a boolean value.\\n *\\n * @param initialValue - The initial boolean value. Defaults to `false`.\\n * @returns An array containing the current state, a function to toggle it, and a function to explicitly set the value.\\n */\\nexport const useToggle = (initialValue: boolean = false): [boolean, () => void, (value: boolean) => void] => {\\n const [state, setState] = useState<boolean>(initialValue);\\n\\n // Toggles the current state\\n const toggle = useCallback(() => {\\n setState((prevState) => !prevState);\\n }, []);\\n\\n // Allows setting a specific value\\n const setExplicit = useCallback((value: boolean) => {\\n setState(value);\\n }, []);\\n\\n return [state, toggle, setExplicit];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-toggle/use-toggle.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-toggle\",\n \"useCases\": [\n \"state\",\n \"use-toggle\",\n \"usetoggle\",\n \"boolean\",\n \"with\",\n \"toggle\",\n \"explicit\"\n ]\n },\n {\n \"slug\": \"use-form\",\n \"name\": \"useForm\",\n \"description\": \"Controlled form state with one change handler.\",\n \"category\": \"state\",\n \"signature\": \"useForm<T>(initialState: T): { values: T; handleChange: (e: ChangeEvent) => void; resetForm: () => void }\",\n \"parameters\": [\n {\n \"name\": \"initialState\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"Initial field values. Keys must match the name attribute of each input.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"values\",\n \"type\": \"T\",\n \"description\": \"The current form values.\"\n },\n {\n \"name\": \"handleChange\",\n \"type\": \"(event: ChangeEvent) => void\",\n \"description\": \"One change handler for every named input, textarea and select.\"\n },\n {\n \"name\": \"resetForm\",\n \"type\": \"() => void\",\n \"description\": \"Restores initialState.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { values, handleChange, resetForm } = useForm({ name: \\\"\\\", email: \\\"\\\" });\\n\\n return (\\n <form onSubmit={(e) => e.preventDefault()}>\\n <input name=\\\"name\\\" value={values.name} onChange={handleChange} />\\n <input name=\\\"email\\\" type=\\\"email\\\" value={values.email} onChange={handleChange} />\\n <button type=\\\"button\\\" onClick={resetForm}>Reset</button>\\n </form>\\n );\\n}\",\n \"source\": \"import { ChangeEvent, useState } from \\\"react\\\";\\n\\ninterface UseFormValues<T = any> {\\n // Define your form field types here (e.g., string, number, boolean, etc.)\\n [key: string]: string | number | boolean;\\n}\\n\\nexport const useForm = <T extends UseFormValues>(\\n initialState: T\\n): {\\n values: T;\\n handleChange: (\\n event: ChangeEvent<\\n HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement\\n >\\n ) => void;\\n resetForm: () => void;\\n} => {\\n // State to store form values with type assertion for clarity\\n const [values, setValues] = useState<T>(initialState);\\n\\n // Generic handleChange function\\n const handleChange = (\\n event: ChangeEvent<\\n HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement\\n >\\n ) => {\\n const { name, value } = event.target as\\n | HTMLInputElement\\n | HTMLTextAreaElement\\n | HTMLSelectElement;\\n\\n setValues((prevValues) => ({\\n ...prevValues,\\n [name]: value,\\n }));\\n };\\n\\n // Reset form to initial values\\n const resetForm = () => {\\n setValues(initialState);\\n };\\n\\n return { values, handleChange, resetForm };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-form/use-form.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-form\",\n \"useCases\": [\n \"state\",\n \"use-form\",\n \"useform\",\n \"user input\",\n \"wizard\",\n \"state management\",\n \"controlled\",\n \"form\",\n \"with\",\n \"change\",\n \"handler\"\n ]\n },\n {\n \"slug\": \"use-local-storage\",\n \"name\": \"useLocalStorage\",\n \"description\": \"State persisted to localStorage.\",\n \"category\": \"state\",\n \"signature\": \"useLocalStorage<T>(key: string, initialValue: T): { value: T; setStoredValue: (value: T | ((val: T) => T)) => void }\",\n \"parameters\": [\n {\n \"name\": \"key\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The localStorage key to read and write.\"\n },\n {\n \"name\": \"initialValue\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"Value used before hydration and when the key is empty. Prefer a stable reference — the sync effect depends on it.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"value\",\n \"type\": \"T\",\n \"description\": \"The stored value. Server-rendered as initialValue, then synced from localStorage after mount.\"\n },\n {\n \"name\": \"setStoredValue\",\n \"type\": \"(value: T | ((val: T) => T)) => void\",\n \"description\": \"Persists to localStorage and updates state; accepts a value or an updater function.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { value, setStoredValue } = useLocalStorage(\\\"note\\\", \\\"\\\");\\n\\n return (\\n <div>\\n <input value={value} onChange={(e) => setStoredValue(e.target.value)} />\\n <button type=\\\"button\\\" onClick={() => setStoredValue(\\\"\\\")}>Clear</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\ninterface UseLocalStorageResponse<T> {\\n value: T;\\n setStoredValue: (value: T | ((val: T) => T)) => void;\\n}\\n\\nexport const useLocalStorage = <T>(\\n key: string,\\n initialValue: T\\n): UseLocalStorageResponse<T> => {\\n // State to store our value\\n const [value, setValue] = useState<T>(initialValue);\\n\\n // Get from local storage only during initial render\\n useEffect(() => {\\n // Parse stored json or return initialValue\\n const item = window.localStorage.getItem(key);\\n const parsedValue: T = item ? JSON.parse(item) : initialValue;\\n setValue(parsedValue);\\n }, [key, initialValue]); // Only re-run on change in `key` or `initialValue`\\n\\n // Return a wrapper function that provides access to the stored value\\n // and a setter function to update it\\n const setStoredValue = (newValue: T | ((val: T) => T)) => {\\n // Allow value to be a function so we have same API as useState\\n const updatedValue =\\n newValue instanceof Function ? newValue(value) : newValue;\\n\\n // Save to local storage\\n window.localStorage.setItem(key, JSON.stringify(updatedValue));\\n setValue(updatedValue);\\n };\\n\\n return { value, setStoredValue };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-local-storage/use-local-storage.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-local-storage\",\n \"useCases\": [\n \"state\",\n \"use-local-storage\",\n \"uselocalstorage\",\n \"persistence\",\n \"remember state\",\n \"offline data\",\n \"cache\",\n \"session\",\n \"persisted\",\n \"localstorage\"\n ]\n },\n {\n \"slug\": \"use-local-storage-with-expiry\",\n \"name\": \"useLocalStorageWithExpiry\",\n \"description\": \"Persisted state with a TTL.\",\n \"category\": \"state\",\n \"signature\": \"useLocalStorageWithExpiry<T>(key: string, initialValue: T, expiryMs: number): { value: T | null; setStoredValue: (value: T) => void }\",\n \"parameters\": [\n {\n \"name\": \"key\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The localStorage key to read and write.\"\n },\n {\n \"name\": \"initialValue\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"Value used before hydration and when nothing is stored under the key.\"\n },\n {\n \"name\": \"expiryMs\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Time-to-live in milliseconds. Every write stores the value with a fresh expiry timestamp.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"value\",\n \"type\": \"T | null\",\n \"description\": \"The stored value, or null once the item has expired. Expiry is checked when the hook reads — on mount or key change — at which point the item is removed.\"\n },\n {\n \"name\": \"setStoredValue\",\n \"type\": \"(value: T) => void\",\n \"description\": \"Persists the value to localStorage with a new expiry of now + expiryMs.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { value, setStoredValue } = useLocalStorageWithExpiry(\\n \\\"draft\\\",\\n \\\"\\\",\\n 10_000,\\n );\\n\\n return (\\n <div>\\n <button onClick={() => setStoredValue(\\\"hello\\\")}>Save for 10s</button>\\n <p>{value === null ? \\\"Expired\\\" : value || \\\"Nothing stored\\\"}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\ninterface UseLocalStorageWithExpiryState<T> {\\n value: T | null;\\n setStoredValue: (newValue: T) => void;\\n}\\n\\ninterface StoredItem<T> {\\n value: T;\\n expiry: number;\\n}\\n\\nexport const useLocalStorageWithExpiry = <T>(\\n key: string,\\n initialValue: T,\\n expiryMs: number\\n): UseLocalStorageWithExpiryState<T> => {\\n // Read the wrapper, returning the INNER value — or null once expired/absent.\\n const read = (): T | null => {\\n if (typeof window === \\\"undefined\\\") return initialValue;\\n const raw = window.localStorage.getItem(key);\\n if (!raw) return initialValue;\\n try {\\n const item = JSON.parse(raw) as StoredItem<T>;\\n if (item && typeof item.expiry === \\\"number\\\" && Date.now() > item.expiry) {\\n window.localStorage.removeItem(key);\\n return null;\\n }\\n return item.value;\\n } catch {\\n return initialValue;\\n }\\n };\\n\\n const [value, setValue] = useState<T | null>(initialValue);\\n\\n // Hydrate from storage on the client (SSR renders `initialValue`, then this syncs).\\n useEffect(() => {\\n setValue(read());\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n }, [key]);\\n\\n const setStoredValue = (newValue: T) => {\\n setValue(newValue);\\n if (typeof window === \\\"undefined\\\") return;\\n const item: StoredItem<T> = {\\n value: newValue,\\n expiry: Date.now() + expiryMs,\\n };\\n window.localStorage.setItem(key, JSON.stringify(item));\\n };\\n\\n return { value, setStoredValue };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-local-storage-with-expiry/use-local-storage-with-expiry.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-local-storage-with-expiry\",\n \"useCases\": [\n \"state\",\n \"use-local-storage-with-expiry\",\n \"uselocalstoragewithexpiry\",\n \"persistence\",\n \"remember state\",\n \"offline data\",\n \"cache\",\n \"session\",\n \"persisted\",\n \"with\"\n ]\n },\n {\n \"slug\": \"use-session-storage\",\n \"name\": \"useSessionStorage\",\n \"description\": \"useState backed by sessionStorage, synced across tabs.\",\n \"category\": \"state\",\n \"signature\": \"useSessionStorage<T>(key: string, initialValue: T | (() => T), options?: UseSessionStorageOptions<T>): [T, (value: T | ((prev: T) => T)) => void, () => void]\",\n \"parameters\": [\n {\n \"name\": \"key\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The sessionStorage key to read and write.\"\n },\n {\n \"name\": \"initialValue\",\n \"type\": \"T | (() => T)\",\n \"defaultValue\": null,\n \"description\": \"Value used before hydration and when the key is empty. Pass a function to compute it lazily.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseSessionStorageOptions<T>\",\n \"defaultValue\": \"{}\",\n \"description\": \"Optional custom serializer/deserializer and hydration flag.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] value\",\n \"type\": \"T\",\n \"description\": \"The stored value. Server-rendered as initialValue, then hydrated from sessionStorage after mount.\"\n },\n {\n \"name\": \"[1] setValue\",\n \"type\": \"(value: T | ((prev: T) => T)) => void\",\n \"description\": \"Persists to sessionStorage and updates state; accepts a value or an updater. Syncs every hook using the key in this tab.\"\n },\n {\n \"name\": \"[2] removeValue\",\n \"type\": \"() => void\",\n \"description\": \"Removes the key from sessionStorage and resets state to initialValue.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseSessionStorageOptions<T>\",\n \"description\": \"Custom (de)serialization and hydration behaviour.\",\n \"rows\": [\n {\n \"name\": \"serializer\",\n \"type\": \"(value: T) => string\",\n \"defaultValue\": null,\n \"description\": \"Turn the value into the string stored under the key. Defaults to JSON.stringify.\"\n },\n {\n \"name\": \"deserializer\",\n \"type\": \"(value: string) => T\",\n \"defaultValue\": null,\n \"description\": \"Parse the stored string back into a value. Defaults to JSON.parse.\"\n },\n {\n \"name\": \"initializeWithValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Read sessionStorage synchronously on mount. Set false to defer to after hydration and avoid SSR mismatches.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [draft, setDraft, removeDraft] = useSessionStorage(\\\"draft\\\", \\\"\\\");\\n\\n return (\\n <div>\\n <input value={draft} onChange={(e) => setDraft(e.target.value)} />\\n <button type=\\\"button\\\" onClick={removeDraft}>Clear</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useState } from \\\"react\\\";\\nimport { useEventCallback } from \\\"../use-event-callback\\\";\\nimport { useEventListener } from \\\"../use-event-listener\\\";\\n\\ndeclare global {\\n interface WindowEventMap {\\n \\\"session-storage\\\": StorageEvent;\\n }\\n}\\n\\nconst IS_SERVER = typeof window === \\\"undefined\\\";\\n\\nexport interface UseSessionStorageOptions<T> {\\n serializer?: (value: T) => string;\\n deserializer?: (value: string) => T;\\n initializeWithValue?: boolean;\\n}\\n\\nexport type UseSessionStorageReturn<T> = [\\n T,\\n (value: T | ((prev: T) => T)) => void,\\n () => void,\\n];\\n\\n/**\\n * `useState` backed by `sessionStorage`, synced across hooks in the same tab and\\n * across tabs via the `storage` event.\\n *\\n * SSR-safe: when `initializeWithValue` is false (or on the server) the hook\\n * starts from `initialValue` and hydrates from storage after mount. `setValue`\\n * mirrors the `useState` API and accepts an updater; `removeValue` clears the\\n * key and resets the state to `initialValue`.\\n *\\n * @param key - The `sessionStorage` key to read and write.\\n * @param initialValue - Fallback value (or factory) when the key is absent.\\n * @param options - Optional custom serializer/deserializer and hydration flag.\\n * @returns `[value, setValue, removeValue]`.\\n */\\nexport function useSessionStorage<T>(\\n key: string,\\n initialValue: T | (() => T),\\n options: UseSessionStorageOptions<T> = {},\\n): UseSessionStorageReturn<T> {\\n const { initializeWithValue = true } = options;\\n\\n const serializer = useCallback<(value: T) => string>(\\n (value) => {\\n if (options.serializer) return options.serializer(value);\\n return JSON.stringify(value);\\n },\\n [options],\\n );\\n\\n const deserializer = useCallback<(value: string) => T>(\\n (value) => {\\n if (options.deserializer) return options.deserializer(value);\\n const defaultValue =\\n initialValue instanceof Function ? initialValue() : initialValue;\\n if (value === \\\"undefined\\\") return defaultValue;\\n try {\\n return JSON.parse(value) as T;\\n } catch {\\n return defaultValue;\\n }\\n },\\n [options, initialValue],\\n );\\n\\n const readValue = useCallback((): T => {\\n const initialValueToUse =\\n initialValue instanceof Function ? initialValue() : initialValue;\\n\\n if (IS_SERVER) return initialValueToUse;\\n\\n try {\\n const raw = window.sessionStorage.getItem(key);\\n return raw ? deserializer(raw) : initialValueToUse;\\n } catch {\\n return initialValueToUse;\\n }\\n }, [initialValue, key, deserializer]);\\n\\n const [storedValue, setStoredValue] = useState<T>(() => {\\n if (initializeWithValue) return readValue();\\n return initialValue instanceof Function ? initialValue() : initialValue;\\n });\\n\\n const setValue = useEventCallback((value: T | ((prev: T) => T)) => {\\n if (IS_SERVER) return;\\n\\n try {\\n const newValue =\\n value instanceof Function ? value(readValue()) : value;\\n window.sessionStorage.setItem(key, serializer(newValue));\\n setStoredValue(newValue);\\n window.dispatchEvent(new StorageEvent(\\\"session-storage\\\", { key }));\\n } catch {\\n return;\\n }\\n });\\n\\n const removeValue = useEventCallback(() => {\\n if (IS_SERVER) return;\\n\\n const defaultValue =\\n initialValue instanceof Function ? initialValue() : initialValue;\\n window.sessionStorage.removeItem(key);\\n setStoredValue(defaultValue);\\n window.dispatchEvent(new StorageEvent(\\\"session-storage\\\", { key }));\\n });\\n\\n useEffect(() => {\\n setStoredValue(readValue());\\n }, [key]);\\n\\n const handleStorageChange = useCallback(\\n (event: StorageEvent) => {\\n if (event.key && event.key !== key) return;\\n setStoredValue(readValue());\\n },\\n [key, readValue],\\n );\\n\\n useEventListener(\\\"storage\\\", handleStorageChange);\\n useEventListener(\\\"session-storage\\\", handleStorageChange);\\n\\n return [storedValue, setValue, removeValue];\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-session-storage/use-session-storage.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-session-storage\",\n \"useCases\": [\n \"state\",\n \"use-session-storage\",\n \"usesessionstorage\",\n \"persistence\",\n \"remember state\",\n \"offline data\",\n \"cache\",\n \"session\",\n \"usestate\",\n \"backed\",\n \"sessionstorage\",\n \"synced\",\n \"across\",\n \"tabs\"\n ]\n },\n {\n \"slug\": \"use-read-local-storage\",\n \"name\": \"useReadLocalStorage\",\n \"description\": \"Read a localStorage key without writing it, reactively.\",\n \"category\": \"state\",\n \"signature\": \"useReadLocalStorage<T>(key: string, options?: UseReadLocalStorageOptions<T>): T | null\",\n \"parameters\": [\n {\n \"name\": \"key\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The localStorage key to observe.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseReadLocalStorageOptions<T>\",\n \"defaultValue\": \"{}\",\n \"description\": \"Optional custom deserializer and hydration flag.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"value\",\n \"type\": \"T | null\",\n \"description\": \"The parsed value, or null when the key is absent. Re-renders when the key changes in another tab (storage event) or via a local-storage event dispatched in this tab.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseReadLocalStorageOptions<T>\",\n \"description\": \"Custom deserialization and hydration behaviour.\",\n \"rows\": [\n {\n \"name\": \"deserializer\",\n \"type\": \"(value: string) => T\",\n \"defaultValue\": null,\n \"description\": \"Parse the stored string into a value. Defaults to JSON.parse, falling back to the raw string.\"\n },\n {\n \"name\": \"initializeWithValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Read localStorage synchronously on mount. Set false to defer to after hydration and avoid SSR mismatches.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const theme = useReadLocalStorage<string>(\\\"theme\\\");\\n\\n return <p>Saved theme: {theme ?? \\\"none\\\"}</p>;\\n}\",\n \"source\": \"import { useCallback, useEffect, useState } from \\\"react\\\";\\nimport { useEventListener } from \\\"../use-event-listener\\\";\\n\\ndeclare global {\\n interface WindowEventMap {\\n \\\"local-storage\\\": StorageEvent;\\n }\\n}\\n\\nconst IS_SERVER = typeof window === \\\"undefined\\\";\\n\\nexport interface UseReadLocalStorageOptions<T> {\\n deserializer?: (value: string) => T;\\n initializeWithValue?: boolean;\\n}\\n\\n/**\\n * Reads a `localStorage` key without writing it, re-rendering whenever the value\\n * changes in another tab (`storage` event) or via a `local-storage` custom\\n * event dispatched in this tab.\\n *\\n * SSR-safe: returns `null` on the server and, when `initializeWithValue` is\\n * false, on the first client render before hydrating from storage.\\n *\\n * @param key - The `localStorage` key to observe.\\n * @param options - Optional custom deserializer and hydration flag.\\n * @returns The parsed value, or `null` when the key is absent.\\n */\\nexport function useReadLocalStorage<T>(\\n key: string,\\n options: UseReadLocalStorageOptions<T> = {},\\n): T | null {\\n const { initializeWithValue = true } = options;\\n\\n const deserializer = useCallback<(value: string) => T>(\\n (value) => {\\n if (options.deserializer) return options.deserializer(value);\\n if (value === \\\"undefined\\\") return undefined as unknown as T;\\n try {\\n return JSON.parse(value) as T;\\n } catch {\\n return value as unknown as T;\\n }\\n },\\n [options],\\n );\\n\\n const readValue = useCallback((): T | null => {\\n if (IS_SERVER) return null;\\n\\n try {\\n const raw = window.localStorage.getItem(key);\\n return raw ? deserializer(raw) : null;\\n } catch {\\n return null;\\n }\\n }, [key, deserializer]);\\n\\n const [storedValue, setStoredValue] = useState<T | null>(() => {\\n if (initializeWithValue) return readValue();\\n return null;\\n });\\n\\n useEffect(() => {\\n setStoredValue(readValue());\\n }, [key]);\\n\\n const handleStorageChange = useCallback(\\n (event: StorageEvent) => {\\n if (event.key && event.key !== key) return;\\n setStoredValue(readValue());\\n },\\n [key, readValue],\\n );\\n\\n useEventListener(\\\"storage\\\", handleStorageChange);\\n useEventListener(\\\"local-storage\\\", handleStorageChange);\\n\\n return storedValue;\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-read-local-storage/use-read-local-storage.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-read-local-storage\",\n \"useCases\": [\n \"state\",\n \"use-read-local-storage\",\n \"usereadlocalstorage\",\n \"persistence\",\n \"remember state\",\n \"offline data\",\n \"cache\",\n \"session\",\n \"read\",\n \"localstorage\",\n \"without\",\n \"writing\",\n \"reactively\"\n ]\n },\n {\n \"slug\": \"use-dark-mode\",\n \"name\": \"useDarkMode\",\n \"description\": \"Dark-mode boolean with toggle.\",\n \"category\": \"state\",\n \"signature\": \"useDarkMode(): { isDarkMode: boolean; toggleDarkMode: () => void }\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"isDarkMode\",\n \"type\": \"boolean\",\n \"description\": \"Current mode. Initialized from localStorage(\\\"theme\\\") on the client; false during SSR.\"\n },\n {\n \"name\": \"toggleDarkMode\",\n \"type\": \"() => void\",\n \"description\": \"Flips the mode. An effect persists it to localStorage(\\\"theme\\\") and toggles a \\\"dark\\\" class on <body>.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { isDarkMode, toggleDarkMode } = useDarkMode();\\n\\n return (\\n <div className={isDarkMode ? \\\"panel-dark\\\" : \\\"panel-light\\\"}>\\n <button onClick={toggleDarkMode}>\\n {isDarkMode ? \\\"Switch to light\\\" : \\\"Switch to dark\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\ninterface UseDarkModeState {\\n isDarkMode: boolean;\\n toggleDarkMode: () => void;\\n}\\n\\nexport const useDarkMode = (): UseDarkModeState => {\\n const [isDarkMode, setIsDarkMode] = useState<boolean>(() => {\\n // SSR-safe: no localStorage on the server.\\n if (typeof window === \\\"undefined\\\") return false;\\n return window.localStorage.getItem(\\\"theme\\\") === \\\"dark\\\";\\n });\\n\\n const toggleDarkMode = () => setIsDarkMode((prevMode) => !prevMode);\\n\\n useEffect(() => {\\n if (typeof document === \\\"undefined\\\") return;\\n\\n const bodyElement = document.body;\\n const darkClass = \\\"dark\\\"; // Replace with your actual class name\\n\\n bodyElement.classList.toggle(darkClass, isDarkMode);\\n // Persist the CURRENT theme (not the pre-toggle value).\\n window.localStorage.setItem(\\\"theme\\\", isDarkMode ? \\\"dark\\\" : \\\"light\\\");\\n\\n // Cleanup: drop the class on unmount.\\n return () => {\\n bodyElement.classList.remove(darkClass);\\n };\\n }, [isDarkMode]);\\n\\n return { isDarkMode, toggleDarkMode };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-dark-mode/use-dark-mode.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-dark-mode\",\n \"useCases\": [\n \"state\",\n \"use-dark-mode\",\n \"usedarkmode\",\n \"theme switching\",\n \"dark mode\",\n \"color mode\",\n \"dark\",\n \"mode\",\n \"boolean\",\n \"with\",\n \"toggle\"\n ]\n },\n {\n \"slug\": \"use-ternary-dark-mode\",\n \"name\": \"useTernaryDarkMode\",\n \"description\": \"Three-state dark mode — system, dark or light — persisted.\",\n \"category\": \"state\",\n \"signature\": \"useTernaryDarkMode(options?: UseTernaryDarkModeOptions): UseTernaryDarkModeReturn\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseTernaryDarkModeOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Optional starting mode and localStorage key.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"{ … }\",\n \"type\": \"UseTernaryDarkModeReturn\",\n \"description\": \"The resolved isDarkMode boolean, the stored ternary preference, and its setters.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"TernaryDarkMode\",\n \"description\": \"The three possible preferences.\",\n \"rows\": [\n {\n \"name\": \"value\",\n \"type\": \"\\\"system\\\" | \\\"dark\\\" | \\\"light\\\"\",\n \"defaultValue\": null,\n \"description\": \"\\\"system\\\" resolves against the OS; \\\"dark\\\"/\\\"light\\\" force a mode.\"\n }\n ]\n },\n {\n \"name\": \"UseTernaryDarkModeOptions\",\n \"description\": \"Optional starting mode and persistence key.\",\n \"rows\": [\n {\n \"name\": \"defaultValue\",\n \"type\": \"TernaryDarkMode\",\n \"defaultValue\": \"\\\"system\\\"\",\n \"description\": \"The mode before anything is stored: \\\"system\\\", \\\"dark\\\" or \\\"light\\\".\"\n },\n {\n \"name\": \"localStorageKey\",\n \"type\": \"string\",\n \"defaultValue\": \"\\\"hookli-ternary-dark-mode\\\"\",\n \"description\": \"The localStorage key the choice is persisted under.\"\n }\n ]\n },\n {\n \"name\": \"UseTernaryDarkModeReturn\",\n \"description\": \"The resolved mode plus setters.\",\n \"rows\": [\n {\n \"name\": \"isDarkMode\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"True when the mode is \\\"dark\\\", or \\\"system\\\" while the OS prefers dark.\"\n },\n {\n \"name\": \"ternaryDarkMode\",\n \"type\": \"TernaryDarkMode\",\n \"defaultValue\": null,\n \"description\": \"The stored preference: \\\"system\\\" | \\\"dark\\\" | \\\"light\\\".\"\n },\n {\n \"name\": \"setTernaryDarkMode\",\n \"type\": \"(value: TernaryDarkMode | ((prev: TernaryDarkMode) => TernaryDarkMode)) => void\",\n \"defaultValue\": null,\n \"description\": \"Set the preference directly; accepts a value or an updater.\"\n },\n {\n \"name\": \"toggleTernaryDarkMode\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Cycle the preference: light → system → dark → light.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { isDarkMode, ternaryDarkMode, setTernaryDarkMode } =\\n useTernaryDarkMode();\\n\\n return (\\n <div className={isDarkMode ? \\\"panel-dark\\\" : \\\"panel-light\\\"}>\\n <select\\n value={ternaryDarkMode}\\n onChange={(e) => setTernaryDarkMode(e.target.value)}\\n >\\n <option value=\\\"light\\\">Light</option>\\n <option value=\\\"system\\\">System</option>\\n <option value=\\\"dark\\\">Dark</option>\\n </select>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback } from \\\"react\\\";\\nimport { useLocalStorage } from \\\"../use-local-storage\\\";\\nimport { useMediaQuery } from \\\"../use-media-query\\\";\\n\\nconst COLOR_SCHEME_QUERY = \\\"(prefers-color-scheme: dark)\\\";\\nconst DEFAULT_STORAGE_KEY = \\\"hookli-ternary-dark-mode\\\";\\n\\nexport type TernaryDarkMode = \\\"system\\\" | \\\"dark\\\" | \\\"light\\\";\\n\\nexport interface UseTernaryDarkModeOptions {\\n defaultValue?: TernaryDarkMode;\\n localStorageKey?: string;\\n}\\n\\nexport interface UseTernaryDarkModeReturn {\\n isDarkMode: boolean;\\n ternaryDarkMode: TernaryDarkMode;\\n setTernaryDarkMode: (\\n value: TernaryDarkMode | ((prev: TernaryDarkMode) => TernaryDarkMode),\\n ) => void;\\n toggleTernaryDarkMode: () => void;\\n}\\n\\n/**\\n * Three-state dark-mode preference — `\\\"system\\\"`, `\\\"dark\\\"`, or `\\\"light\\\"` —\\n * persisted to `localStorage` and resolved against the OS color scheme.\\n *\\n * SSR-safe: the OS preference is read via {@link useMediaQuery} and the stored\\n * choice via {@link useLocalStorage}, both of which defer browser access to\\n * effects. `isDarkMode` is `true` when the mode is `\\\"dark\\\"`, or `\\\"system\\\"` while\\n * the OS prefers dark. `toggleTernaryDarkMode` cycles light → system → dark.\\n *\\n * @param options - Optional `defaultValue` (default `\\\"system\\\"`) and\\n * `localStorageKey`.\\n * @returns `{ isDarkMode, ternaryDarkMode, setTernaryDarkMode, toggleTernaryDarkMode }`.\\n */\\nexport function useTernaryDarkMode(\\n options: UseTernaryDarkModeOptions = {},\\n): UseTernaryDarkModeReturn {\\n const { defaultValue = \\\"system\\\", localStorageKey = DEFAULT_STORAGE_KEY } =\\n options;\\n\\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY);\\n const { value: ternaryDarkMode, setStoredValue: setTernaryDarkMode } =\\n useLocalStorage<TernaryDarkMode>(localStorageKey, defaultValue);\\n\\n const isDarkMode =\\n ternaryDarkMode === \\\"dark\\\" || (ternaryDarkMode === \\\"system\\\" && isDarkOS);\\n\\n const toggleTernaryDarkMode = useCallback(() => {\\n const cycle: TernaryDarkMode[] = [\\\"light\\\", \\\"system\\\", \\\"dark\\\"];\\n setTernaryDarkMode((prev) => {\\n const nextIndex = (cycle.indexOf(prev) + 1) % cycle.length;\\n return cycle[nextIndex];\\n });\\n }, [setTernaryDarkMode]);\\n\\n return {\\n isDarkMode,\\n ternaryDarkMode,\\n setTernaryDarkMode,\\n toggleTernaryDarkMode,\\n };\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-ternary-dark-mode/use-ternary-dark-mode.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-ternary-dark-mode\",\n \"useCases\": [\n \"state\",\n \"use-ternary-dark-mode\",\n \"useternarydarkmode\",\n \"theme switching\",\n \"dark mode\",\n \"color mode\",\n \"three\",\n \"dark\",\n \"mode\",\n \"system\",\n \"light\",\n \"persisted\"\n ]\n },\n {\n \"slug\": \"use-boolean\",\n \"name\": \"useBoolean\",\n \"description\": \"Boolean state with setTrue, setFalse, toggle and set.\",\n \"category\": \"state\",\n \"signature\": \"useBoolean(defaultValue?: boolean): { value: boolean; setValue: (value: boolean) => void; setTrue: () => void; setFalse: () => void; toggle: () => void }\",\n \"parameters\": [\n {\n \"name\": \"defaultValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"The value the boolean starts from.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"value\",\n \"type\": \"boolean\",\n \"description\": \"The current boolean value.\"\n },\n {\n \"name\": \"setValue\",\n \"type\": \"(value: boolean) => void\",\n \"description\": \"Sets the value directly.\"\n },\n {\n \"name\": \"setTrue\",\n \"type\": \"() => void\",\n \"description\": \"Sets the value to true.\"\n },\n {\n \"name\": \"setFalse\",\n \"type\": \"() => void\",\n \"description\": \"Sets the value to false.\"\n },\n {\n \"name\": \"toggle\",\n \"type\": \"() => void\",\n \"description\": \"Flips the value.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { value, setTrue, setFalse, toggle } = useBoolean(false);\\n\\n return (\\n <div>\\n <p>{value ? \\\"On\\\" : \\\"Off\\\"}</p>\\n <button onClick={toggle}>Toggle</button>\\n <button onClick={setTrue}>On</button>\\n <button onClick={setFalse}>Off</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useState } from \\\"react\\\";\\n\\n/**\\n * The value and setters returned by {@link useBoolean}.\\n */\\nexport interface UseBooleanReturn {\\n /** The current boolean value. */\\n value: boolean;\\n /** Set the value directly. */\\n setValue: (value: boolean) => void;\\n /** Set the value to `true`. */\\n setTrue: () => void;\\n /** Set the value to `false`. */\\n setFalse: () => void;\\n /** Toggle the value. */\\n toggle: () => void;\\n}\\n\\n/**\\n * A custom hook to manage a boolean value with convenient setters.\\n *\\n * @param defaultValue - The initial boolean value. Defaults to `false`.\\n * @returns An object with the current value and setters `setValue`, `setTrue`, `setFalse`, and `toggle`.\\n */\\nexport const useBoolean = (defaultValue: boolean = false): UseBooleanReturn => {\\n const [value, setValue] = useState<boolean>(defaultValue);\\n\\n const setTrue = useCallback(() => setValue(true), []);\\n const setFalse = useCallback(() => setValue(false), []);\\n const toggle = useCallback(() => setValue((prev) => !prev), []);\\n\\n return { value, setValue, setTrue, setFalse, toggle };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-boolean/use-boolean.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-boolean\",\n \"useCases\": [\n \"state\",\n \"use-boolean\",\n \"useboolean\",\n \"boolean\",\n \"with\",\n \"settrue\",\n \"setfalse\",\n \"toggle\"\n ]\n },\n {\n \"slug\": \"use-counter\",\n \"name\": \"useCounter\",\n \"description\": \"Numeric counter with increment, decrement and reset.\",\n \"category\": \"state\",\n \"signature\": \"useCounter(initialValue?: number): { count: number; increment: () => void; decrement: () => void; reset: () => void; setCount: Dispatch<SetStateAction<number>> }\",\n \"parameters\": [\n {\n \"name\": \"initialValue\",\n \"type\": \"number\",\n \"defaultValue\": \"0\",\n \"description\": \"The count the hook starts from; reset returns here.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"count\",\n \"type\": \"number\",\n \"description\": \"The current count.\"\n },\n {\n \"name\": \"increment\",\n \"type\": \"() => void\",\n \"description\": \"Adds one to the count.\"\n },\n {\n \"name\": \"decrement\",\n \"type\": \"() => void\",\n \"description\": \"Subtracts one from the count.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"description\": \"Restores the count to initialValue.\"\n },\n {\n \"name\": \"setCount\",\n \"type\": \"Dispatch<SetStateAction<number>>\",\n \"description\": \"Sets the count directly; accepts a value or an updater function.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { count, increment, decrement, reset, setCount } = useCounter(0);\\n\\n return (\\n <div>\\n <p>{count}</p>\\n <button onClick={decrement}>-1</button>\\n <button onClick={increment}>+1</button>\\n <button onClick={() => setCount(10)}>Set 10</button>\\n <button onClick={reset}>Reset</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { Dispatch, SetStateAction, useCallback, useState } from \\\"react\\\";\\n\\n/**\\n * The count and actions returned by {@link useCounter}.\\n */\\nexport interface UseCounterReturn {\\n /** The current count. */\\n count: number;\\n /** Increment the count by one. */\\n increment: () => void;\\n /** Decrement the count by one. */\\n decrement: () => void;\\n /** Reset the count back to its initial value. */\\n reset: () => void;\\n /** Set the count directly (accepts a value or updater function). */\\n setCount: Dispatch<SetStateAction<number>>;\\n}\\n\\n/**\\n * A custom hook to manage a numeric counter.\\n *\\n * @param initialValue - The initial count. Defaults to `0`.\\n * @returns An object with the current `count` and actions `increment`, `decrement`, `reset`, and `setCount`.\\n */\\nexport const useCounter = (initialValue: number = 0): UseCounterReturn => {\\n const [count, setCount] = useState<number>(initialValue);\\n\\n const increment = useCallback(() => setCount((prev) => prev + 1), []);\\n const decrement = useCallback(() => setCount((prev) => prev - 1), []);\\n const reset = useCallback(() => setCount(initialValue), [initialValue]);\\n\\n return { count, increment, decrement, reset, setCount };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-counter/use-counter.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-counter\",\n \"useCases\": [\n \"state\",\n \"use-counter\",\n \"usecounter\",\n \"user input\",\n \"wizard\",\n \"state management\",\n \"numeric\",\n \"counter\",\n \"with\",\n \"increment\",\n \"decrement\",\n \"reset\"\n ]\n },\n {\n \"slug\": \"use-step\",\n \"name\": \"useStep\",\n \"description\": \"1-indexed step counter for wizards and steppers.\",\n \"category\": \"state\",\n \"signature\": \"useStep(maxStep: number): [number, UseStepActions]\",\n \"parameters\": [\n {\n \"name\": \"maxStep\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The highest reachable step (inclusive). Steps run from 1 to maxStep.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] step\",\n \"type\": \"number\",\n \"description\": \"The current step, 1-indexed.\"\n },\n {\n \"name\": \"[1] actions\",\n \"type\": \"UseStepActions\",\n \"description\": \"Controls for moving between steps — see below.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseStepActions\",\n \"description\": \"The second tuple element — the stepper controls.\",\n \"rows\": [\n {\n \"name\": \"goToNextStep\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Advances to the next step; a no-op at maxStep.\"\n },\n {\n \"name\": \"goToPrevStep\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Goes back one step; a no-op at step 1.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Resets back to step 1.\"\n },\n {\n \"name\": \"canGoToNextStep\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether a next step is available.\"\n },\n {\n \"name\": \"canGoToPrevStep\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether a previous step is available.\"\n },\n {\n \"name\": \"setStep\",\n \"type\": \"Dispatch<SetStateAction<number>>\",\n \"defaultValue\": null,\n \"description\": \"Sets the step directly (1-indexed); throws if outside the 1..maxStep range.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [step, { goToNextStep, goToPrevStep, canGoToNextStep, canGoToPrevStep, reset }] =\\n useStep(4);\\n\\n return (\\n <div>\\n <p>Step {step} of 4</p>\\n <button onClick={goToPrevStep} disabled={!canGoToPrevStep}>Back</button>\\n <button onClick={goToNextStep} disabled={!canGoToNextStep}>Next</button>\\n <button onClick={reset}>Reset</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { Dispatch, SetStateAction, useCallback, useMemo, useState } from \\\"react\\\";\\n\\n/**\\n * The helpers returned as the second tuple element of {@link useStep}.\\n */\\nexport interface UseStepActions {\\n /** Advance to the next step (no-op when already at `maxStep`). */\\n goToNextStep: () => void;\\n /** Go back to the previous step (no-op when already at step 1). */\\n goToPrevStep: () => void;\\n /** Reset back to step 1. */\\n reset: () => void;\\n /** Whether a next step is available. */\\n canGoToNextStep: boolean;\\n /** Whether a previous step is available. */\\n canGoToPrevStep: boolean;\\n /** Set the step directly (1-indexed); throws if out of the `1..maxStep` range. */\\n setStep: Dispatch<SetStateAction<number>>;\\n}\\n\\n/**\\n * A custom hook to manage a 1-indexed step counter (e.g. for wizards/steppers).\\n *\\n * @param maxStep - The highest reachable step (inclusive). Steps run from `1` to `maxStep`.\\n * @returns A tuple of the current step and an actions object.\\n */\\nexport const useStep = (maxStep: number): [number, UseStepActions] => {\\n const [currentStep, setCurrentStep] = useState<number>(1);\\n\\n const canGoToNextStep = useMemo(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);\\n const canGoToPrevStep = useMemo(() => currentStep - 1 >= 1, [currentStep]);\\n\\n const setStep = useCallback<Dispatch<SetStateAction<number>>>(\\n (step) => {\\n setCurrentStep((prev) => {\\n const newStep = step instanceof Function ? step(prev) : step;\\n if (newStep >= 1 && newStep <= maxStep) {\\n return newStep;\\n }\\n throw new Error(\\\"Step not valid\\\");\\n });\\n },\\n [maxStep],\\n );\\n\\n const goToNextStep = useCallback(() => {\\n setCurrentStep((prev) => (prev + 1 <= maxStep ? prev + 1 : prev));\\n }, [maxStep]);\\n\\n const goToPrevStep = useCallback(() => {\\n setCurrentStep((prev) => (prev - 1 >= 1 ? prev - 1 : prev));\\n }, []);\\n\\n const reset = useCallback(() => {\\n setCurrentStep(1);\\n }, []);\\n\\n return [currentStep, { goToNextStep, goToPrevStep, canGoToNextStep, canGoToPrevStep, setStep, reset }];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-step/use-step.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-step\",\n \"useCases\": [\n \"state\",\n \"use-step\",\n \"usestep\",\n \"user input\",\n \"wizard\",\n \"state management\",\n \"indexed\",\n \"step\",\n \"counter\",\n \"wizards\",\n \"steppers\"\n ]\n },\n {\n \"slug\": \"use-countdown\",\n \"name\": \"useCountdown\",\n \"description\": \"Self-stopping countdown or count-up timer.\",\n \"category\": \"state\",\n \"signature\": \"useCountdown(options: UseCountdownOptions): [number, UseCountdownActions]\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseCountdownOptions\",\n \"defaultValue\": null,\n \"description\": \"Configures the timer — start value, tick interval, direction and stop value. See below.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] count\",\n \"type\": \"number\",\n \"description\": \"The current count. Ticks by ±1 every intervalMs while running.\"\n },\n {\n \"name\": \"[1] actions\",\n \"type\": \"UseCountdownActions\",\n \"description\": \"Start, pause and reset controls — see below.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseCountdownOptions\",\n \"description\": \"The single options argument.\",\n \"rows\": [\n {\n \"name\": \"countStart\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The value the countdown starts from.\"\n },\n {\n \"name\": \"intervalMs\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Milliseconds between ticks. Defaults to 1000.\"\n },\n {\n \"name\": \"isIncrement\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Count up instead of down. Defaults to false.\"\n },\n {\n \"name\": \"countStop\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The value at which the timer stops itself. Defaults to 0.\"\n }\n ]\n },\n {\n \"name\": \"UseCountdownActions\",\n \"description\": \"The second tuple element — the timer controls.\",\n \"rows\": [\n {\n \"name\": \"startCountdown\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Starts (or resumes) the timer.\"\n },\n {\n \"name\": \"stopCountdown\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Pauses the timer without resetting the count.\"\n },\n {\n \"name\": \"resetCountdown\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Stops the timer and resets the count to countStart.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [count, { startCountdown, stopCountdown, resetCountdown }] = useCountdown({\\n countStart: 10,\\n intervalMs: 1000,\\n });\\n\\n return (\\n <div>\\n <p>{count}</p>\\n <button onClick={startCountdown}>Start</button>\\n <button onClick={stopCountdown}>Pause</button>\\n <button onClick={resetCountdown}>Reset</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useRef, useState } from \\\"react\\\";\\n\\n/**\\n * Options for {@link useCountdown}.\\n */\\nexport interface UseCountdownOptions {\\n /** The value the countdown starts from. */\\n countStart: number;\\n /** Milliseconds between ticks. Defaults to `1000`. */\\n intervalMs?: number;\\n /** Count up instead of down. Defaults to `false`. */\\n isIncrement?: boolean;\\n /** The value at which the countdown stops. Defaults to `0`. */\\n countStop?: number;\\n}\\n\\n/**\\n * The controls returned as the second tuple element of {@link useCountdown}.\\n */\\nexport interface UseCountdownActions {\\n /** Start (or resume) the countdown. */\\n startCountdown: () => void;\\n /** Pause the countdown. */\\n stopCountdown: () => void;\\n /** Stop and reset the count back to `countStart`. */\\n resetCountdown: () => void;\\n}\\n\\n/**\\n * A custom hook to manage a self-stopping countdown (or count-up) timer.\\n *\\n * The timer ticks by ±1 every `intervalMs` and stops automatically once it\\n * reaches `countStop`. Timers are created inside an effect, so the hook is\\n * SSR-safe and every interval is cleared on cleanup.\\n *\\n * @param options - See {@link UseCountdownOptions}.\\n * @returns A tuple of the current count and a controls object.\\n */\\nexport const useCountdown = ({\\n countStart,\\n intervalMs = 1000,\\n isIncrement = false,\\n countStop = 0,\\n}: UseCountdownOptions): [number, UseCountdownActions] => {\\n const [count, setCount] = useState<number>(countStart);\\n const [isRunning, setIsRunning] = useState<boolean>(false);\\n\\n const startCountdown = useCallback(() => setIsRunning(true), []);\\n const stopCountdown = useCallback(() => setIsRunning(false), []);\\n const resetCountdown = useCallback(() => {\\n setIsRunning(false);\\n setCount(countStart);\\n }, [countStart]);\\n\\n const tick = useRef<() => void>(() => {});\\n tick.current = () => {\\n setCount((prev) => (isIncrement ? prev + 1 : prev - 1));\\n };\\n\\n useEffect(() => {\\n if (isRunning && count === countStop) {\\n setIsRunning(false);\\n }\\n }, [count, countStop, isRunning]);\\n\\n useEffect(() => {\\n if (!isRunning) return;\\n const id = setInterval(() => tick.current(), intervalMs);\\n return () => clearInterval(id);\\n }, [isRunning, intervalMs]);\\n\\n return [count, { startCountdown, stopCountdown, resetCountdown }];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-countdown/use-countdown.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-countdown\",\n \"useCases\": [\n \"state\",\n \"use-countdown\",\n \"usecountdown\",\n \"self\",\n \"stopping\",\n \"countdown\",\n \"count\",\n \"timer\"\n ]\n },\n {\n \"slug\": \"use-map\",\n \"name\": \"useMap\",\n \"description\": \"Manage a Map as immutable React state.\",\n \"category\": \"state\",\n \"signature\": \"useMap<K, V>(initialState?: MapOrEntries<K, V>): [ReadOnlyMap<K, V>, UseMapActions<K, V>]\",\n \"parameters\": [\n {\n \"name\": \"initialState\",\n \"type\": \"MapOrEntries<K, V>\",\n \"defaultValue\": \"new Map()\",\n \"description\": \"Initial entries as a Map or an array of [key, value] pairs.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] map\",\n \"type\": \"ReadOnlyMap<K, V>\",\n \"description\": \"A read-only view of the map — the mutating set/clear/delete methods are omitted; use the actions instead. get, has, size and iteration remain.\"\n },\n {\n \"name\": \"[1] actions\",\n \"type\": \"UseMapActions<K, V>\",\n \"description\": \"Stable helpers that replace the map with a fresh copy so React re-renders — see below.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseMapActions\",\n \"description\": \"The second tuple element — the map mutation helpers.\",\n \"rows\": [\n {\n \"name\": \"set\",\n \"type\": \"(key: K, value: V) => void\",\n \"defaultValue\": null,\n \"description\": \"Adds or updates one entry.\"\n },\n {\n \"name\": \"setAll\",\n \"type\": \"(entries: MapOrEntries<K, V>) => void\",\n \"defaultValue\": null,\n \"description\": \"Replaces every entry with the given Map or [key, value] pairs.\"\n },\n {\n \"name\": \"remove\",\n \"type\": \"(key: K) => void\",\n \"defaultValue\": null,\n \"description\": \"Deletes the entry for the given key.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Empties the map.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [map, { set, remove, reset }] = useMap<string, string>([\\n [\\\"theme\\\", \\\"dark\\\"],\\n ]);\\n\\n return (\\n <div>\\n <button onClick={() => set(\\\"lang\\\", \\\"en\\\")}>Set lang</button>\\n <button onClick={() => remove(\\\"theme\\\")}>Remove theme</button>\\n <button onClick={reset}>Reset</button>\\n <ul>\\n {[...map.entries()].map(([key, value]) => (\\n <li key={key}>{key}: {value}</li>\\n ))}\\n </ul>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useState } from \\\"react\\\";\\n\\nexport type MapOrEntries<K, V> = Map<K, V> | [K, V][];\\n\\nexport interface UseMapActions<K, V> {\\n set: (key: K, value: V) => void;\\n setAll: (entries: MapOrEntries<K, V>) => void;\\n remove: (key: K) => void;\\n reset: () => void;\\n}\\n\\nexport type ReadOnlyMap<K, V> = Omit<\\n Map<K, V>,\\n \\\"set\\\" | \\\"clear\\\" | \\\"delete\\\"\\n>;\\n\\nexport type UseMapReturn<K, V> = [ReadOnlyMap<K, V>, UseMapActions<K, V>];\\n\\n/**\\n * Manages a `Map` as immutable React state, returning a read-only view plus\\n * stable mutation helpers.\\n *\\n * The returned map omits the mutating `Map` methods (`set`/`clear`/`delete`);\\n * use the action helpers instead, each of which replaces the map with a fresh\\n * copy so React re-renders. No browser globals are touched, so it is SSR-safe.\\n *\\n * @param initialState - Initial entries as a `Map` or an array of `[key, value]`\\n * pairs.\\n * @returns `[map, { set, setAll, remove, reset }]`.\\n */\\nexport function useMap<K, V>(\\n initialState: MapOrEntries<K, V> = new Map(),\\n): UseMapReturn<K, V> {\\n const [map, setMap] = useState<Map<K, V>>(() => new Map(initialState));\\n\\n const set = useCallback<UseMapActions<K, V>[\\\"set\\\"]>((key, value) => {\\n setMap((prev) => {\\n const next = new Map(prev);\\n next.set(key, value);\\n return next;\\n });\\n }, []);\\n\\n const setAll = useCallback<UseMapActions<K, V>[\\\"setAll\\\"]>((entries) => {\\n setMap(new Map(entries));\\n }, []);\\n\\n const remove = useCallback<UseMapActions<K, V>[\\\"remove\\\"]>((key) => {\\n setMap((prev) => {\\n const next = new Map(prev);\\n next.delete(key);\\n return next;\\n });\\n }, []);\\n\\n const reset = useCallback<UseMapActions<K, V>[\\\"reset\\\"]>(() => {\\n setMap(new Map());\\n }, []);\\n\\n return [map, { set, setAll, remove, reset }];\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-map/use-map.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-map\",\n \"useCases\": [\n \"state\",\n \"use-map\",\n \"usemap\",\n \"manage\",\n \"immutable\",\n \"react\"\n ]\n },\n {\n \"slug\": \"use-debounce\",\n \"name\": \"useDebounce\",\n \"description\": \"Debounces a changing value.\",\n \"category\": \"effects\",\n \"signature\": \"useDebounce<T>(value: T, delay: number): T\",\n \"parameters\": [\n {\n \"name\": \"value\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"The value to debounce — any type works.\"\n },\n {\n \"name\": \"delay\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Milliseconds the value must stay unchanged before the debounced value updates.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"debouncedValue\",\n \"type\": \"T\",\n \"description\": \"Trails the input value, updating only after delay ms without a change.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [text, setText] = useState(\\\"\\\");\\n const debounced = useDebounce(text, 500);\\n\\n return (\\n <div>\\n <input value={text} onChange={(e) => setText(e.target.value)} />\\n <p>Value: {text}</p>\\n <p>Debounced: {debounced}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\nexport const useDebounce = <T>(value: T, delay: number): T => {\\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\\n\\n useEffect(() => {\\n const timer = setTimeout(() => {\\n setDebouncedValue(value);\\n }, delay);\\n\\n return () => {\\n clearTimeout(timer);\\n };\\n }, [value, delay]);\\n\\n return debouncedValue;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-debounce/use-debounce.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-debounce\",\n \"useCases\": [\n \"effects\",\n \"use-debounce\",\n \"usedebounce\",\n \"rate limiting\",\n \"search input\",\n \"resize delay\",\n \"typing delay\",\n \"api optimization\",\n \"debounces\",\n \"changing\",\n \"value\"\n ]\n },\n {\n \"slug\": \"use-debounce-value\",\n \"name\": \"useDebounceValue\",\n \"description\": \"State whose debounced copy updates after a pause.\",\n \"category\": \"effects\",\n \"signature\": \"useDebounceValue<T>(initialValue: T | (() => T), delayMs?: number, options?: DebounceOptions & { equalityFn?: (left: T, right: T) => boolean }): [T, DebouncedState<[T | ((prev: T) => T)], void>]\",\n \"parameters\": [\n {\n \"name\": \"initialValue\",\n \"type\": \"T | (() => T)\",\n \"defaultValue\": null,\n \"description\": \"The starting value, or a factory evaluated once on mount — the same lazy-initializer contract as useState.\"\n },\n {\n \"name\": \"delayMs\",\n \"type\": \"number\",\n \"defaultValue\": \"500\",\n \"description\": \"Milliseconds of inactivity before the debounced value catches up to the latest set value.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"DebounceOptions & { equalityFn? }\",\n \"defaultValue\": \"{}\",\n \"description\": \"DebounceOptions plus an optional equalityFn (left, right) => boolean — when it reports the values equal, the debounced update is skipped. See the tables below.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] debouncedValue\",\n \"type\": \"T\",\n \"description\": \"The value that trails the setter, updating only after delayMs of quiet.\"\n },\n {\n \"name\": \"[1] setValue\",\n \"type\": \"DebouncedState<[T | ((prev: T) => T)], void>\",\n \"description\": \"A debounced setter accepting a value or updater; it also carries cancel, flush and isPending (see DebouncedState).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"DebounceOptions\",\n \"description\": \"Controls how the debounced invocation is scheduled.\",\n \"rows\": [\n {\n \"name\": \"leading\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Invoke on the leading edge — run once immediately on the first call of a burst.\"\n },\n {\n \"name\": \"trailing\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Invoke on the trailing edge — run after the burst settles.\"\n },\n {\n \"name\": \"maxWait\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The maximum time the callback may be delayed before it is forced to run, even during a continuous burst.\"\n }\n ]\n },\n {\n \"name\": \"DebouncedState<Args, R>\",\n \"description\": \"The debounced function, plus manual control methods.\",\n \"rows\": [\n {\n \"name\": \"(...args)\",\n \"type\": \"(...args: Args) => R | undefined\",\n \"defaultValue\": null,\n \"description\": \"Calling it schedules an invocation and returns the last computed result — undefined before the first run.\"\n },\n {\n \"name\": \"cancel\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Cancels any pending trailing invocation.\"\n },\n {\n \"name\": \"flush\",\n \"type\": \"() => R | undefined\",\n \"defaultValue\": null,\n \"description\": \"Immediately runs any pending invocation and returns its result.\"\n },\n {\n \"name\": \"isPending\",\n \"type\": \"() => boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether a trailing invocation is currently scheduled.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [text, setText] = useState(\\\"\\\");\\n const [debounced, setValue] = useDebounceValue(\\\"\\\", 500);\\n\\n return (\\n <div>\\n <input\\n value={text}\\n onChange={(e) => {\\n setText(e.target.value);\\n setValue(e.target.value);\\n }}\\n />\\n <p>Debounced: {debounced}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef, useState } from \\\"react\\\";\\nimport {\\n useDebounceCallback,\\n type DebounceOptions,\\n type DebouncedState,\\n} from \\\"../use-debounce-callback\\\";\\n\\n/**\\n * The tuple returned by {@link useDebounceValue}: the debounced value and a\\n * setter, plus the underlying debounced updater for manual control.\\n */\\nexport type UseDebounceValueReturn<T> = [\\n T,\\n DebouncedState<[value: T | ((prev: T) => T)], void>,\\n];\\n\\n/**\\n * Tracks a value and returns a debounced copy that only updates after\\n * `delayMs` of inactivity.\\n *\\n * The initial value may be a factory (evaluated once, like `useState`). The\\n * returned setter is a debounced function exposing `cancel`, `flush`, and\\n * `isPending`; the value equality check can be customised via `options.equalityFn`.\\n *\\n * @param initialValue - The starting value or a factory producing it.\\n * @param delayMs - Milliseconds of inactivity before the debounced value updates.\\n * @param options - Debounce edge options plus an optional `equalityFn`.\\n * @returns `[debouncedValue, setValue]` where `setValue` also carries `cancel`/`flush`/`isPending`.\\n */\\nexport const useDebounceValue = <T>(\\n initialValue: T | (() => T),\\n delayMs: number = 500,\\n options: DebounceOptions & { equalityFn?: (left: T, right: T) => boolean } = {},\\n): UseDebounceValueReturn<T> => {\\n const eq = options.equalityFn ?? ((left: T, right: T) => left === right);\\n\\n const unwrap = (v: T | (() => T)): T =>\\n typeof v === \\\"function\\\" ? (v as () => T)() : v;\\n\\n const [debouncedValue, setDebouncedValue] = useState<T>(() =>\\n unwrap(initialValue),\\n );\\n const previousValue = useRef<T>(debouncedValue);\\n\\n const updateDebouncedValue = useDebounceCallback(\\n (value: T | ((prev: T) => T)) => {\\n const next =\\n typeof value === \\\"function\\\"\\n ? (value as (prev: T) => T)(previousValue.current)\\n : value;\\n if (!eq(previousValue.current, next)) {\\n previousValue.current = next;\\n setDebouncedValue(next);\\n }\\n },\\n delayMs,\\n options,\\n );\\n\\n useEffect(() => {\\n return () => updateDebouncedValue.cancel();\\n }, [updateDebouncedValue]);\\n\\n return [debouncedValue, updateDebouncedValue];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-debounce-value/use-debounce-value.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-debounce-value\",\n \"useCases\": [\n \"effects\",\n \"use-debounce-value\",\n \"usedebouncevalue\",\n \"rate limiting\",\n \"search input\",\n \"resize delay\",\n \"typing delay\",\n \"api optimization\",\n \"state\",\n \"whose\",\n \"debounced\",\n \"copy\",\n \"updates\",\n \"after\",\n \"pause\"\n ]\n },\n {\n \"slug\": \"use-debounce-callback\",\n \"name\": \"useDebounceCallback\",\n \"description\": \"Debounces a callback, with cancel, flush and isPending.\",\n \"category\": \"effects\",\n \"signature\": \"useDebounceCallback<Args, R>(fn: (...args: Args) => R, delayMs?: number, options?: DebounceOptions): DebouncedState<Args, R>\",\n \"parameters\": [\n {\n \"name\": \"fn\",\n \"type\": \"(...args: Args) => R\",\n \"defaultValue\": null,\n \"description\": \"The function to debounce. The returned function keeps a stable identity across renders but always invokes the latest fn.\"\n },\n {\n \"name\": \"delayMs\",\n \"type\": \"number\",\n \"defaultValue\": \"500\",\n \"description\": \"Milliseconds to wait after the last call before fn runs.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"DebounceOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Leading/trailing edge and maxWait behaviour. See the table below.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"debounced\",\n \"type\": \"DebouncedState<Args, R>\",\n \"description\": \"A debounced version of fn with a stable identity, carrying cancel, flush and isPending. Any pending call is cancelled on unmount.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"DebounceOptions\",\n \"description\": \"Controls how the debounced invocation is scheduled.\",\n \"rows\": [\n {\n \"name\": \"leading\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Invoke on the leading edge — run once immediately on the first call of a burst.\"\n },\n {\n \"name\": \"trailing\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Invoke on the trailing edge — run after the burst settles.\"\n },\n {\n \"name\": \"maxWait\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The maximum time the callback may be delayed before it is forced to run, even during a continuous burst.\"\n }\n ]\n },\n {\n \"name\": \"DebouncedState<Args, R>\",\n \"description\": \"The debounced function, plus manual control methods.\",\n \"rows\": [\n {\n \"name\": \"(...args)\",\n \"type\": \"(...args: Args) => R | undefined\",\n \"defaultValue\": null,\n \"description\": \"Calling it schedules an invocation and returns the last computed result — undefined before the first run.\"\n },\n {\n \"name\": \"cancel\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Cancels any pending trailing invocation.\"\n },\n {\n \"name\": \"flush\",\n \"type\": \"() => R | undefined\",\n \"defaultValue\": null,\n \"description\": \"Immediately runs any pending invocation and returns its result.\"\n },\n {\n \"name\": \"isPending\",\n \"type\": \"() => boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether a trailing invocation is currently scheduled.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [query, setQuery] = useState(\\\"\\\");\\n\\n const search = useDebounceCallback((q: string) => {\\n console.log(\\\"searching\\\", q);\\n }, 600);\\n\\n return (\\n <input\\n value={query}\\n onChange={(e) => {\\n setQuery(e.target.value);\\n search(e.target.value);\\n }}\\n />\\n );\\n}\",\n \"source\": \"import { useEffect, useMemo, useRef } from \\\"react\\\";\\nimport { useEventCallback } from \\\"../use-event-callback\\\";\\nimport { useUnmount } from \\\"../use-unmount\\\";\\n\\n/**\\n * Options controlling how {@link useDebounceCallback} schedules invocations.\\n */\\nexport interface DebounceOptions {\\n /** Invoke on the leading edge of the timeout. Defaults to `false`. */\\n leading?: boolean;\\n /** Invoke on the trailing edge of the timeout. Defaults to `true`. */\\n trailing?: boolean;\\n /** The maximum time the callback is allowed to be delayed before it is forced to run. */\\n maxWait?: number;\\n}\\n\\n/**\\n * A debounced function with manual control methods.\\n */\\nexport interface DebouncedState<Args extends unknown[], R> {\\n (...args: Args): R | undefined;\\n /** Cancel any pending trailing invocation. */\\n cancel: () => void;\\n /** Immediately invoke any pending trailing invocation. */\\n flush: () => R | undefined;\\n /** Whether a trailing invocation is currently pending. */\\n isPending: () => boolean;\\n}\\n\\n/**\\n * Creates a debounced version of `fn` that delays invoking it until `delayMs`\\n * have elapsed since the last call.\\n *\\n * The returned function keeps a stable identity across renders while always\\n * invoking the latest `fn`, and exposes `cancel`, `flush`, and `isPending` for\\n * manual control. Any pending invocation is cancelled on unmount, so the hook\\n * is SSR-safe (no timer is scheduled until the debounced function is called).\\n *\\n * @param fn - The function to debounce.\\n * @param delayMs - Milliseconds to wait after the last call. Defaults to `500`.\\n * @param options - Leading/trailing edge and `maxWait` behaviour.\\n * @returns A debounced callback with `cancel`, `flush`, and `isPending`.\\n */\\nexport const useDebounceCallback = <Args extends unknown[], R>(\\n fn: (...args: Args) => R,\\n delayMs: number = 500,\\n options: DebounceOptions = {},\\n): DebouncedState<Args, R> => {\\n const timeoutId = useRef<ReturnType<typeof setTimeout>>();\\n const maxTimeoutId = useRef<ReturnType<typeof setTimeout>>();\\n const lastArgs = useRef<Args>();\\n const lastResult = useRef<R>();\\n const lastInvokeTime = useRef<number>(0);\\n\\n const leading = options.leading ?? false;\\n const trailing = options.trailing ?? true;\\n const maxWait = options.maxWait;\\n\\n const latestFn = useEventCallback(fn);\\n\\n useEffect(() => {\\n lastInvokeTime.current = 0;\\n }, [delayMs, leading, trailing, maxWait]);\\n\\n const debounced = useMemo(() => {\\n const invoke = (): R | undefined => {\\n const args = lastArgs.current;\\n if (!args) return undefined;\\n lastArgs.current = undefined;\\n lastInvokeTime.current = Date.now();\\n lastResult.current = latestFn(...args);\\n return lastResult.current;\\n };\\n\\n const clearTimers = (): void => {\\n if (timeoutId.current !== undefined) {\\n clearTimeout(timeoutId.current);\\n timeoutId.current = undefined;\\n }\\n if (maxTimeoutId.current !== undefined) {\\n clearTimeout(maxTimeoutId.current);\\n maxTimeoutId.current = undefined;\\n }\\n };\\n\\n const trailingEdge = (): void => {\\n clearTimers();\\n if (trailing && lastArgs.current) {\\n invoke();\\n } else {\\n lastArgs.current = undefined;\\n }\\n };\\n\\n const state: DebouncedState<Args, R> = Object.assign(\\n (...args: Args): R | undefined => {\\n lastArgs.current = args;\\n\\n const isFirstCall =\\n timeoutId.current === undefined &&\\n maxTimeoutId.current === undefined;\\n\\n if (timeoutId.current !== undefined) {\\n clearTimeout(timeoutId.current);\\n }\\n\\n if (leading && isFirstCall) {\\n invoke();\\n }\\n\\n timeoutId.current = setTimeout(trailingEdge, delayMs);\\n\\n if (maxWait !== undefined && maxTimeoutId.current === undefined) {\\n maxTimeoutId.current = setTimeout(() => {\\n clearTimers();\\n if (lastArgs.current) invoke();\\n }, maxWait);\\n }\\n\\n return lastResult.current;\\n },\\n {\\n cancel: (): void => {\\n clearTimers();\\n lastArgs.current = undefined;\\n },\\n flush: (): R | undefined => {\\n if (timeoutId.current === undefined) return lastResult.current;\\n clearTimers();\\n return lastArgs.current ? invoke() : lastResult.current;\\n },\\n isPending: (): boolean =>\\n timeoutId.current !== undefined && lastArgs.current !== undefined,\\n },\\n );\\n\\n return state;\\n }, [delayMs, leading, trailing, maxWait, latestFn]);\\n\\n useUnmount(() => {\\n debounced.cancel();\\n });\\n\\n return debounced;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-debounce-callback/use-debounce-callback.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-debounce-callback\",\n \"useCases\": [\n \"effects\",\n \"use-debounce-callback\",\n \"usedebouncecallback\",\n \"rate limiting\",\n \"search input\",\n \"resize delay\",\n \"typing delay\",\n \"api optimization\",\n \"debounces\",\n \"callback\",\n \"with\",\n \"cancel\",\n \"flush\",\n \"ispending\"\n ]\n },\n {\n \"slug\": \"use-interval\",\n \"name\": \"useInterval\",\n \"description\": \"Runs a callback on a fixed interval; pause by passing null.\",\n \"category\": \"effects\",\n \"signature\": \"useInterval(callback: () => void, delay: number | null): void\",\n \"parameters\": [\n {\n \"name\": \"callback\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Runs on every tick. Always fires the latest callback — the hook keeps a ref, so you never re-arm the timer just to close over fresh state.\"\n },\n {\n \"name\": \"delay\",\n \"type\": \"number | null\",\n \"defaultValue\": null,\n \"description\": \"Milliseconds between ticks. Pass null to pause — the interval is cleared, so nothing runs until you set a number again.\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [count, setCount] = useState(0);\\n const [running, setRunning] = useState(true);\\n\\n useInterval(() => setCount((prev) => prev + 1), running ? 1000 : null);\\n\\n return (\\n <div>\\n <p>{count}</p>\\n <button onClick={() => setRunning((prev) => !prev)}>\\n {running ? \\\"Pause\\\" : \\\"Resume\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef } from \\\"react\\\";\\n\\n/**\\n * A custom hook that repeatedly calls a callback on a fixed interval.\\n *\\n * The latest `callback` is always invoked without resetting the timer, and the\\n * interval is created inside an effect so the hook is SSR-safe and always\\n * cleared on cleanup. Passing `null` as `delay` pauses the interval.\\n *\\n * @param callback - The function to run on every tick.\\n * @param delay - Milliseconds between ticks, or `null` to pause.\\n */\\nexport const useInterval = (callback: () => void, delay: number | null): void => {\\n const savedCallback = useRef<() => void>(callback);\\n\\n useEffect(() => {\\n savedCallback.current = callback;\\n }, [callback]);\\n\\n useEffect(() => {\\n if (delay === null) return;\\n const id = setInterval(() => savedCallback.current(), delay);\\n return () => clearInterval(id);\\n }, [delay]);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-interval/use-interval.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-interval\",\n \"useCases\": [\n \"effects\",\n \"use-interval\",\n \"useinterval\",\n \"runs\",\n \"callback\",\n \"fixed\",\n \"interval\",\n \"pause\",\n \"passing\",\n \"null\"\n ]\n },\n {\n \"slug\": \"use-timeout\",\n \"name\": \"useTimeout\",\n \"description\": \"Runs a callback once after a delay; cancel by passing null.\",\n \"category\": \"effects\",\n \"signature\": \"useTimeout(callback: () => void, delay: number | null): void\",\n \"parameters\": [\n {\n \"name\": \"callback\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Runs once after the delay elapses. The hook keeps a ref to the latest callback, so it always fires with fresh state.\"\n },\n {\n \"name\": \"delay\",\n \"type\": \"number | null\",\n \"defaultValue\": null,\n \"description\": \"Milliseconds to wait before firing. Pass null to disable — a change to null before the delay elapses cancels the pending timeout.\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [visible, setVisible] = useState(false);\\n const [delay, setDelay] = useState<number | null>(null);\\n\\n useTimeout(() => {\\n setVisible(true);\\n setDelay(null);\\n }, delay);\\n\\n return (\\n <div>\\n <button onClick={() => setDelay(2000)}>Reveal in 2s</button>\\n {visible && <p>Here!</p>}\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef } from \\\"react\\\";\\n\\n/**\\n * A custom hook that calls a callback once after a delay.\\n *\\n * The latest `callback` is always invoked without restarting the timer, and the\\n * timeout is created inside an effect so the hook is SSR-safe and always\\n * cleared on cleanup. Passing `null` as `delay` cancels the pending timeout.\\n *\\n * @param callback - The function to run when the timeout elapses.\\n * @param delay - Milliseconds to wait before running, or `null` to cancel.\\n */\\nexport const useTimeout = (callback: () => void, delay: number | null): void => {\\n const savedCallback = useRef<() => void>(callback);\\n\\n useEffect(() => {\\n savedCallback.current = callback;\\n }, [callback]);\\n\\n useEffect(() => {\\n if (delay === null) return;\\n const id = setTimeout(() => savedCallback.current(), delay);\\n return () => clearTimeout(id);\\n }, [delay]);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-timeout/use-timeout.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-timeout\",\n \"useCases\": [\n \"effects\",\n \"use-timeout\",\n \"usetimeout\",\n \"runs\",\n \"callback\",\n \"once\",\n \"after\",\n \"delay\",\n \"cancel\",\n \"passing\",\n \"null\"\n ]\n },\n {\n \"slug\": \"use-isomorphic-layout-effect\",\n \"name\": \"useIsomorphicLayoutEffect\",\n \"description\": \"useLayoutEffect on the client, useEffect on the server.\",\n \"category\": \"effects\",\n \"signature\": \"useIsomorphicLayoutEffect(effect: EffectCallback, deps?: DependencyList): void\",\n \"parameters\": [\n {\n \"name\": \"effect\",\n \"type\": \"EffectCallback\",\n \"defaultValue\": null,\n \"description\": \"The effect to run — same contract as React's useLayoutEffect, including an optional cleanup return.\"\n },\n {\n \"name\": \"deps\",\n \"type\": \"DependencyList\",\n \"defaultValue\": null,\n \"description\": \"Dependency array controlling when the effect re-runs. Omit to run after every render.\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const boxRef = useRef<HTMLDivElement>(null);\\n const [width, setWidth] = useState(0);\\n\\n useIsomorphicLayoutEffect(() => {\\n setWidth(boxRef.current?.offsetWidth ?? 0);\\n }, []);\\n\\n return <div ref={boxRef}>Measured: {width}px</div>;\\n}\",\n \"source\": \"import { useEffect, useLayoutEffect } from \\\"react\\\";\\n\\n/**\\n * `useLayoutEffect` that safely falls back to `useEffect` on the server.\\n *\\n * `useLayoutEffect` warns when run during server rendering, so this picks the\\n * layout effect only when a DOM is present and `useEffect` otherwise. The public\\n * signature matches React's `useLayoutEffect`.\\n */\\nexport const useIsomorphicLayoutEffect =\\n typeof window !== \\\"undefined\\\" ? useLayoutEffect : useEffect;\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-isomorphic-layout-effect/use-isomorphic-layout-effect.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-isomorphic-layout-effect\",\n \"useCases\": [\n \"effects\",\n \"use-isomorphic-layout-effect\",\n \"useisomorphiclayouteffect\",\n \"uselayouteffect\",\n \"client\",\n \"useeffect\",\n \"server\"\n ]\n },\n {\n \"slug\": \"use-event-callback\",\n \"name\": \"useEventCallback\",\n \"description\": \"A stable callback that always calls the latest closure.\",\n \"category\": \"effects\",\n \"signature\": \"useEventCallback<Args extends unknown[], R>(fn: (...args: Args) => R): (...args: Args) => R\",\n \"parameters\": [\n {\n \"name\": \"fn\",\n \"type\": \"(...args: Args) => R\",\n \"defaultValue\": null,\n \"description\": \"The function to keep current behind a stable reference. Calling during render throws — it is meant for event handlers and effects.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"callback\",\n \"type\": \"(...args: Args) => R\",\n \"description\": \"A memoized callback with an unchanging identity that always forwards to the latest fn.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [count, setCount] = useState(0);\\n\\n const readLatest = useEventCallback(() => count);\\n\\n return (\\n <div>\\n <button onClick={() => setCount((prev) => prev + 1)}>{count}</button>\\n <button onClick={() => alert(readLatest())}>Read latest</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useRef } from \\\"react\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\n/**\\n * Wraps a function so it keeps a stable identity across renders while always\\n * calling the latest version.\\n *\\n * The returned callback never changes, so it is safe to pass to memoized\\n * children or effect dependency arrays without causing re-subscriptions, yet it\\n * always invokes the most recent `fn` closure.\\n *\\n * @param fn - The function to keep current behind a stable reference.\\n * @returns A memoized callback that forwards to the latest `fn`.\\n */\\nexport const useEventCallback = <Args extends unknown[], R>(\\n fn: (...args: Args) => R,\\n): ((...args: Args) => R) => {\\n const ref = useRef<typeof fn>(() => {\\n throw new Error(\\\"Cannot call an event handler while rendering.\\\");\\n });\\n\\n useIsomorphicLayoutEffect(() => {\\n ref.current = fn;\\n }, [fn]);\\n\\n return useCallback((...args: Args) => ref.current(...args), [ref]);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-event-callback/use-event-callback.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-event-callback\",\n \"useCases\": [\n \"effects\",\n \"use-event-callback\",\n \"useeventcallback\",\n \"stable\",\n \"callback\",\n \"that\",\n \"always\",\n \"calls\",\n \"latest\",\n \"closure\"\n ]\n },\n {\n \"slug\": \"use-unmount\",\n \"name\": \"useUnmount\",\n \"description\": \"Runs a cleanup function once, when the component unmounts.\",\n \"category\": \"effects\",\n \"signature\": \"useUnmount(fn: () => void): void\",\n \"parameters\": [\n {\n \"name\": \"fn\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Called exactly once when the component unmounts. The latest closure is captured in a ref, so it always sees fresh values.\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n useUnmount(() => {\\n console.log(\\\"cleanup on unmount\\\");\\n });\\n\\n return <p>Watch the console when I unmount.</p>;\\n}\",\n \"source\": \"import { useEffect, useRef } from \\\"react\\\";\\n\\n/**\\n * Runs a cleanup function exactly once, when the component unmounts.\\n *\\n * The latest `fn` is captured in a ref so the effect can stay mount-scoped\\n * (empty dependency array) while still invoking the current closure on unmount.\\n *\\n * @param fn - The function to call on unmount.\\n */\\nexport const useUnmount = (fn: () => void): void => {\\n const fnRef = useRef(fn);\\n fnRef.current = fn;\\n\\n useEffect(() => () => fnRef.current(), []);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-unmount/use-unmount.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-unmount\",\n \"useCases\": [\n \"effects\",\n \"use-unmount\",\n \"useunmount\",\n \"runs\",\n \"cleanup\",\n \"function\",\n \"once\",\n \"when\",\n \"component\",\n \"unmounts\"\n ]\n },\n {\n \"slug\": \"use-is-client\",\n \"name\": \"useIsClient\",\n \"description\": \"Reports false on the server and true after hydration.\",\n \"category\": \"effects\",\n \"signature\": \"useIsClient(): boolean\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"isClient\",\n \"type\": \"boolean\",\n \"description\": \"false during server rendering and the first hydration pass, then true once mounted in the browser. Gate browser-only UI on it to keep both renders identical.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const isClient = useIsClient();\\n\\n if (!isClient) return <p>Rendering on the server…</p>;\\n\\n return <p>Now running in the browser.</p>;\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * Reports whether the component is running on the client.\\n *\\n * Returns `false` during server rendering and the initial client render, then\\n * flips to `true` after mount. Useful for gating browser-only UI so the server\\n * and first client render stay in sync and hydration does not mismatch.\\n *\\n * @returns `true` once mounted on the client, otherwise `false`.\\n */\\nexport const useIsClient = (): boolean => {\\n const [isClient, setIsClient] = useState<boolean>(false);\\n\\n useEffect(() => {\\n setIsClient(true);\\n }, []);\\n\\n return isClient;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-is-client/use-is-client.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-is-client\",\n \"useCases\": [\n \"effects\",\n \"use-is-client\",\n \"useisclient\",\n \"reports\",\n \"false\",\n \"server\",\n \"true\",\n \"after\",\n \"hydration\"\n ]\n },\n {\n \"slug\": \"use-is-mounted\",\n \"name\": \"useIsMounted\",\n \"description\": \"A stable getter for whether the component is still mounted.\",\n \"category\": \"effects\",\n \"signature\": \"useIsMounted(): () => boolean\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"isMounted\",\n \"type\": \"() => boolean\",\n \"description\": \"A stable getter that returns true while mounted and false after unmount. Call it inside async callbacks before setting state; its identity never changes, so it is safe to omit from dependency arrays.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const isMounted = useIsMounted();\\n\\n async function load() {\\n const data = await fetchData();\\n if (isMounted()) setData(data);\\n }\\n\\n return <button onClick={load}>Load</button>;\\n}\",\n \"source\": \"import { useCallback, useEffect, useRef } from \\\"react\\\";\\n\\n/**\\n * Returns a stable getter that reports whether the component is still mounted.\\n *\\n * Call the returned function inside async callbacks before updating state to\\n * avoid the \\\"state update on an unmounted component\\\" pitfall. The getter keeps a\\n * stable identity, so it is safe to omit from dependency arrays.\\n *\\n * @returns A function that returns `true` while mounted and `false` after unmount.\\n */\\nexport const useIsMounted = (): (() => boolean) => {\\n const isMounted = useRef<boolean>(false);\\n\\n useEffect(() => {\\n isMounted.current = true;\\n\\n return () => {\\n isMounted.current = false;\\n };\\n }, []);\\n\\n return useCallback(() => isMounted.current, []);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-is-mounted/use-is-mounted.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-is-mounted\",\n \"useCases\": [\n \"effects\",\n \"use-is-mounted\",\n \"useismounted\",\n \"stable\",\n \"getter\",\n \"whether\",\n \"component\",\n \"still\",\n \"mounted\"\n ]\n },\n {\n \"slug\": \"use-document-title\",\n \"name\": \"useDocumentTitle\",\n \"description\": \"Keeps document.title in sync with a value, SSR-safe.\",\n \"category\": \"effects\",\n \"signature\": \"useDocumentTitle(title: string, options?: UseDocumentTitleOptions): void\",\n \"parameters\": [\n {\n \"name\": \"title\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The document title to apply. Written to document.title in a layout effect on the client and skipped during server rendering.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseDocumentTitleOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Behaviour options (see below).\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [\n {\n \"name\": \"UseDocumentTitleOptions\",\n \"description\": \"Options controlling unmount behaviour.\",\n \"rows\": [\n {\n \"name\": \"preserveTitleOnUnmount\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"When false, the title captured on mount is restored when the component unmounts. Defaults to true, which leaves the title in place.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n useDocumentTitle(\\\"Dashboard — hookli\\\", {\\n preserveTitleOnUnmount: false,\\n });\\n\\n return <h1>Dashboard</h1>;\\n}\",\n \"source\": \"import { useRef } from \\\"react\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\nimport { useUnmount } from \\\"../use-unmount\\\";\\n\\n/**\\n * Options for {@link useDocumentTitle}.\\n */\\nexport interface UseDocumentTitleOptions {\\n /**\\n * When `false`, the previous document title is restored on unmount. Defaults\\n * to `true`, which leaves the title in place.\\n */\\n preserveTitleOnUnmount?: boolean;\\n}\\n\\n/**\\n * Keeps `document.title` in sync with the given `title`.\\n *\\n * The update runs in a layout effect on the client and is a no-op during server\\n * rendering, so it is SSR-safe. When `preserveTitleOnUnmount` is `false`, the\\n * title captured on mount is restored when the component unmounts.\\n *\\n * @param title - The document title to apply.\\n * @param options - Behaviour options (see {@link UseDocumentTitleOptions}).\\n */\\nexport const useDocumentTitle = (\\n title: string,\\n options: UseDocumentTitleOptions = {},\\n): void => {\\n const { preserveTitleOnUnmount = true } = options;\\n const defaultTitle = useRef<string | null>(null);\\n\\n useIsomorphicLayoutEffect(() => {\\n defaultTitle.current = window.document.title;\\n }, []);\\n\\n useIsomorphicLayoutEffect(() => {\\n window.document.title = title;\\n }, [title]);\\n\\n useUnmount(() => {\\n if (!preserveTitleOnUnmount && defaultTitle.current !== null) {\\n window.document.title = defaultTitle.current;\\n }\\n });\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-document-title/use-document-title.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-document-title\",\n \"useCases\": [\n \"effects\",\n \"use-document-title\",\n \"usedocumenttitle\",\n \"keeps\",\n \"document\",\n \"title\",\n \"sync\",\n \"with\",\n \"value\",\n \"safe\"\n ]\n },\n {\n \"slug\": \"use-event-listener\",\n \"name\": \"useEventListener\",\n \"description\": \"Subscribe to a window, document or element event with cleanup.\",\n \"category\": \"dom\",\n \"signature\": \"useEventListener<K>(eventName: K, handler: (event: Event) => void, element?: RefObject<T>, options?: boolean | AddEventListenerOptions): void\",\n \"parameters\": [\n {\n \"name\": \"eventName\",\n \"type\": \"K\",\n \"defaultValue\": null,\n \"description\": \"The event to listen for, typed against the target's event map (window, document, media query, or element).\"\n },\n {\n \"name\": \"handler\",\n \"type\": \"(event) => void\",\n \"defaultValue\": null,\n \"description\": \"Called with the typed event on every dispatch. Held in a ref, so updating it never detaches and re-attaches the listener.\"\n },\n {\n \"name\": \"element\",\n \"type\": \"RefObject<T>\",\n \"defaultValue\": \"window\",\n \"description\": \"Optional ref to the target. Defaults to window when omitted.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"boolean | AddEventListenerOptions\",\n \"defaultValue\": null,\n \"description\": \"Standard addEventListener options (capture, passive, once).\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const ref = useRef<HTMLDivElement>(null);\\n const [lastKey, setLastKey] = useState(\\\"\\\");\\n\\n useEventListener(\\\"keydown\\\", (event) => setLastKey(event.key));\\n useEventListener(\\\"click\\\", () => console.log(\\\"clicked\\\"), ref);\\n\\n return <div ref={ref}>Last key: {lastKey}</div>;\\n}\",\n \"source\": \"import { useEffect, useRef, type RefObject } from \\\"react\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\n/**\\n * Subscribes to an event on a media query, the window, the document, or an\\n * element ref, cleaning the listener up automatically.\\n *\\n * The target defaults to `window` when no `element` ref is given. The handler is\\n * held in a ref so updating it never detaches and re-attaches the listener, and\\n * the subscription lives inside an effect so the hook is SSR-safe.\\n *\\n * @param eventName - The event to listen for, typed against the target's map.\\n * @param handler - Called with the typed event on every dispatch.\\n * @param element - Optional ref to the target; defaults to `window`.\\n * @param options - Standard `addEventListener` options.\\n */\\nfunction useEventListener<K extends keyof MediaQueryListEventMap>(\\n eventName: K,\\n handler: (event: MediaQueryListEventMap[K]) => void,\\n element: RefObject<MediaQueryList>,\\n options?: boolean | AddEventListenerOptions,\\n): void;\\nfunction useEventListener<K extends keyof WindowEventMap>(\\n eventName: K,\\n handler: (event: WindowEventMap[K]) => void,\\n element?: undefined,\\n options?: boolean | AddEventListenerOptions,\\n): void;\\nfunction useEventListener<K extends keyof DocumentEventMap>(\\n eventName: K,\\n handler: (event: DocumentEventMap[K]) => void,\\n element: RefObject<Document>,\\n options?: boolean | AddEventListenerOptions,\\n): void;\\nfunction useEventListener<\\n K extends keyof HTMLElementEventMap & keyof SVGElementEventMap,\\n T extends HTMLElement | SVGElement = HTMLDivElement,\\n>(\\n eventName: K,\\n handler: (event: HTMLElementEventMap[K] | SVGElementEventMap[K]) => void,\\n element: RefObject<T>,\\n options?: boolean | AddEventListenerOptions,\\n): void;\\nfunction useEventListener<\\n KW extends keyof WindowEventMap,\\n KH extends keyof HTMLElementEventMap & keyof SVGElementEventMap,\\n KM extends keyof MediaQueryListEventMap,\\n KD extends keyof DocumentEventMap,\\n T extends HTMLElement | SVGElement | MediaQueryList | Document = HTMLElement,\\n>(\\n eventName: KW | KH | KM | KD,\\n handler: (\\n event:\\n | WindowEventMap[KW]\\n | HTMLElementEventMap[KH]\\n | SVGElementEventMap[KH]\\n | MediaQueryListEventMap[KM]\\n | DocumentEventMap[KD]\\n | Event,\\n ) => void,\\n element?: RefObject<T>,\\n options?: boolean | AddEventListenerOptions,\\n): void {\\n const savedHandler = useRef(handler);\\n\\n useIsomorphicLayoutEffect(() => {\\n savedHandler.current = handler;\\n }, [handler]);\\n\\n useEffect(() => {\\n const targetElement: T | Window =\\n element?.current ?? (typeof window !== \\\"undefined\\\" ? window : undefined!);\\n\\n if (!targetElement?.addEventListener) return;\\n\\n const listener: typeof handler = (event) => savedHandler.current(event);\\n\\n targetElement.addEventListener(eventName, listener, options);\\n\\n return () => {\\n targetElement.removeEventListener(eventName, listener, options);\\n };\\n }, [eventName, element, options]);\\n}\\n\\nexport { useEventListener };\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-event-listener/use-event-listener.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-event-listener\",\n \"useCases\": [\n \"dom\",\n \"use-event-listener\",\n \"useeventlistener\",\n \"subscribe\",\n \"window\",\n \"document\",\n \"element\",\n \"event\",\n \"with\",\n \"cleanup\"\n ]\n },\n {\n \"slug\": \"use-click-outside\",\n \"name\": \"useClickOutside\",\n \"description\": \"Runs a callback on outside click.\",\n \"category\": \"dom\",\n \"signature\": \"useClickOutside<T extends HTMLElement>(ref: RefObject<T>, callback: () => void): void\",\n \"parameters\": [\n {\n \"name\": \"ref\",\n \"type\": \"RefObject<T>\",\n \"defaultValue\": null,\n \"description\": \"Ref attached to the element that counts as inside — clicks within it (or its children) never fire the callback.\"\n },\n {\n \"name\": \"callback\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Called on every mousedown outside the ref'd element — even while your UI is closed, so guard inside the callback if needed.\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const menuRef = useRef<HTMLDivElement>(null);\\n const [open, setOpen] = useState(false);\\n\\n useClickOutside(menuRef, () => setOpen(false));\\n\\n return (\\n <div ref={menuRef}>\\n <button onClick={() => setOpen((prev) => !prev)}>Actions</button>\\n {open && (\\n <ul role=\\\"menu\\\">\\n <li>Rename</li>\\n <li>Duplicate</li>\\n </ul>\\n )}\\n </div>\\n );\\n}\",\n \"source\": \"import { RefObject, useEffect, useRef } from \\\"react\\\";\\n\\ntype ClickOutsideCallback = () => void;\\n\\nexport const useClickOutside = <T extends HTMLElement>(\\n ref: React.Ref<T>,\\n callback: ClickOutsideCallback\\n): void => {\\n useEffect(() => {\\n const handleClickOutside = (event: MouseEvent) => {\\n if (ref) {\\n if (\\n (ref as RefObject<T>) &&\\n \\\"current\\\" in ref &&\\n !ref?.current?.contains(event.target as Node)\\n ) {\\n callback();\\n }\\n }\\n };\\n\\n document.addEventListener(\\\"mousedown\\\", handleClickOutside);\\n\\n return () => {\\n document.removeEventListener(\\\"mousedown\\\", handleClickOutside);\\n };\\n }, [ref, callback]);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-click-outside/use-click-outside.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-click-outside\",\n \"useCases\": [\n \"dom\",\n \"use-click-outside\",\n \"useclickoutside\",\n \"interaction\",\n \"dom events\",\n \"popover\",\n \"dropdown\",\n \"modal\",\n \"runs\",\n \"callback\",\n \"outside\",\n \"click\"\n ]\n },\n {\n \"slug\": \"use-mouse-position\",\n \"name\": \"useMousePosition\",\n \"description\": \"Cursor coordinates within an element.\",\n \"category\": \"dom\",\n \"signature\": \"useMousePosition<T extends HTMLElement>(ref: RefObject<T>): { x: number | null; y: number | null }\",\n \"parameters\": [\n {\n \"name\": \"ref\",\n \"type\": \"RefObject<T>\",\n \"defaultValue\": null,\n \"description\": \"Ref attached to the element the coordinates are measured against.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"x\",\n \"type\": \"number | null\",\n \"description\": \"Cursor X relative to the element's left edge; null until the first mousemove. Updates on every window mousemove, so it can go negative or exceed the element's width.\"\n },\n {\n \"name\": \"y\",\n \"type\": \"number | null\",\n \"description\": \"Cursor Y relative to the element's top edge; null until the first mousemove.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const panelRef = useRef<HTMLDivElement>(null);\\n const { x, y } = useMousePosition(panelRef);\\n\\n return (\\n <div ref={panelRef} style={{ height: 160 }}>\\n {x === null || y === null ? (\\n <p>Move your cursor</p>\\n ) : (\\n <p>\\n {Math.round(x)} × {Math.round(y)}\\n </p>\\n )}\\n </div>\\n );\\n}\",\n \"source\": \"import { RefObject, useEffect, useRef, useState } from \\\"react\\\";\\n\\n interface MousePosition {\\n x: number | null;\\n y: number | null;\\n}\\n\\nexport const useMousePosition = <T extends HTMLElement>(\\n ref: React.Ref<T>\\n): MousePosition => {\\n const [mousePosition, setMousePosition] = useState<MousePosition>({\\n x: null,\\n y: null,\\n });\\n\\n useEffect(() => {\\n const updateMousePosition = (event: MouseEvent) => {\\n const { clientX, clientY } = event;\\n if ((ref as RefObject<HTMLElement>).current) {\\n const { left, top } = (\\n ref as RefObject<HTMLElement>\\n )?.current?.getBoundingClientRect() as DOMRect;\\n setMousePosition({ x: clientX - left, y: clientY - top });\\n }\\n };\\n\\n window.addEventListener(\\\"mousemove\\\", updateMousePosition);\\n\\n return () => {\\n window.removeEventListener(\\\"mousemove\\\", updateMousePosition);\\n };\\n }, [ref]);\\n\\n return mousePosition;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-mouse-position/use-mouse-position.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-mouse-position\",\n \"useCases\": [\n \"dom\",\n \"use-mouse-position\",\n \"usemouseposition\",\n \"interaction\",\n \"dom events\",\n \"popover\",\n \"dropdown\",\n \"modal\",\n \"cursor\",\n \"coordinates\",\n \"within\",\n \"element\"\n ]\n },\n {\n \"slug\": \"use-infinite-scroll\",\n \"name\": \"useInfiniteScroll\",\n \"description\": \"Triggers loading near the scroll end.\",\n \"category\": \"dom\",\n \"signature\": \"useInfiniteScroll(fetchMoreData: () => Promise<void>): boolean\",\n \"parameters\": [\n {\n \"name\": \"fetchMoreData\",\n \"type\": \"() => Promise<void>\",\n \"defaultValue\": null,\n \"description\": \"Called when the window scroll comes within 500px of the document bottom. Must return a promise — the hook stays in the fetching state until it resolves.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"isFetching\",\n \"type\": \"boolean\",\n \"description\": \"True while a triggered fetchMoreData promise is pending; blocks re-triggering until it resolves.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"const page = (start: number) =>\\n Array.from({ length: 10 }, (_, i) => `Item ${start + i + 1}`);\\n\\nexport function Demo() {\\n const [items, setItems] = useState(() => page(0));\\n\\n const fetchMoreData = useCallback(\\n () =>\\n new Promise<void>((resolve) => {\\n setItems((prev) => [...prev, ...page(prev.length)]);\\n resolve();\\n }),\\n [],\\n );\\n\\n const isFetching = useInfiniteScroll(fetchMoreData);\\n\\n return (\\n <div>\\n <ul>\\n {items.map((item) => (\\n <li key={item}>{item}</li>\\n ))}\\n </ul>\\n {isFetching && <p>Loading more…</p>}\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\ntype FetchMoreData = () => Promise<void>; // Function to fetch more data\\n\\nexport const useInfiniteScroll = (fetchMoreData: FetchMoreData): boolean => {\\n const [isFetching, setIsFetching] = useState(false);\\n\\n useEffect(() => {\\n const handleScroll = () => {\\n const isNearBottom =\\n window.innerHeight + window.scrollY >= document.body.offsetHeight - 500;\\n if (isNearBottom && !isFetching) {\\n setIsFetching(true);\\n fetchMoreData().then(() => setIsFetching(false));\\n }\\n };\\n\\n window.addEventListener(\\\"scroll\\\", handleScroll);\\n\\n return () => {\\n window.removeEventListener(\\\"scroll\\\", handleScroll);\\n };\\n }, [fetchMoreData, isFetching]);\\n\\n return isFetching;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-infinite-scroll/use-infinite-scroll.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-infinite-scroll\",\n \"useCases\": [\n \"dom\",\n \"use-infinite-scroll\",\n \"useinfinitescroll\",\n \"lazy loading\",\n \"infinite list\",\n \"viewport\",\n \"visibility\",\n \"triggers\",\n \"loading\",\n \"near\",\n \"scroll\"\n ]\n },\n {\n \"slug\": \"use-expandable-text\",\n \"name\": \"useExpandableText\",\n \"description\": \"Collapse long text by a character and/or line budget with a show-more toggle.\",\n \"category\": \"dom\",\n \"signature\": \"useExpandableText<T extends HTMLElement = HTMLElement>(text: string, options?: UseExpandableTextOptions): UseExpandableTextResult<T>\",\n \"parameters\": [\n {\n \"name\": \"text\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The full text to (maybe) collapse.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseExpandableTextOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Character and/or line budgets and display options. Whichever limit clips first wins.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"text\",\n \"type\": \"string\",\n \"description\": \"The text to render — character-capped when collapsed and maxChars is set, otherwise the full text.\"\n },\n {\n \"name\": \"isExpanded\",\n \"type\": \"boolean\",\n \"description\": \"Whether the full text is currently shown.\"\n },\n {\n \"name\": \"isTruncated\",\n \"type\": \"boolean\",\n \"description\": \"True when either limit actually clips the text — use it to hide the toggle when the text fits.\"\n },\n {\n \"name\": \"toggle\",\n \"type\": \"() => void\",\n \"description\": \"Flip between expanded and collapsed.\"\n },\n {\n \"name\": \"expand\",\n \"type\": \"() => void\",\n \"description\": \"Show the full text.\"\n },\n {\n \"name\": \"collapse\",\n \"type\": \"() => void\",\n \"description\": \"Collapse back to the limit.\"\n },\n {\n \"name\": \"ref\",\n \"type\": \"RefCallback<T>\",\n \"description\": \"Attach to the text element. Required for the maxLines clamp and its overflow measurement.\"\n },\n {\n \"name\": \"clampStyle\",\n \"type\": \"CSSProperties\",\n \"description\": \"Spread onto the text element; applies the CSS line-clamp while collapsed and maxLines is set.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseExpandableTextOptions\",\n \"description\": \"Character and line budgets — provide either, or both.\",\n \"rows\": [\n {\n \"name\": \"maxChars\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Max characters shown while collapsed. Pure string logic (SSR-safe), trimmed to a word boundary.\"\n },\n {\n \"name\": \"maxLines\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Max lines shown while collapsed. Applied as a CSS line-clamp and measured in the DOM, so it re-clips on resize.\"\n },\n {\n \"name\": \"ellipsis\",\n \"type\": \"string\",\n \"defaultValue\": \"\\\"…\\\"\",\n \"description\": \"Appended to character-truncated text.\"\n },\n {\n \"name\": \"defaultExpanded\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Whether the text starts expanded.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Review({ body }: { body: string }) {\\n const { text, isExpanded, isTruncated, toggle, ref, clampStyle } =\\n useExpandableText<HTMLParagraphElement>(body, { maxChars: 180, maxLines: 3 });\\n\\n return (\\n <div>\\n <p ref={ref} style={clampStyle}>{text}</p>\\n {isTruncated && (\\n <button onClick={toggle}>{isExpanded ? \\\"Show less\\\" : \\\"Show more\\\"}</button>\\n )}\\n </div>\\n );\\n}\",\n \"source\": \"import {\\n useCallback,\\n useEffect,\\n useState,\\n type CSSProperties,\\n type RefCallback,\\n} from \\\"react\\\";\\n\\n/**\\n * Options accepted by {@link useExpandableText}. Provide `maxChars`, `maxLines`,\\n * or both — whichever limit clips first wins.\\n */\\nexport interface UseExpandableTextOptions {\\n /**\\n * Maximum characters shown while collapsed. Pure string logic, so it works on\\n * the server and yields a genuinely shortened string (trimmed to a word\\n * boundary). Omit for no character cap.\\n */\\n maxChars?: number;\\n /**\\n * Maximum lines shown while collapsed. Applied as a CSS line-clamp via\\n * {@link UseExpandableTextResult.clampStyle} and measured in the DOM, so it is\\n * responsive (re-clips as the container narrows). Omit for no line cap.\\n */\\n maxLines?: number;\\n /** Appended to character-truncated text. Defaults to `\\\"…\\\"`. */\\n ellipsis?: string;\\n /** Whether the text starts expanded. Defaults to `false`. */\\n defaultExpanded?: boolean;\\n}\\n\\n/**\\n * The value returned by {@link useExpandableText}.\\n */\\nexport interface UseExpandableTextResult<T extends HTMLElement = HTMLElement> {\\n /**\\n * The text to render — character-capped when collapsed and `maxChars` is set,\\n * otherwise the full text.\\n */\\n text: string;\\n /** Whether the full text is currently shown. */\\n isExpanded: boolean;\\n /**\\n * `true` when either limit actually clips the text. Use it to hide the toggle\\n * when the text fits and no control is needed.\\n */\\n isTruncated: boolean;\\n /** Flip between expanded and collapsed. */\\n toggle: () => void;\\n /** Show the full text. */\\n expand: () => void;\\n /** Collapse back to the limit. */\\n collapse: () => void;\\n /**\\n * Attach to the text element. Required for the `maxLines` clamp and its\\n * overflow measurement; harmless when only `maxChars` is used.\\n */\\n ref: RefCallback<T>;\\n /**\\n * Inline style applying the CSS line-clamp while collapsed and `maxLines` is\\n * set (empty otherwise). Spread onto the text element.\\n */\\n clampStyle: CSSProperties;\\n}\\n\\n/** Cut `text` to at most `maxChars`, backing off to the last word boundary. */\\nconst truncateChars = (\\n text: string,\\n maxChars: number,\\n ellipsis: string,\\n): string => {\\n if (text.length <= maxChars) return text;\\n const slice = text.slice(0, maxChars);\\n const lastSpace = slice.lastIndexOf(\\\" \\\");\\n const cut = lastSpace > 0 ? slice.slice(0, lastSpace) : slice;\\n return cut.trimEnd() + ellipsis;\\n};\\n\\n/**\\n * Collapse long text behind a \\\"show more / less\\\" toggle, capping it by a\\n * **character** budget, a **line** budget, or both — whichever clips first wins.\\n *\\n * The two limits cover each other's blind spots. `maxChars` is pure string\\n * logic: SSR-safe and it produces a genuinely shortened string. `maxLines` can\\n * only be resolved in the DOM, so it is applied as a CSS line-clamp and measured\\n * with a `ResizeObserver`, making it responsive to container width. With both\\n * set, the string is capped to `maxChars` *and* the element is clamped to\\n * `maxLines`, and `isTruncated` is `true` if either would clip.\\n *\\n * Measurement runs inside an effect and the observer is disconnected on cleanup,\\n * so the hook is SSR-safe and leaks nothing.\\n *\\n * @param text - The full text to (maybe) collapse.\\n * @param options - Character and/or line budgets and display options.\\n * @returns The text to render plus `{ isExpanded, isTruncated, toggle, expand, collapse, ref, clampStyle }`.\\n *\\n * @example\\n * ```tsx\\n * const { text, isTruncated, isExpanded, toggle, ref, clampStyle } =\\n * useExpandableText(review.body, { maxChars: 180, maxLines: 3 });\\n *\\n * return (\\n * <>\\n * <p ref={ref} style={clampStyle}>{text}</p>\\n * {isTruncated && (\\n * <button onClick={toggle}>{isExpanded ? \\\"Show less\\\" : \\\"Show more\\\"}</button>\\n * )}\\n * </>\\n * );\\n * ```\\n */\\nexport const useExpandableText = <T extends HTMLElement = HTMLElement>(\\n text: string,\\n options: UseExpandableTextOptions = {},\\n): UseExpandableTextResult<T> => {\\n const { maxChars, maxLines, ellipsis = \\\"…\\\", defaultExpanded = false } = options;\\n\\n const [isExpanded, setIsExpanded] = useState(defaultExpanded);\\n const [node, setNode] = useState<T | null>(null);\\n const [lineOverflow, setLineOverflow] = useState(false);\\n\\n const charTruncated = maxChars !== undefined && text.length > maxChars;\\n const collapsedText = charTruncated\\n ? truncateChars(text, maxChars, ellipsis)\\n : text;\\n const displayText = isExpanded ? text : collapsedText;\\n\\n const ref = useCallback<RefCallback<T>>((el) => setNode(el), []);\\n\\n // Measure whether the full text overflows `maxLines`. `scrollHeight` reflects\\n // the full content height regardless of the clamp, so the read is accurate in\\n // both states — except when the char cap has already shortened the string, in\\n // which case `charTruncated` alone drives `isTruncated`.\\n useEffect(() => {\\n if (!node || maxLines === undefined) {\\n setLineOverflow(false);\\n return;\\n }\\n const measure = () => {\\n const style = window.getComputedStyle(node);\\n let lineHeight = Number.parseFloat(style.lineHeight);\\n if (!Number.isFinite(lineHeight)) {\\n lineHeight = Number.parseFloat(style.fontSize) * 1.2;\\n }\\n const padding =\\n Number.parseFloat(style.paddingTop) +\\n Number.parseFloat(style.paddingBottom);\\n const maxHeight = lineHeight * maxLines + (padding || 0);\\n setLineOverflow(node.scrollHeight > maxHeight + 1);\\n };\\n measure();\\n if (typeof ResizeObserver === \\\"undefined\\\") return;\\n const observer = new ResizeObserver(measure);\\n observer.observe(node);\\n return () => observer.disconnect();\\n }, [node, maxLines, text, isExpanded]);\\n\\n const toggle = useCallback(() => setIsExpanded((value) => !value), []);\\n const expand = useCallback(() => setIsExpanded(true), []);\\n const collapse = useCallback(() => setIsExpanded(false), []);\\n\\n const clampStyle: CSSProperties =\\n !isExpanded && maxLines !== undefined\\n ? {\\n display: \\\"-webkit-box\\\",\\n WebkitBoxOrient: \\\"vertical\\\",\\n WebkitLineClamp: maxLines,\\n overflow: \\\"hidden\\\",\\n }\\n : {};\\n\\n return {\\n text: displayText,\\n isExpanded,\\n isTruncated: charTruncated || lineOverflow,\\n toggle,\\n expand,\\n collapse,\\n ref,\\n clampStyle,\\n };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-expandable-text/use-expandable-text.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-expandable-text\",\n \"useCases\": [\n \"dom\",\n \"use-expandable-text\",\n \"useexpandabletext\",\n \"collapse\",\n \"long\",\n \"text\",\n \"character\",\n \"line\",\n \"budget\",\n \"with\",\n \"show\",\n \"more\",\n \"toggle\"\n ]\n },\n {\n \"slug\": \"use-hover\",\n \"name\": \"useHover\",\n \"description\": \"Tracks whether the pointer is hovering an element.\",\n \"category\": \"dom\",\n \"signature\": \"useHover<T extends HTMLElement = HTMLElement>(elementRef: RefObject<T>): boolean\",\n \"parameters\": [\n {\n \"name\": \"elementRef\",\n \"type\": \"RefObject<T>\",\n \"defaultValue\": null,\n \"description\": \"Ref to the element whose hover state to track. mouseenter/mouseleave are attached to it and cleaned up automatically.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"isHovered\",\n \"type\": \"boolean\",\n \"description\": \"True while the pointer is over the element, false otherwise. Starts false on the server and until the first mouseenter.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const boxRef = useRef<HTMLDivElement>(null);\\n const isHovered = useHover(boxRef);\\n\\n return (\\n <div ref={boxRef}>\\n {isHovered ? \\\"Pointer is over me\\\" : \\\"Hover this panel\\\"}\\n </div>\\n );\\n}\",\n \"source\": \"import { useState, type RefObject } from \\\"react\\\";\\nimport { useEventListener } from \\\"../use-event-listener\\\";\\n\\n/**\\n * Tracks whether the pointer is currently hovering the referenced element.\\n *\\n * Listens for `mouseenter` / `mouseleave` on the element the ref points to and\\n * cleans the listeners up automatically. The subscription lives inside an effect\\n * so the hook is SSR-safe.\\n *\\n * @param elementRef - A ref to the element whose hover state to track.\\n * @returns `true` while the pointer is over the element, otherwise `false`.\\n */\\nexport const useHover = <T extends HTMLElement = HTMLElement>(\\n elementRef: RefObject<T>,\\n): boolean => {\\n const [isHovered, setIsHovered] = useState<boolean>(false);\\n\\n useEventListener(\\\"mouseenter\\\", () => setIsHovered(true), elementRef);\\n useEventListener(\\\"mouseleave\\\", () => setIsHovered(false), elementRef);\\n\\n return isHovered;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-hover/use-hover.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-hover\",\n \"useCases\": [\n \"dom\",\n \"use-hover\",\n \"usehover\",\n \"interaction\",\n \"dom events\",\n \"popover\",\n \"dropdown\",\n \"modal\",\n \"tracks\",\n \"whether\",\n \"pointer\",\n \"hovering\",\n \"element\"\n ]\n },\n {\n \"slug\": \"use-intersection-observer\",\n \"name\": \"useIntersectionObserver\",\n \"description\": \"Observe an element's viewport intersection reactively.\",\n \"category\": \"dom\",\n \"signature\": \"useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverReturn\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseIntersectionObserverOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Observer thresholds, root, and behaviour flags. All optional.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"ref\",\n \"type\": \"(node: Element | null) => void\",\n \"description\": \"Ref callback to attach to the element you want to observe.\"\n },\n {\n \"name\": \"isIntersecting\",\n \"type\": \"boolean\",\n \"description\": \"Whether the observed element currently intersects the root.\"\n },\n {\n \"name\": \"entry\",\n \"type\": \"IntersectionObserverEntry | null\",\n \"description\": \"The most recent observer entry (intersectionRatio, boundingClientRect…), or null before the first report.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseIntersectionObserverOptions\",\n \"description\": \"Configures the underlying IntersectionObserver.\",\n \"rows\": [\n {\n \"name\": \"threshold\",\n \"type\": \"number | number[]\",\n \"defaultValue\": \"0\",\n \"description\": \"One or more visibility ratios at which to fire.\"\n },\n {\n \"name\": \"root\",\n \"type\": \"Element | Document | null\",\n \"defaultValue\": \"null\",\n \"description\": \"The element used as the viewport. Defaults to the browser viewport.\"\n },\n {\n \"name\": \"rootMargin\",\n \"type\": \"string\",\n \"defaultValue\": \"\\\"0%\\\"\",\n \"description\": \"Margin around the root, in CSS-margin syntax — grows or shrinks the trigger area.\"\n },\n {\n \"name\": \"freezeOnceVisible\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Once the target is visible, stop observing and keep the visible state.\"\n },\n {\n \"name\": \"initialIsIntersecting\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"isIntersecting value used before the observer first reports.\"\n },\n {\n \"name\": \"onChange\",\n \"type\": \"(isIntersecting: boolean, entry: IntersectionObserverEntry) => void\",\n \"defaultValue\": null,\n \"description\": \"Called with the latest entry whenever intersection changes.\"\n }\n ]\n },\n {\n \"name\": \"UseIntersectionObserverReturn\",\n \"description\": \"The ref callback plus the current intersection state.\",\n \"rows\": [\n {\n \"name\": \"ref\",\n \"type\": \"(node: Element | null) => void\",\n \"defaultValue\": null,\n \"description\": \"Attach to the element you want to observe.\"\n },\n {\n \"name\": \"isIntersecting\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether the target currently intersects the root.\"\n },\n {\n \"name\": \"entry\",\n \"type\": \"IntersectionObserverEntry | null\",\n \"defaultValue\": null,\n \"description\": \"The most recent observer entry, or null before the first report.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { ref, isIntersecting } = useIntersectionObserver({\\n threshold: 0.5,\\n });\\n\\n return (\\n <div ref={ref}>\\n {isIntersecting ? \\\"In view\\\" : \\\"Scroll me into view\\\"}\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useRef, useState } from \\\"react\\\";\\n\\n/**\\n * Options accepted by {@link useIntersectionObserver}.\\n */\\nexport interface UseIntersectionObserverOptions {\\n /** One or more thresholds at which to fire the callback. */\\n threshold?: number | number[];\\n /** The element used as the viewport. Defaults to the browser viewport. */\\n root?: Element | Document | null;\\n /** Margin around the root, in CSS-margin syntax. */\\n rootMargin?: string;\\n /** Once the target is visible, stop updating and keep the visible state. */\\n freezeOnceVisible?: boolean;\\n /** Initial `isIntersecting` value used before the observer first reports. */\\n initialIsIntersecting?: boolean;\\n /** Called with the latest entry whenever intersection changes. */\\n onChange?: (isIntersecting: boolean, entry: IntersectionObserverEntry) => void;\\n}\\n\\n/**\\n * The value returned by {@link useIntersectionObserver}.\\n */\\nexport interface UseIntersectionObserverReturn {\\n /** Ref callback to attach to the element you want to observe. */\\n ref: (node: Element | null) => void;\\n /** Whether the observed element is currently intersecting the root. */\\n isIntersecting: boolean;\\n /** The most recent observer entry, or `null` before the first report. */\\n entry: IntersectionObserverEntry | null;\\n}\\n\\n/**\\n * Observes an element's intersection with the viewport (or a custom root) via\\n * `IntersectionObserver`, exposing a ref callback to attach to the target.\\n *\\n * The observer is created inside an effect and disconnected on cleanup, so the\\n * hook is SSR-safe and leaks nothing. When `freezeOnceVisible` is set the hook\\n * stops observing after the first intersection and retains the visible state.\\n *\\n * @param options - Observer thresholds, root, and behaviour flags.\\n * @returns A `ref` callback plus the current `isIntersecting` flag and `entry`.\\n */\\nexport const useIntersectionObserver = ({\\n threshold = 0,\\n root = null,\\n rootMargin = \\\"0%\\\",\\n freezeOnceVisible = false,\\n initialIsIntersecting = false,\\n onChange,\\n}: UseIntersectionObserverOptions = {}): UseIntersectionObserverReturn => {\\n const [element, setElement] = useState<Element | null>(null);\\n const [isIntersecting, setIsIntersecting] = useState<boolean>(\\n initialIsIntersecting,\\n );\\n const [entry, setEntry] = useState<IntersectionObserverEntry | null>(null);\\n\\n const onChangeRef = useRef(onChange);\\n onChangeRef.current = onChange;\\n\\n const frozen = entry?.isIntersecting && freezeOnceVisible;\\n\\n const ref = useCallback((node: Element | null) => {\\n setElement(node);\\n }, []);\\n\\n useEffect(() => {\\n if (!element) return;\\n if (frozen) return;\\n if (typeof IntersectionObserver === \\\"undefined\\\") return;\\n\\n const observer = new IntersectionObserver(\\n ([observerEntry]) => {\\n setEntry(observerEntry);\\n setIsIntersecting(observerEntry.isIntersecting);\\n onChangeRef.current?.(observerEntry.isIntersecting, observerEntry);\\n },\\n { threshold, root, rootMargin },\\n );\\n\\n observer.observe(element);\\n\\n return () => {\\n observer.disconnect();\\n };\\n }, [element, JSON.stringify(threshold), root, rootMargin, frozen]);\\n\\n return { ref, isIntersecting, entry };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-intersection-observer/use-intersection-observer.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-intersection-observer\",\n \"useCases\": [\n \"dom\",\n \"use-intersection-observer\",\n \"useintersectionobserver\",\n \"lazy loading\",\n \"infinite list\",\n \"viewport\",\n \"visibility\",\n \"observe\",\n \"element\",\n \"intersection\",\n \"reactively\"\n ]\n },\n {\n \"slug\": \"use-resize-observer\",\n \"name\": \"useResizeObserver\",\n \"description\": \"Measure an element's size reactively via ResizeObserver.\",\n \"category\": \"dom\",\n \"signature\": \"useResizeObserver<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, options?: UseResizeObserverOptions): ResizeObserverSize\",\n \"parameters\": [\n {\n \"name\": \"ref\",\n \"type\": \"RefObject<T>\",\n \"defaultValue\": null,\n \"description\": \"Ref to the element to measure. The observer attaches to ref.current.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseResizeObserverOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Which box to measure and an optional resize callback.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"width\",\n \"type\": \"number | undefined\",\n \"description\": \"The element's measured width; undefined until the first observed layout.\"\n },\n {\n \"name\": \"height\",\n \"type\": \"number | undefined\",\n \"description\": \"The element's measured height; undefined until the first observed layout.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseResizeObserverOptions\",\n \"description\": \"Configures the underlying ResizeObserver.\",\n \"rows\": [\n {\n \"name\": \"box\",\n \"type\": \"ResizeObserverBoxOptions\",\n \"defaultValue\": \"\\\"content-box\\\"\",\n \"description\": \"Which box model to measure: content-box, border-box or device-pixel-content-box.\"\n },\n {\n \"name\": \"onResize\",\n \"type\": \"(size: ResizeObserverSize) => void\",\n \"defaultValue\": null,\n \"description\": \"Called with the freshly measured size on every resize.\"\n }\n ]\n },\n {\n \"name\": \"ResizeObserverSize\",\n \"description\": \"The size the hook returns; both values are undefined until the first measurement.\",\n \"rows\": [\n {\n \"name\": \"width\",\n \"type\": \"number | undefined\",\n \"defaultValue\": null,\n \"description\": \"Measured width in pixels.\"\n },\n {\n \"name\": \"height\",\n \"type\": \"number | undefined\",\n \"defaultValue\": null,\n \"description\": \"Measured height in pixels.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const boxRef = useRef<HTMLDivElement>(null);\\n const { width, height } = useResizeObserver(boxRef);\\n\\n return (\\n <div ref={boxRef}>\\n {width === undefined ? \\\"Measuring…\\\" : `${Math.round(width)} × ${Math.round(height ?? 0)}`}\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef, useState, type RefObject } from \\\"react\\\";\\n\\n/**\\n * The size reported by {@link useResizeObserver}. Both values are `undefined`\\n * until the first measurement lands.\\n */\\nexport interface ResizeObserverSize {\\n width: number | undefined;\\n height: number | undefined;\\n}\\n\\n/**\\n * Options accepted by {@link useResizeObserver}.\\n */\\nexport interface UseResizeObserverOptions {\\n /** Which box model to measure. Defaults to `content-box`. */\\n box?: ResizeObserverBoxOptions;\\n /** Called with the freshly measured size on every resize. */\\n onResize?: (size: ResizeObserverSize) => void;\\n}\\n\\n/**\\n * Measures an element's size reactively via `ResizeObserver`.\\n *\\n * The observer is created inside an effect and disconnected on cleanup, so the\\n * hook is SSR-safe and leaks nothing. Both dimensions start `undefined` and\\n * populate after the first observed layout.\\n *\\n * @param ref - A ref to the element to measure.\\n * @param options - Which box to measure and an optional resize callback.\\n * @returns The element's `{ width, height }`.\\n */\\nexport const useResizeObserver = <T extends HTMLElement = HTMLElement>(\\n ref: RefObject<T>,\\n options: UseResizeObserverOptions = {},\\n): ResizeObserverSize => {\\n const { box = \\\"content-box\\\" } = options;\\n const [size, setSize] = useState<ResizeObserverSize>({\\n width: undefined,\\n height: undefined,\\n });\\n\\n const onResizeRef = useRef(options.onResize);\\n onResizeRef.current = options.onResize;\\n\\n const previous = useRef<ResizeObserverSize>({\\n width: undefined,\\n height: undefined,\\n });\\n\\n useEffect(() => {\\n const element = ref.current;\\n if (!element) return;\\n if (typeof ResizeObserver === \\\"undefined\\\") return;\\n\\n const observer = new ResizeObserver(([entry]) => {\\n if (!entry) return;\\n\\n const boxSize =\\n box === \\\"border-box\\\"\\n ? entry.borderBoxSize\\n : box === \\\"device-pixel-content-box\\\"\\n ? entry.devicePixelContentBoxSize\\n : entry.contentBoxSize;\\n\\n const measured = Array.isArray(boxSize) ? boxSize[0] : boxSize;\\n\\n const width = measured\\n ? measured.inlineSize\\n : entry.contentRect.width;\\n const height = measured\\n ? measured.blockSize\\n : entry.contentRect.height;\\n\\n if (\\n previous.current.width === width &&\\n previous.current.height === height\\n ) {\\n return;\\n }\\n\\n const next = { width, height };\\n previous.current = next;\\n setSize(next);\\n onResizeRef.current?.(next);\\n });\\n\\n observer.observe(element, { box });\\n\\n return () => {\\n observer.disconnect();\\n };\\n }, [ref, box]);\\n\\n return size;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-resize-observer/use-resize-observer.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-resize-observer\",\n \"useCases\": [\n \"dom\",\n \"use-resize-observer\",\n \"useresizeobserver\",\n \"measure\",\n \"element\",\n \"size\",\n \"reactively\",\n \"resizeobserver\"\n ]\n },\n {\n \"slug\": \"use-scroll-lock\",\n \"name\": \"useScrollLock\",\n \"description\": \"Lock and restore scrolling on the body or an element.\",\n \"category\": \"dom\",\n \"signature\": \"useScrollLock(options?: UseScrollLockOptions): UseScrollLockReturn\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseScrollLockOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Auto-lock behaviour, the lock target, and scrollbar compensation.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"isLocked\",\n \"type\": \"boolean\",\n \"description\": \"Whether the target's scroll is currently locked.\"\n },\n {\n \"name\": \"lock\",\n \"type\": \"() => void\",\n \"description\": \"Lock the target's scroll (sets overflow: hidden, optionally padding-compensated).\"\n },\n {\n \"name\": \"unlock\",\n \"type\": \"() => void\",\n \"description\": \"Restore the target's original scroll behaviour.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseScrollLockOptions\",\n \"description\": \"Controls what is locked and when.\",\n \"rows\": [\n {\n \"name\": \"autoLock\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Lock automatically on mount and restore on unmount.\"\n },\n {\n \"name\": \"lockTarget\",\n \"type\": \"HTMLElement | string\",\n \"defaultValue\": \"<body>\",\n \"description\": \"Element (or CSS selector) whose scroll to lock. Defaults to the document body.\"\n },\n {\n \"name\": \"widthReflow\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Compensate for the removed scrollbar with padding so the layout does not shift.\"\n }\n ]\n },\n {\n \"name\": \"UseScrollLockReturn\",\n \"description\": \"The current lock state plus manual controls.\",\n \"rows\": [\n {\n \"name\": \"isLocked\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether the target's scroll is currently locked.\"\n },\n {\n \"name\": \"lock\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Lock the target's scroll.\"\n },\n {\n \"name\": \"unlock\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Restore the target's original scroll behaviour.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Modal({ onClose }: { onClose: () => void }) {\\n // Locks <body> scroll on mount, restores it on unmount.\\n useScrollLock();\\n\\n return (\\n <div role=\\\"dialog\\\" onClick={onClose}>\\n Scrolling behind this modal is frozen.\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useRef, useState } from \\\"react\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\n/**\\n * Options accepted by {@link useScrollLock}.\\n */\\nexport interface UseScrollLockOptions {\\n /** Lock scrolling automatically on mount. Defaults to `true`. */\\n autoLock?: boolean;\\n /** Element (or CSS selector) whose scroll to lock. Defaults to `<body>`. */\\n lockTarget?: HTMLElement | string;\\n /** Compensate for the removed scrollbar with padding. Defaults to `true`. */\\n widthReflow?: boolean;\\n}\\n\\n/**\\n * The value returned by {@link useScrollLock}.\\n */\\nexport interface UseScrollLockReturn {\\n /** Whether the target's scroll is currently locked. */\\n isLocked: boolean;\\n /** Lock the target's scroll. */\\n lock: () => void;\\n /** Restore the target's original scroll behaviour. */\\n unlock: () => void;\\n}\\n\\ninterface OriginalStyle {\\n overflow: string;\\n paddingRight: string;\\n}\\n\\n/**\\n * Locks and restores scrolling on an element (the document body by default).\\n *\\n * Setting `overflow: hidden` removes the scrollbar; `widthReflow` compensates by\\n * adding padding equal to the scrollbar width so the layout does not shift. All\\n * DOM access is deferred to effects/callbacks, so the hook is SSR-safe, and the\\n * original styles are restored on unmount if still locked.\\n *\\n * @param options - Auto-lock, the lock target, and scrollbar compensation.\\n * @returns The current `isLocked` flag plus `lock` and `unlock`.\\n */\\nexport const useScrollLock = (\\n options: UseScrollLockOptions = {},\\n): UseScrollLockReturn => {\\n const { autoLock = true, lockTarget, widthReflow = true } = options;\\n\\n const [isLocked, setIsLocked] = useState<boolean>(false);\\n const target = useRef<HTMLElement | null>(null);\\n const originalStyle = useRef<OriginalStyle | null>(null);\\n\\n const resolveTarget = useCallback((): HTMLElement | null => {\\n if (typeof document === \\\"undefined\\\") return null;\\n if (lockTarget instanceof HTMLElement) return lockTarget;\\n if (typeof lockTarget === \\\"string\\\") {\\n return document.querySelector<HTMLElement>(lockTarget);\\n }\\n return document.body;\\n }, [lockTarget]);\\n\\n const lock = useCallback(() => {\\n const node = resolveTarget();\\n if (!node) return;\\n\\n target.current = node;\\n originalStyle.current = {\\n overflow: node.style.overflow,\\n paddingRight: node.style.paddingRight,\\n };\\n\\n if (widthReflow && typeof window !== \\\"undefined\\\") {\\n const scrollbarWidth = window.innerWidth - node.clientWidth;\\n if (scrollbarWidth > 0) {\\n const currentPadding =\\n parseInt(window.getComputedStyle(node).paddingRight, 10) || 0;\\n node.style.paddingRight = `${currentPadding + scrollbarWidth}px`;\\n }\\n }\\n\\n node.style.overflow = \\\"hidden\\\";\\n setIsLocked(true);\\n }, [resolveTarget, widthReflow]);\\n\\n const unlock = useCallback(() => {\\n const node = target.current;\\n if (!node || !originalStyle.current) return;\\n\\n node.style.overflow = originalStyle.current.overflow;\\n node.style.paddingRight = originalStyle.current.paddingRight;\\n originalStyle.current = null;\\n setIsLocked(false);\\n }, []);\\n\\n useIsomorphicLayoutEffect(() => {\\n if (!autoLock) return;\\n lock();\\n return () => {\\n unlock();\\n };\\n }, [autoLock, lock, unlock]);\\n\\n return { isLocked, lock, unlock };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-scroll-lock/use-scroll-lock.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-scroll-lock\",\n \"useCases\": [\n \"dom\",\n \"use-scroll-lock\",\n \"usescrolllock\",\n \"lazy loading\",\n \"infinite list\",\n \"viewport\",\n \"visibility\",\n \"lock\",\n \"restore\",\n \"scrolling\",\n \"body\",\n \"element\"\n ]\n },\n {\n \"slug\": \"use-click-any-where\",\n \"name\": \"useClickAnyWhere\",\n \"description\": \"Run a handler on every click anywhere in the document.\",\n \"category\": \"dom\",\n \"signature\": \"useClickAnyWhere(handler: (event: MouseEvent) => void): void\",\n \"parameters\": [\n {\n \"name\": \"handler\",\n \"type\": \"(event: MouseEvent) => void\",\n \"defaultValue\": null,\n \"description\": \"Called with the MouseEvent on every document-wide click. The latest handler is always used — no stale closure.\"\n }\n ],\n \"returns\": [],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [clicks, setClicks] = useState(0);\\n\\n useClickAnyWhere(() => setClicks((prev) => prev + 1));\\n\\n return <p>Document clicks: {clicks}</p>;\\n}\",\n \"source\": \"import { useEventListener } from \\\"../use-event-listener\\\";\\n\\n/**\\n * Calls a handler on every click anywhere in the document.\\n *\\n * Subscribes to `click` on `window` and forwards the latest handler on each\\n * dispatch, cleaning the listener up on unmount. The subscription lives inside\\n * an effect so the hook is SSR-safe.\\n *\\n * @param handler - Called with the `MouseEvent` on every document-wide click.\\n */\\nexport const useClickAnyWhere = (\\n handler: (event: MouseEvent) => void,\\n): void => {\\n useEventListener(\\\"click\\\", handler);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-click-any-where/use-click-any-where.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-click-any-where\",\n \"useCases\": [\n \"dom\",\n \"use-click-any-where\",\n \"useclickanywhere\",\n \"interaction\",\n \"dom events\",\n \"popover\",\n \"dropdown\",\n \"modal\",\n \"handler\",\n \"every\",\n \"click\",\n \"anywhere\",\n \"document\"\n ]\n },\n {\n \"slug\": \"use-media-query\",\n \"name\": \"useMediaQuery\",\n \"description\": \"Tracks whether a CSS media query currently matches.\",\n \"category\": \"dom\",\n \"signature\": \"useMediaQuery(query: string, options?: UseMediaQueryOptions): boolean\",\n \"parameters\": [\n {\n \"name\": \"query\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"A CSS media query string, e.g. \\\"(min-width: 768px)\\\" or \\\"(prefers-color-scheme: dark)\\\".\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseMediaQueryOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"SSR default and hydration behaviour. Optional.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"matches\",\n \"type\": \"boolean\",\n \"description\": \"Whether the query currently matches. Re-renders on every matchMedia change event, and starts from defaultValue on the server.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseMediaQueryOptions\",\n \"description\": \"Configures the server value and mount behaviour.\",\n \"rows\": [\n {\n \"name\": \"defaultValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Value returned on the server and before hydration.\"\n },\n {\n \"name\": \"initializeWithValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Read the real match synchronously on mount. Set false to always start from defaultValue and avoid a hydration mismatch.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const isWide = useMediaQuery(\\\"(min-width: 768px)\\\");\\n\\n return <p>{isWide ? \\\"Desktop layout\\\" : \\\"Mobile layout\\\"}</p>;\\n}\",\n \"source\": \"import { useState } from \\\"react\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\nconst IS_SERVER = typeof window === \\\"undefined\\\";\\n\\n/**\\n * Options accepted by {@link useMediaQuery}.\\n */\\nexport interface UseMediaQueryOptions {\\n /** Value returned on the server and before hydration. Defaults to `false`. */\\n defaultValue?: boolean;\\n /** Read the real match synchronously on mount. Defaults to `true`. */\\n initializeWithValue?: boolean;\\n}\\n\\n/**\\n * Tracks whether a CSS media query currently matches.\\n *\\n * SSR-safe: on the server (or when `initializeWithValue` is false) the hook\\n * starts from `defaultValue` and reconciles with `window.matchMedia` after\\n * mount. The `change` listener is attached inside a layout effect and removed\\n * on cleanup.\\n *\\n * @param query - The media query string, e.g. `\\\"(min-width: 768px)\\\"`.\\n * @param options - Optional server default and hydration flag.\\n * @returns `true` when the query matches, otherwise `false`.\\n */\\nexport function useMediaQuery(\\n query: string,\\n options: UseMediaQueryOptions = {},\\n): boolean {\\n const { defaultValue = false, initializeWithValue = true } = options;\\n\\n const getMatches = (query: string): boolean => {\\n if (IS_SERVER) return defaultValue;\\n return window.matchMedia(query).matches;\\n };\\n\\n const [matches, setMatches] = useState<boolean>(() => {\\n if (initializeWithValue) return getMatches(query);\\n return defaultValue;\\n });\\n\\n useIsomorphicLayoutEffect(() => {\\n if (IS_SERVER) return;\\n\\n const matchMedia = window.matchMedia(query);\\n\\n const handleChange = () => {\\n setMatches(matchMedia.matches);\\n };\\n\\n handleChange();\\n matchMedia.addEventListener(\\\"change\\\", handleChange);\\n\\n return () => {\\n matchMedia.removeEventListener(\\\"change\\\", handleChange);\\n };\\n }, [query]);\\n\\n return matches;\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-media-query/use-media-query.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-media-query\",\n \"useCases\": [\n \"dom\",\n \"use-media-query\",\n \"usemediaquery\",\n \"responsive\",\n \"mobile detection\",\n \"viewport size\",\n \"tracks\",\n \"whether\",\n \"media\",\n \"query\",\n \"currently\",\n \"matches\"\n ]\n },\n {\n \"slug\": \"use-screen\",\n \"name\": \"useScreen\",\n \"description\": \"Tracks window.screen, refreshing it on every resize.\",\n \"category\": \"dom\",\n \"signature\": \"useScreen(options?: UseScreenOptions): Screen | null\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseScreenOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Hydration behaviour. Optional.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"screen\",\n \"type\": \"Screen | null\",\n \"description\": \"The current window.screen (width, height, availWidth, colorDepth, orientation…), refreshed on every resize. null on the server and until hydration.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseScreenOptions\",\n \"description\": \"Configures mount behaviour.\",\n \"rows\": [\n {\n \"name\": \"initializeWithValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Read the real screen synchronously on mount. Set false to start as null and populate after hydration.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const screen = useScreen();\\n\\n return <p>Screen: {screen ? `${screen.width}×${screen.height}` : \\\"…\\\"}</p>;\\n}\",\n \"source\": \"import { useState } from \\\"react\\\";\\nimport { useEventListener } from \\\"../use-event-listener\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\nconst IS_SERVER = typeof window === \\\"undefined\\\";\\n\\n/**\\n * Options accepted by {@link useScreen}.\\n */\\nexport interface UseScreenOptions {\\n /** Read the real screen synchronously on mount. Defaults to `true`. */\\n initializeWithValue?: boolean;\\n}\\n\\n/**\\n * Tracks the `window.screen` object, refreshing it on every window resize.\\n *\\n * SSR-safe: on the server (or when `initializeWithValue` is false) the hook\\n * starts as `null` and populates after mount. The `resize` listener is attached\\n * via {@link useEventListener} and removed on cleanup.\\n *\\n * @param options - Optional hydration flag.\\n * @returns The current `Screen`, or `null` before hydration / on the server.\\n */\\nexport function useScreen(options: UseScreenOptions = {}): Screen | null {\\n const { initializeWithValue = true } = options;\\n\\n const readScreen = (): Screen | null => {\\n if (IS_SERVER) return null;\\n return window.screen;\\n };\\n\\n const [screen, setScreen] = useState<Screen | null>(() => {\\n if (initializeWithValue) return readScreen();\\n return null;\\n });\\n\\n const handleSize = () => {\\n setScreen(readScreen());\\n };\\n\\n useEventListener(\\\"resize\\\", handleSize);\\n\\n useIsomorphicLayoutEffect(() => {\\n handleSize();\\n }, []);\\n\\n return screen;\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-screen/use-screen.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-screen\",\n \"useCases\": [\n \"dom\",\n \"use-screen\",\n \"usescreen\",\n \"responsive\",\n \"mobile detection\",\n \"viewport size\",\n \"tracks\",\n \"window\",\n \"screen\",\n \"refreshing\",\n \"every\",\n \"resize\"\n ]\n },\n {\n \"slug\": \"use-window-size\",\n \"name\": \"useWindowSize\",\n \"description\": \"Tracks the viewport's { width, height }, updated on resize.\",\n \"category\": \"dom\",\n \"signature\": \"useWindowSize(options?: UseWindowSizeOptions): WindowSize\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseWindowSizeOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Hydration behaviour. Optional.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"width\",\n \"type\": \"number\",\n \"description\": \"The viewport's inner width in pixels. 0 on the server and until hydration.\"\n },\n {\n \"name\": \"height\",\n \"type\": \"number\",\n \"description\": \"The viewport's inner height in pixels. 0 on the server and until hydration.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"WindowSize\",\n \"description\": \"The viewport size reported by useWindowSize.\",\n \"rows\": [\n {\n \"name\": \"width\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The viewport's inner width in pixels.\"\n },\n {\n \"name\": \"height\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The viewport's inner height in pixels.\"\n }\n ]\n },\n {\n \"name\": \"UseWindowSizeOptions\",\n \"description\": \"Configures mount behaviour.\",\n \"rows\": [\n {\n \"name\": \"initializeWithValue\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Read the real size synchronously on mount. Set false to start at 0 and populate after hydration.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { width, height } = useWindowSize();\\n\\n return <p>{width} × {height}</p>;\\n}\",\n \"source\": \"import { useState } from \\\"react\\\";\\nimport { useEventListener } from \\\"../use-event-listener\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\nconst IS_SERVER = typeof window === \\\"undefined\\\";\\n\\n/**\\n * The viewport size reported by {@link useWindowSize}.\\n */\\nexport interface WindowSize {\\n width: number;\\n height: number;\\n}\\n\\n/**\\n * Options accepted by {@link useWindowSize}.\\n */\\nexport interface UseWindowSizeOptions {\\n /** Read the real size synchronously on mount. Defaults to `true`. */\\n initializeWithValue?: boolean;\\n}\\n\\n/**\\n * Tracks the viewport's `{ width, height }`, updating on every window resize.\\n *\\n * SSR-safe: on the server (or when `initializeWithValue` is false) both values\\n * start at `0` and populate after mount. The `resize` listener is attached via\\n * {@link useEventListener} and removed on cleanup.\\n *\\n * @param options - Optional hydration flag.\\n * @returns The current window `{ width, height }` in pixels.\\n */\\nexport function useWindowSize(options: UseWindowSizeOptions = {}): WindowSize {\\n const { initializeWithValue = true } = options;\\n\\n const readSize = (): WindowSize => ({\\n width: window.innerWidth,\\n height: window.innerHeight,\\n });\\n\\n const [windowSize, setWindowSize] = useState<WindowSize>(() => {\\n if (initializeWithValue && !IS_SERVER) return readSize();\\n return { width: 0, height: 0 };\\n });\\n\\n const handleSize = () => {\\n if (IS_SERVER) return;\\n setWindowSize(readSize());\\n };\\n\\n useEventListener(\\\"resize\\\", handleSize);\\n\\n useIsomorphicLayoutEffect(() => {\\n handleSize();\\n }, []);\\n\\n return windowSize;\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-window-size/use-window-size.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-window-size\",\n \"useCases\": [\n \"dom\",\n \"use-window-size\",\n \"usewindowsize\",\n \"responsive\",\n \"mobile detection\",\n \"viewport size\",\n \"tracks\",\n \"viewport\",\n \"width\",\n \"height\",\n \"updated\",\n \"resize\"\n ]\n },\n {\n \"slug\": \"use-copy-to-clipboard\",\n \"name\": \"useCopyToClipboard\",\n \"description\": \"Copy text to the clipboard, tracking the last copied value.\",\n \"category\": \"dom\",\n \"signature\": \"useCopyToClipboard(): [CopiedValue, CopyFn]\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"[0] copiedText\",\n \"type\": \"CopiedValue\",\n \"description\": \"The last successfully-copied string, or null before any copy or after a failed one.\"\n },\n {\n \"name\": \"[1] copy\",\n \"type\": \"CopyFn\",\n \"description\": \"Writes text to the clipboard. Resolves true on success, false when the API is unavailable or the write is rejected.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"CopiedValue\",\n \"description\": null,\n \"rows\": [\n {\n \"name\": \"value\",\n \"type\": \"string | null\",\n \"defaultValue\": null,\n \"description\": \"The tracked copied text, or null.\"\n }\n ]\n },\n {\n \"name\": \"CopyFn\",\n \"description\": null,\n \"rows\": [\n {\n \"name\": \"value\",\n \"type\": \"(text: string) => Promise<boolean>\",\n \"defaultValue\": null,\n \"description\": \"Copies text and reports whether the write succeeded.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [copiedText, copy] = useCopyToClipboard();\\n\\n return (\\n <button type=\\\"button\\\" onClick={() => copy(\\\"npm i hookli\\\")}>\\n {copiedText ? \\\"Copied!\\\" : \\\"Copy\\\"}\\n </button>\\n );\\n}\",\n \"source\": \"import { useCallback, useState } from \\\"react\\\";\\n\\nexport type CopiedValue = string | null;\\n\\nexport type CopyFn = (text: string) => Promise<boolean>;\\n\\nexport type UseCopyToClipboardReturn = [CopiedValue, CopyFn];\\n\\n/**\\n * Copies text to the clipboard via the async Clipboard API and tracks the last\\n * successfully-copied value.\\n *\\n * SSR-safe: `navigator.clipboard` is read only inside the returned `copy`\\n * callback, never during render. `copy` resolves to `true` on success and\\n * `false` when the API is unavailable or the write is rejected, resetting the\\n * tracked value to `null` on failure.\\n *\\n * @returns `[copiedText, copy]` — the last copied string (or `null`) and the\\n * async copy function.\\n */\\nexport function useCopyToClipboard(): UseCopyToClipboardReturn {\\n const [copiedText, setCopiedText] = useState<CopiedValue>(null);\\n\\n const copy = useCallback<CopyFn>(async (text) => {\\n if (typeof navigator === \\\"undefined\\\" || !navigator.clipboard) {\\n return false;\\n }\\n\\n try {\\n await navigator.clipboard.writeText(text);\\n setCopiedText(text);\\n return true;\\n } catch {\\n setCopiedText(null);\\n return false;\\n }\\n }, []);\\n\\n return [copiedText, copy];\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-copy-to-clipboard/use-copy-to-clipboard.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-copy-to-clipboard\",\n \"useCases\": [\n \"dom\",\n \"use-copy-to-clipboard\",\n \"usecopytoclipboard\",\n \"copy paste\",\n \"share link\",\n \"copy\",\n \"text\",\n \"clipboard\",\n \"tracking\",\n \"last\",\n \"copied\",\n \"value\"\n ]\n },\n {\n \"slug\": \"use-script\",\n \"name\": \"useScript\",\n \"description\": \"Load an external script and report its load status.\",\n \"category\": \"dom\",\n \"signature\": \"useScript(src: string | null, options?: UseScriptOptions): UseScriptStatus\",\n \"parameters\": [\n {\n \"name\": \"src\",\n \"type\": \"string | null\",\n \"defaultValue\": null,\n \"description\": \"The script URL to load, or null to skip loading and stay idle.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseScriptOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Optional shouldPreventLoad and removeOnUnmount flags.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"status\",\n \"type\": \"UseScriptStatus\",\n \"description\": \"The current load status: \\\"idle\\\" | \\\"loading\\\" | \\\"ready\\\" | \\\"error\\\".\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseScriptStatus\",\n \"description\": null,\n \"rows\": [\n {\n \"name\": \"value\",\n \"type\": \"\\\"idle\\\" | \\\"loading\\\" | \\\"ready\\\" | \\\"error\\\"\",\n \"defaultValue\": null,\n \"description\": \"Lifecycle of the injected script tag.\"\n }\n ]\n },\n {\n \"name\": \"UseScriptOptions\",\n \"description\": \"Flags controlling when the script loads and unloads.\",\n \"rows\": [\n {\n \"name\": \"shouldPreventLoad\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Keep the status \\\"idle\\\" without injecting the script — useful for deferring a load.\"\n },\n {\n \"name\": \"removeOnUnmount\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Remove the injected <script> tag when the component unmounts.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const status = useScript(\\\"https://example.com/widget.js\\\");\\n\\n if (status === \\\"ready\\\") return <p>Widget loaded.</p>;\\n return <p>Loading… ({status})</p>;\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\nexport type UseScriptStatus = \\\"idle\\\" | \\\"loading\\\" | \\\"ready\\\" | \\\"error\\\";\\n\\nexport interface UseScriptOptions {\\n shouldPreventLoad?: boolean;\\n removeOnUnmount?: boolean;\\n}\\n\\n/**\\n * Dynamically loads an external script and reports its load status.\\n *\\n * SSR-safe: the DOM is touched only inside `useEffect`, which never runs on the\\n * server. Existing `<script>` tags for the same `src` are reused (deduped via a\\n * `data-status` attribute) so multiple components can share one load. Pass a\\n * `null` `src` or `shouldPreventLoad` to keep the status `\\\"idle\\\"`.\\n *\\n * @param src - The script URL to load, or `null` to skip loading.\\n * @param options - Optional `shouldPreventLoad` and `removeOnUnmount` flags.\\n * @returns The current status: `\\\"idle\\\" | \\\"loading\\\" | \\\"ready\\\" | \\\"error\\\"`.\\n */\\nexport function useScript(\\n src: string | null,\\n options?: UseScriptOptions,\\n): UseScriptStatus {\\n const [status, setStatus] = useState<UseScriptStatus>(() => {\\n if (!src || options?.shouldPreventLoad) {\\n return \\\"idle\\\";\\n }\\n return \\\"loading\\\";\\n });\\n\\n useEffect(() => {\\n if (!src || options?.shouldPreventLoad) {\\n setStatus(\\\"idle\\\");\\n return;\\n }\\n\\n let script = document.querySelector<HTMLScriptElement>(\\n `script[src=\\\"${src}\\\"]`,\\n );\\n\\n if (script === null) {\\n script = document.createElement(\\\"script\\\");\\n script.src = src;\\n script.async = true;\\n script.setAttribute(\\\"data-status\\\", \\\"loading\\\");\\n document.body.appendChild(script);\\n\\n const setAttributeFromEvent = (event: Event) => {\\n script?.setAttribute(\\n \\\"data-status\\\",\\n event.type === \\\"load\\\" ? \\\"ready\\\" : \\\"error\\\",\\n );\\n };\\n\\n script.addEventListener(\\\"load\\\", setAttributeFromEvent);\\n script.addEventListener(\\\"error\\\", setAttributeFromEvent);\\n } else {\\n setStatus(\\n (script.getAttribute(\\\"data-status\\\") as UseScriptStatus | null) ??\\n \\\"loading\\\",\\n );\\n }\\n\\n const setStateFromEvent = (event: Event) => {\\n setStatus(event.type === \\\"load\\\" ? \\\"ready\\\" : \\\"error\\\");\\n };\\n\\n script.addEventListener(\\\"load\\\", setStateFromEvent);\\n script.addEventListener(\\\"error\\\", setStateFromEvent);\\n\\n return () => {\\n if (script) {\\n script.removeEventListener(\\\"load\\\", setStateFromEvent);\\n script.removeEventListener(\\\"error\\\", setStateFromEvent);\\n\\n if (options?.removeOnUnmount) {\\n script.remove();\\n }\\n }\\n };\\n }, [src, options?.shouldPreventLoad, options?.removeOnUnmount]);\\n\\n return status;\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-script/use-script.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-script\",\n \"useCases\": [\n \"dom\",\n \"use-script\",\n \"usescript\",\n \"load\",\n \"external\",\n \"script\",\n \"report\",\n \"status\"\n ]\n },\n {\n \"slug\": \"use-fetch\",\n \"name\": \"useFetch\",\n \"description\": \"Declarative fetch with loading and error status.\",\n \"category\": \"data\",\n \"signature\": \"useFetch<T>(url: string): { data: T | null; loading: boolean; error: Error | null }\",\n \"parameters\": [\n {\n \"name\": \"url\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The endpoint to GET. The request starts on mount and re-runs whenever the url changes.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"data\",\n \"type\": \"T | null\",\n \"description\": \"The parsed JSON body; null until the first request succeeds. Kept from the previous url while a refetch is in flight.\"\n },\n {\n \"name\": \"error\",\n \"type\": \"Error | null\",\n \"description\": \"Set on network failure or a non-ok response (\\\"HTTP error! status: 404\\\"). Never cleared by later requests — remount the component (e.g. key={url}) for fresh state.\"\n },\n {\n \"name\": \"loading\",\n \"type\": \"boolean\",\n \"description\": \"True until the first request settles. Not reset to true when the url changes — remount for a per-request loading flag.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"type Post = { id: number; title: string; body: string };\\n\\nexport function Demo() {\\n const { data, loading, error } = useFetch<Post>(\\n \\\"https://jsonplaceholder.typicode.com/posts/1\\\",\\n );\\n\\n if (loading) return <p>Loading…</p>;\\n if (error) return <p>Request failed: {error.message}</p>;\\n\\n return <article>{data?.title}</article>;\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\ninterface UseFetchResponse<T = any> {\\n data: T | null;\\n error: Error | null;\\n loading: boolean;\\n}\\n\\nexport const useFetch = <T>(url: string): UseFetchResponse<T> => {\\n const [data, setData] = useState<T | null>(null);\\n const [error, setError] = useState<Error | null>(null);\\n const [loading, setLoading] = useState(true);\\n\\n useEffect(() => {\\n const fetchData = async () => {\\n try {\\n const response = await fetch(url);\\n if (!response.ok) {\\n throw new Error(`HTTP error! status: ${response.status}`);\\n }\\n const fetchedData = await response.json();\\n setData(fetchedData);\\n } catch (error) {\\n setError(error as Error);\\n } finally {\\n setLoading(false);\\n }\\n };\\n\\n fetchData();\\n }, [url]);\\n\\n return { data, error, loading };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-fetch/use-fetch.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-fetch\",\n \"useCases\": [\n \"data\",\n \"use-fetch\",\n \"usefetch\",\n \"data fetching\",\n \"api call\",\n \"server requests\",\n \"loading states\",\n \"declarative\",\n \"fetch\",\n \"with\",\n \"loading\",\n \"error\",\n \"status\"\n ]\n },\n {\n \"slug\": \"use-geo-location\",\n \"name\": \"useGeoLocation\",\n \"description\": \"Browser geolocation state.\",\n \"category\": \"data\",\n \"signature\": \"useGeoLocation(): { location: GeolocationPosition | null; error: GeolocationError | Error | null }\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"location\",\n \"type\": \"GeolocationPosition | null\",\n \"description\": \"hookli's trimmed position type — just coords.latitude and coords.longitude. Null until the first reading arrives.\"\n },\n {\n \"name\": \"error\",\n \"type\": \"GeolocationError | Error | null\",\n \"description\": \"Permission denials, unsupported browsers and failed lookups all land here — read .message for display. Requesting starts on mount, so mount the hook behind a user gesture.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"GeolocationPosition\",\n \"description\": \"hookli's trimmed reading — only the coordinates, not the full browser GeolocationPosition.\",\n \"rows\": [\n {\n \"name\": \"coords.latitude\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Latitude in decimal degrees.\"\n },\n {\n \"name\": \"coords.longitude\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Longitude in decimal degrees.\"\n }\n ]\n },\n {\n \"name\": \"GeolocationError\",\n \"description\": \"Shape of a permission or lookup failure.\",\n \"rows\": [\n {\n \"name\": \"code\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Numeric error code mirrored from the browser's GeolocationPositionError.\"\n },\n {\n \"name\": \"message\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"Human-readable reason for the failure.\"\n }\n ]\n }\n ],\n \"usage\": \"function Coordinates() {\\n const { location, error } = useGeoLocation();\\n\\n if (error) return <p>{error.message}</p>;\\n if (!location) return <p>Locating…</p>;\\n\\n const { latitude, longitude } = location.coords;\\n return <p>{latitude.toFixed(4)}, {longitude.toFixed(4)}</p>;\\n}\\n\\nexport function Demo() {\\n const [asked, setAsked] = useState(false);\\n\\n // The hook may prompt for permission as soon as it mounts —\\n // keep it unmounted until a user gesture.\\n if (!asked) {\\n return <button onClick={() => setAsked(true)}>Where am I?</button>;\\n }\\n return <Coordinates />;\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\ninterface GeolocationError {\\n code: number;\\n message: string;\\n}\\n\\ntype GeolocationPosition = {\\n coords: {\\n latitude: number;\\n longitude: number;\\n };\\n};\\n\\ninterface GeolocationState {\\n location: GeolocationPosition | null;\\n error: GeolocationError | Error | null;\\n}\\n\\nexport const useGeoLocation = (): GeolocationState => {\\n const [location, setLocation] = useState<GeolocationPosition | null>(null);\\n const [error, setError] = useState<GeolocationError | Error | null>(null);\\n\\n useEffect(() => {\\n const getLocation = async () => {\\n try {\\n const position = await getCurrentPosition();\\n setLocation({\\n coords: {\\n latitude: position.coords.latitude,\\n longitude: position.coords.longitude,\\n },\\n });\\n } catch (error) {\\n setError(error as GeolocationError); // Type assertion for clarity\\n }\\n };\\n\\n if (navigator.geolocation) {\\n navigator.permissions\\n .query({ name: \\\"geolocation\\\" })\\n .then((result) => {\\n if (result.state === \\\"granted\\\") {\\n getLocation();\\n } else if (result.state === \\\"prompt\\\") {\\n navigator.geolocation.getCurrentPosition(\\n (position) => getLocation(),\\n (err) => setError(err as GeolocationError) // Type assertion\\n );\\n } else {\\n setError(new Error(\\\"Geolocation permission denied\\\"));\\n }\\n })\\n .catch((err) => setError(err as GeolocationError)); // Type assertion\\n } else {\\n setError(new Error(\\\"Geolocation is not supported by this browser.\\\"));\\n }\\n }, []);\\n\\n return { location, error };\\n};\\n\\nfunction getCurrentPosition(): Promise<GeolocationPosition> {\\n return new Promise((resolve, reject) => {\\n navigator.geolocation.getCurrentPosition(resolve, reject);\\n });\\n}\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-geo-location/use-geo-location.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-geo-location\",\n \"useCases\": [\n \"data\",\n \"use-geo-location\",\n \"usegeolocation\",\n \"browser\",\n \"geolocation\",\n \"state\"\n ]\n },\n {\n \"slug\": \"use-previous\",\n \"name\": \"usePrevious\",\n \"description\": \"Track a value from the previous render.\",\n \"category\": \"state\",\n \"signature\": \"usePrevious<T>(value: T): T | undefined\",\n \"parameters\": [\n {\n \"name\": \"value\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"The value to track across renders.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"previousValue\",\n \"type\": \"T | undefined\",\n \"description\": \"The value from the previous render (undefined on first render).\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [count, setCount] = useState(0);\\n const previousCount = usePrevious(count);\\n\\n return (\\n <div>\\n <p>Current: {count}</p>\\n <p>Previous: {previousCount ?? \\\"(none)\\\"}</p>\\n <button onClick={() => setCount((c) => c + 1)}>Increment</button>\\n <button onClick={() => setCount((c) => c - 1)}>Decrement</button>\\n <button onClick={() => setCount(0)}>Reset</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef } from \\\"react\\\";\\n\\n/**\\n * Tracks the value from the previous render.\\n *\\n * Returns `undefined` on the first render, then — on every render after — the\\n * value the hook was called with on the render before. The ref is written in an\\n * effect, so it always reflects the last committed value.\\n *\\n * @param value - The value to track across renders.\\n * @returns The value from the previous render (`undefined` on the first render).\\n */\\nexport const usePrevious = <T>(value: T): T | undefined => {\\n const ref = useRef<T | undefined>(undefined);\\n useEffect(() => {\\n ref.current = value;\\n }, [value]);\\n return ref.current;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-previous/use-previous.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-previous\",\n \"useCases\": [\n \"state\",\n \"use-previous\",\n \"useprevious\",\n \"track\",\n \"value\",\n \"from\",\n \"previous\",\n \"render\"\n ]\n },\n {\n \"slug\": \"use-list\",\n \"name\": \"useList\",\n \"description\": \"Array state with push, insert, update, remove, and clear helpers.\",\n \"category\": \"state\",\n \"signature\": \"useList<T>(initial?: T[]): [T[], UseListActions<T>]\",\n \"parameters\": [\n {\n \"name\": \"initial\",\n \"type\": \"T[]\",\n \"defaultValue\": \"[]\",\n \"description\": \"The initial array state.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] list\",\n \"type\": \"T[]\",\n \"description\": \"The current array state.\"\n },\n {\n \"name\": \"[1] actions\",\n \"type\": \"UseListActions<T>\",\n \"description\": \"Immutable manipulation actions (push, insertAt, updateAt, removeAt, clear, reset).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseListActions<T>\",\n \"description\": \"Actions returned by useList for manipulating the array immutably.\",\n \"rows\": [\n {\n \"name\": \"set\",\n \"type\": \"(list: T[]) => void\",\n \"defaultValue\": null,\n \"description\": \"Replaces the entire list with a new array.\"\n },\n {\n \"name\": \"push\",\n \"type\": \"(...items: T[]) => void\",\n \"defaultValue\": null,\n \"description\": \"Appends one or more items to the end of the list.\"\n },\n {\n \"name\": \"insertAt\",\n \"type\": \"(index: number, item: T) => void\",\n \"defaultValue\": null,\n \"description\": \"Inserts an item at the specified index.\"\n },\n {\n \"name\": \"updateAt\",\n \"type\": \"(index: number, item: T) => void\",\n \"defaultValue\": null,\n \"description\": \"Replaces the item at the specified index.\"\n },\n {\n \"name\": \"removeAt\",\n \"type\": \"(index: number) => void\",\n \"defaultValue\": null,\n \"description\": \"Removes the item at the specified index.\"\n },\n {\n \"name\": \"clear\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Empties the list.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Resets the list to its initial value.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [list, { push, removeAt, clear, reset }] = useList<string>([\\\"apple\\\", \\\"banana\\\"]);\\n\\n return (\\n <div>\\n <p>Items: {list.join(\\\", \\\")}</p>\\n <button onClick={() => push(\\\"cherry\\\")}>Push item</button>\\n <button onClick={() => removeAt(list.length - 1)}>Pop item</button>\\n <button onClick={clear}>Clear</button>\\n <button onClick={reset}>Reset</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useMemo, useState } from \\\"react\\\";\\n\\n/**\\n * Actions returned by {@link useList} for manipulating the array immutably.\\n */\\nexport interface UseListActions<T> {\\n /** Replace the whole list. */\\n set: (list: T[]) => void;\\n /** Append one or more items to the end. */\\n push: (...items: T[]) => void;\\n /** Insert an item at `index`, shifting the rest right. */\\n insertAt: (index: number, item: T) => void;\\n /** Replace the item at `index`. */\\n updateAt: (index: number, item: T) => void;\\n /** Remove the item at `index`. */\\n removeAt: (index: number) => void;\\n /** Empty the list. */\\n clear: () => void;\\n /** Reset to the initial list the hook was created with. */\\n reset: () => void;\\n}\\n\\n/**\\n * Manages array state with a set of immutable helpers (`push`, `insertAt`,\\n * `updateAt`, `removeAt`, `clear`, `reset`). Every helper produces a new array,\\n * so referential-equality checks and memoization work as expected.\\n *\\n * @param initial - The initial array. Defaults to `[]`.\\n * @returns A tuple of `[list, actions]`.\\n */\\nexport const useList = <T>(initial: T[] = []): [T[], UseListActions<T>] => {\\n const [list, setList] = useState<T[]>(initial);\\n\\n const actions = useMemo<UseListActions<T>>(\\n () => ({\\n set: (next) => setList(next),\\n push: (...items) => setList((prev) => [...prev, ...items]),\\n insertAt: (index, item) =>\\n setList((prev) => {\\n const next = prev.slice();\\n next.splice(index, 0, item);\\n return next;\\n }),\\n updateAt: (index, item) =>\\n setList((prev) => prev.map((value, i) => (i === index ? item : value))),\\n removeAt: (index) =>\\n setList((prev) => prev.filter((_, i) => i !== index)),\\n clear: () => setList([]),\\n reset: () => setList(initial),\\n }),\\n // `initial` is intentionally captured once (reset restores the original list).\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n [],\\n );\\n\\n return [list, actions];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-list/use-list.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-list\",\n \"useCases\": [\n \"state\",\n \"use-list\",\n \"uselist\",\n \"array\",\n \"with\",\n \"push\",\n \"insert\",\n \"update\",\n \"remove\",\n \"clear\",\n \"helpers\"\n ]\n },\n {\n \"slug\": \"use-set\",\n \"name\": \"useSet\",\n \"description\": \"Set state with add, remove, toggle, has, and clear helpers.\",\n \"category\": \"state\",\n \"signature\": \"useSet<T>(initial?: Iterable<T>): [Set<T>, UseSetActions<T>]\",\n \"parameters\": [\n {\n \"name\": \"initial\",\n \"type\": \"Iterable<T>\",\n \"defaultValue\": \"empty\",\n \"description\": \"Optional initial values to populate the Set with.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] set\",\n \"type\": \"Set<T>\",\n \"description\": \"The current Set state.\"\n },\n {\n \"name\": \"[1] actions\",\n \"type\": \"UseSetActions<T>\",\n \"description\": \"Immutable set manipulation actions (add, remove, toggle, has, clear, reset).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseSetActions<T>\",\n \"description\": \"Actions returned by useSet for manipulating the Set immutably.\",\n \"rows\": [\n {\n \"name\": \"add\",\n \"type\": \"(value: T) => void\",\n \"defaultValue\": null,\n \"description\": \"Adds a value to the set.\"\n },\n {\n \"name\": \"remove\",\n \"type\": \"(value: T) => void\",\n \"defaultValue\": null,\n \"description\": \"Removes a value from the set.\"\n },\n {\n \"name\": \"toggle\",\n \"type\": \"(value: T) => void\",\n \"defaultValue\": null,\n \"description\": \"Adds the value if absent, removes it if present.\"\n },\n {\n \"name\": \"has\",\n \"type\": \"(value: T) => boolean\",\n \"defaultValue\": null,\n \"description\": \"Returns whether the value is currently in the set.\"\n },\n {\n \"name\": \"clear\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Empties the set.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Resets the set to its initial values.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const [set, { add, remove, toggle, clear, reset }] = useSet<string>([\\\"react\\\"]);\\n\\n return (\\n <div>\\n <p>Selected: {Array.from(set).join(\\\", \\\")}</p>\\n <button onClick={() => toggle(\\\"typescript\\\")}>Toggle typescript</button>\\n <button onClick={() => add(\\\"nextjs\\\")}>Add nextjs</button>\\n <button onClick={() => remove(\\\"react\\\")}>Remove react</button>\\n <button onClick={clear}>Clear</button>\\n <button onClick={reset}>Reset</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useMemo, useRef, useState } from \\\"react\\\";\\n\\n/**\\n * Actions returned by {@link useSet} for manipulating the Set immutably.\\n */\\nexport interface UseSetActions<T> {\\n /** Add a value (no-op if already present). */\\n add: (value: T) => void;\\n /** Remove a value (no-op if absent). */\\n remove: (value: T) => void;\\n /** Add the value if missing, remove it if present. */\\n toggle: (value: T) => void;\\n /** Whether the value is currently in the set (reads the latest set). */\\n has: (value: T) => boolean;\\n /** Empty the set. */\\n clear: () => void;\\n /** Reset to the initial values the hook was created with. */\\n reset: () => void;\\n}\\n\\n/**\\n * Manages `Set` state with immutable helpers (`add`, `remove`, `toggle`, `has`,\\n * `clear`, `reset`). Mutating helpers create a new `Set` so React re-renders,\\n * and `add`/`remove` return the previous set unchanged when nothing changes to\\n * avoid needless renders. `has` always reads the latest value.\\n *\\n * @param initial - Initial values (any iterable). Defaults to empty.\\n * @returns A tuple of `[set, actions]`.\\n */\\nexport const useSet = <T>(initial?: Iterable<T>): [Set<T>, UseSetActions<T>] => {\\n const [set, setSet] = useState<Set<T>>(() => new Set(initial));\\n const latest = useRef(set);\\n latest.current = set;\\n\\n const actions = useMemo<UseSetActions<T>>(\\n () => ({\\n add: (value) =>\\n setSet((prev) => (prev.has(value) ? prev : new Set(prev).add(value))),\\n remove: (value) =>\\n setSet((prev) => {\\n if (!prev.has(value)) return prev;\\n const next = new Set(prev);\\n next.delete(value);\\n return next;\\n }),\\n toggle: (value) =>\\n setSet((prev) => {\\n const next = new Set(prev);\\n if (next.has(value)) next.delete(value);\\n else next.add(value);\\n return next;\\n }),\\n has: (value) => latest.current.has(value),\\n clear: () => setSet(new Set()),\\n reset: () => setSet(new Set(initial)),\\n }),\\n // `initial` is intentionally captured once (reset restores the original set).\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n [],\\n );\\n\\n return [set, actions];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-set/use-set.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-set\",\n \"useCases\": [\n \"state\",\n \"use-set\",\n \"useset\",\n \"with\",\n \"remove\",\n \"toggle\",\n \"clear\",\n \"helpers\"\n ]\n },\n {\n \"slug\": \"use-throttle\",\n \"name\": \"useThrottle\",\n \"description\": \"Throttle a fast-changing value to at most one update per interval.\",\n \"category\": \"effects\",\n \"signature\": \"useThrottle<T>(value: T, interval?: number): T\",\n \"parameters\": [\n {\n \"name\": \"value\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"The value to throttle.\"\n },\n {\n \"name\": \"interval\",\n \"type\": \"number\",\n \"defaultValue\": \"500\",\n \"description\": \"Minimum interval in milliseconds between updates.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"throttledValue\",\n \"type\": \"T\",\n \"description\": \"The throttled value, updated at most once per interval.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [query, setQuery] = useState(\\\"\\\");\\n const throttledQuery = useThrottle(query, 500);\\n\\n return (\\n <div>\\n <input\\n value={query}\\n onChange={(e) => setQuery(e.target.value)}\\n placeholder=\\\"Search...\\\"\\n />\\n <p>Instant: {query}</p>\\n <p>Throttled: {throttledQuery}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef, useState } from \\\"react\\\";\\n\\n/**\\n * Throttles a fast-changing value: the returned value updates at most once every\\n * `interval` milliseconds. A trailing update is scheduled so the latest value is\\n * never dropped. The timer lives inside an effect, so the hook is SSR-safe and\\n * cleans up on unmount.\\n *\\n * The twin of {@link useDebounce} — throttle emits on a steady cadence while the\\n * value keeps changing; debounce waits for the changes to stop.\\n *\\n * @param value - The value to throttle.\\n * @param interval - Minimum time between updates, in milliseconds. Defaults to `500`.\\n * @returns The throttled value.\\n */\\nexport const useThrottle = <T>(value: T, interval: number = 500): T => {\\n const [throttled, setThrottled] = useState<T>(value);\\n const lastRan = useRef<number>(Date.now());\\n\\n useEffect(() => {\\n const now = Date.now();\\n const remaining = interval - (now - lastRan.current);\\n\\n if (remaining <= 0) {\\n lastRan.current = now;\\n setThrottled(value);\\n return;\\n }\\n\\n const id = setTimeout(() => {\\n lastRan.current = Date.now();\\n setThrottled(value);\\n }, remaining);\\n return () => clearTimeout(id);\\n }, [value, interval]);\\n\\n return throttled;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-throttle/use-throttle.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-throttle\",\n \"useCases\": [\n \"effects\",\n \"use-throttle\",\n \"usethrottle\",\n \"rate limiting\",\n \"search input\",\n \"resize delay\",\n \"typing delay\",\n \"api optimization\",\n \"throttle\",\n \"fast\",\n \"changing\",\n \"value\",\n \"most\",\n \"update\",\n \"interval\"\n ]\n },\n {\n \"slug\": \"use-update-effect\",\n \"name\": \"useUpdateEffect\",\n \"description\": \"A useEffect that skips the initial mount and runs only on updates.\",\n \"category\": \"effects\",\n \"signature\": \"useUpdateEffect(effect: EffectCallback, deps?: DependencyList): void\",\n \"parameters\": [\n {\n \"name\": \"effect\",\n \"type\": \"EffectCallback\",\n \"defaultValue\": null,\n \"description\": \"Effect callback to execute on updates. Skips initial mount.\"\n },\n {\n \"name\": \"deps\",\n \"type\": \"DependencyList\",\n \"defaultValue\": \"undefined\",\n \"description\": \"Dependency list triggering the effect on change.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"void\",\n \"type\": \"void\",\n \"description\": \"Returns nothing.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [count, setCount] = useState(0);\\n\\n useUpdateEffect(() => {\\n console.log(\\\"Count changed to:\\\", count);\\n }, [count]);\\n\\n return (\\n <div>\\n <p>Count: {count}</p>\\n <button onClick={() => setCount((c) => c + 1)}>Increment</button>\\n </div>\\n );\\n}\",\n \"source\": \"import {\\n useEffect,\\n useRef,\\n type DependencyList,\\n type EffectCallback,\\n} from \\\"react\\\";\\n\\n/**\\n * A variant of `useEffect` that **skips the initial mount** and only runs on\\n * subsequent dependency changes. Handy for reacting to updates without the\\n * effect firing once on first render.\\n *\\n * @param effect - Imperative effect callback; may return a cleanup function.\\n * @param deps - Dependency list, with the same semantics as `useEffect`.\\n */\\nexport const useUpdateEffect = (\\n effect: EffectCallback,\\n deps?: DependencyList,\\n): void => {\\n const isFirst = useRef(true);\\n\\n useEffect(() => {\\n if (isFirst.current) {\\n isFirst.current = false;\\n return;\\n }\\n return effect();\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n }, deps);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-update-effect/use-update-effect.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-update-effect\",\n \"useCases\": [\n \"effects\",\n \"use-update-effect\",\n \"useupdateeffect\",\n \"useeffect\",\n \"that\",\n \"skips\",\n \"initial\",\n \"mount\",\n \"runs\",\n \"only\",\n \"updates\"\n ]\n },\n {\n \"slug\": \"use-effect-once\",\n \"name\": \"useEffectOnce\",\n \"description\": \"Run an effect exactly once, on mount.\",\n \"category\": \"effects\",\n \"signature\": \"useEffectOnce(effect: EffectCallback): void\",\n \"parameters\": [\n {\n \"name\": \"effect\",\n \"type\": \"EffectCallback\",\n \"defaultValue\": null,\n \"description\": \"Effect callback executed only once on initial mount.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"void\",\n \"type\": \"void\",\n \"description\": \"Returns nothing.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n useEffectOnce(() => {\\n console.log(\\\"Component mounted exactly once\\\");\\n\\n return () => {\\n console.log(\\\"Component unmounted\\\");\\n };\\n });\\n\\n return <div>Mounted</div>;\\n}\",\n \"source\": \"import { useEffect, type EffectCallback } from \\\"react\\\";\\n\\n/**\\n * Runs an effect exactly once, on mount. A convenience wrapper around\\n * `useEffect(effect, [])` that makes the intent explicit and contains the\\n * exhaustive-deps exception in one place.\\n *\\n * @param effect - Imperative effect callback; may return a cleanup function that\\n * runs on unmount.\\n */\\nexport const useEffectOnce = (effect: EffectCallback): void => {\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n useEffect(effect, []);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-effect-once/use-effect-once.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-effect-once\",\n \"useCases\": [\n \"effects\",\n \"use-effect-once\",\n \"useeffectonce\",\n \"effect\",\n \"exactly\",\n \"once\",\n \"mount\"\n ]\n },\n {\n \"slug\": \"use-key-press\",\n \"name\": \"useKeyPress\",\n \"description\": \"Track whether a specific key is currently held down.\",\n \"category\": \"dom\",\n \"signature\": \"useKeyPress(targetKey: string): boolean\",\n \"parameters\": [\n {\n \"name\": \"targetKey\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"The KeyboardEvent.key to watch (e.g. 'Enter', 'Escape').\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"pressed\",\n \"type\": \"boolean\",\n \"description\": \"True while the specified key is held down.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const enterPressed = useKeyPress(\\\"Enter\\\");\\n const escapePressed = useKeyPress(\\\"Escape\\\");\\n\\n return (\\n <div>\\n <p>Enter: {enterPressed ? \\\"Pressed\\\" : \\\"Released\\\"}</p>\\n <p>Escape: {escapePressed ? \\\"Pressed\\\" : \\\"Released\\\"}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * Tracks whether a specific key is currently held down. Listens for `keydown`\\n * and `keyup` on `window` (attached in an effect, so SSR-safe) and removes the\\n * listeners on unmount.\\n *\\n * @param targetKey - The `KeyboardEvent.key` to watch (e.g. `\\\"Enter\\\"`, `\\\"a\\\"`, `\\\"Escape\\\"`).\\n * @returns `true` while the key is pressed, `false` otherwise.\\n */\\nexport const useKeyPress = (targetKey: string): boolean => {\\n const [pressed, setPressed] = useState(false);\\n\\n useEffect(() => {\\n const down = (event: KeyboardEvent) => {\\n if (event.key === targetKey) setPressed(true);\\n };\\n const up = (event: KeyboardEvent) => {\\n if (event.key === targetKey) setPressed(false);\\n };\\n window.addEventListener(\\\"keydown\\\", down);\\n window.addEventListener(\\\"keyup\\\", up);\\n return () => {\\n window.removeEventListener(\\\"keydown\\\", down);\\n window.removeEventListener(\\\"keyup\\\", up);\\n };\\n }, [targetKey]);\\n\\n return pressed;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-key-press/use-key-press.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-key-press\",\n \"useCases\": [\n \"dom\",\n \"use-key-press\",\n \"usekeypress\",\n \"shortcuts\",\n \"keyboard navigation\",\n \"accessibility\",\n \"track\",\n \"whether\",\n \"specific\",\n \"currently\",\n \"held\",\n \"down\"\n ]\n },\n {\n \"slug\": \"use-window-scroll\",\n \"name\": \"useWindowScroll\",\n \"description\": \"Track the window scroll position reactively.\",\n \"category\": \"dom\",\n \"signature\": \"useWindowScroll(): { x: number; y: number }\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"scroll\",\n \"type\": \"{ x: number; y: number }\",\n \"description\": \"The current horizontal (x) and vertical (y) scroll position in pixels.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const { x, y } = useWindowScroll();\\n\\n return (\\n <div>\\n <p>Scroll X: {x}px</p>\\n <p>Scroll Y: {y}px</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * The window scroll offset reported by {@link useWindowScroll}.\\n */\\nexport interface WindowScrollPosition {\\n /** Horizontal scroll offset in pixels (`window.scrollX`). */\\n x: number;\\n /** Vertical scroll offset in pixels (`window.scrollY`). */\\n y: number;\\n}\\n\\n/**\\n * Tracks the window's scroll position reactively. The listener is registered in\\n * an effect (SSR-safe) and marked `passive` for scroll performance. Both values\\n * start at `0` and update on every scroll.\\n *\\n * @returns The current `{ x, y }` scroll offset in pixels.\\n */\\nexport const useWindowScroll = (): WindowScrollPosition => {\\n const [position, setPosition] = useState<WindowScrollPosition>({ x: 0, y: 0 });\\n\\n useEffect(() => {\\n const onScroll = () =>\\n setPosition({ x: window.scrollX, y: window.scrollY });\\n onScroll();\\n window.addEventListener(\\\"scroll\\\", onScroll, { passive: true });\\n return () => window.removeEventListener(\\\"scroll\\\", onScroll);\\n }, []);\\n\\n return position;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-window-scroll/use-window-scroll.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-window-scroll\",\n \"useCases\": [\n \"dom\",\n \"use-window-scroll\",\n \"usewindowscroll\",\n \"lazy loading\",\n \"infinite list\",\n \"viewport\",\n \"visibility\",\n \"responsive\",\n \"mobile detection\",\n \"viewport size\",\n \"track\",\n \"window\",\n \"scroll\",\n \"position\",\n \"reactively\"\n ]\n },\n {\n \"slug\": \"use-async\",\n \"name\": \"useAsync\",\n \"description\": \"Run an async function and track its loading, error, and value state.\",\n \"category\": \"data\",\n \"signature\": \"useAsync<T>(asyncFunction: () => Promise<T>, immediate?: boolean): UseAsyncReturn<T>\",\n \"parameters\": [\n {\n \"name\": \"asyncFunction\",\n \"type\": \"() => Promise<T>\",\n \"defaultValue\": null,\n \"description\": \"The asynchronous function to execute.\"\n },\n {\n \"name\": \"immediate\",\n \"type\": \"boolean\",\n \"defaultValue\": \"true\",\n \"description\": \"Whether to execute the async function immediately on mount.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"state\",\n \"type\": \"UseAsyncReturn<T>\",\n \"description\": \"Object containing loading, error, value, and execute handler.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseAsyncReturn<T>\",\n \"description\": \"State and execution handler returned by useAsync.\",\n \"rows\": [\n {\n \"name\": \"loading\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether the async function is currently running.\"\n },\n {\n \"name\": \"error\",\n \"type\": \"Error | null\",\n \"defaultValue\": null,\n \"description\": \"The error thrown by the last run, or null.\"\n },\n {\n \"name\": \"value\",\n \"type\": \"T | null\",\n \"defaultValue\": null,\n \"description\": \"The resolved value from the last run, or null.\"\n },\n {\n \"name\": \"execute\",\n \"type\": \"() => Promise<void>\",\n \"defaultValue\": null,\n \"description\": \"Re-triggers execution of the async function.\"\n }\n ]\n }\n ],\n \"usage\": \"const fetchData = async () => {\\n const res = await fetch(\\\"https://api.example.com/data\\\");\\n return res.json();\\n};\\n\\nexport function Demo() {\\n const { value, loading, error, execute } = useAsync(fetchData);\\n\\n if (loading) return <p>Loading...</p>;\\n if (error) return <p>Error: {error.message}</p>;\\n\\n return (\\n <div>\\n <pre>{JSON.stringify(value, null, 2)}</pre>\\n <button onClick={execute}>Reload</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useRef, useState } from \\\"react\\\";\\n\\n/**\\n * The state returned by {@link useAsync}.\\n */\\nexport interface UseAsyncReturn<T> {\\n /** Whether the async function is currently running. */\\n loading: boolean;\\n /** The error thrown by the last run, or `null`. */\\n error: Error | null;\\n /** The value resolved by the last successful run, or `null`. */\\n value: T | null;\\n /** Run the async function again. */\\n execute: () => Promise<void>;\\n}\\n\\n/**\\n * Runs an async function and tracks its `{ loading, error, value }` state. By\\n * default it runs on mount; pass `immediate = false` to run it only via the\\n * returned `execute`. State is never set after unmount, so it won't leak or warn.\\n *\\n * @param asyncFunction - The async function to run.\\n * @param immediate - Run on mount. Defaults to `true`.\\n * @returns `{ loading, error, value, execute }`.\\n */\\nexport const useAsync = <T>(\\n asyncFunction: () => Promise<T>,\\n immediate: boolean = true,\\n): UseAsyncReturn<T> => {\\n const [loading, setLoading] = useState<boolean>(immediate);\\n const [error, setError] = useState<Error | null>(null);\\n const [value, setValue] = useState<T | null>(null);\\n\\n const fnRef = useRef(asyncFunction);\\n fnRef.current = asyncFunction;\\n const mounted = useRef(true);\\n\\n useEffect(() => {\\n mounted.current = true;\\n return () => {\\n mounted.current = false;\\n };\\n }, []);\\n\\n const execute = useCallback(async () => {\\n setLoading(true);\\n setError(null);\\n try {\\n const result = await fnRef.current();\\n if (mounted.current) setValue(result);\\n } catch (err) {\\n if (mounted.current) {\\n setError(err instanceof Error ? err : new Error(String(err)));\\n }\\n } finally {\\n if (mounted.current) setLoading(false);\\n }\\n }, []);\\n\\n useEffect(() => {\\n if (immediate) void execute();\\n }, [execute, immediate]);\\n\\n return { loading, error, value, execute };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-async/use-async.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-async\",\n \"useCases\": [\n \"data\",\n \"use-async\",\n \"useasync\",\n \"data fetching\",\n \"api call\",\n \"server requests\",\n \"loading states\",\n \"async\",\n \"function\",\n \"track\",\n \"loading\",\n \"error\",\n \"value\",\n \"state\"\n ]\n },\n {\n \"slug\": \"use-mutation\",\n \"name\": \"useMutation\",\n \"description\": \"Run an async write action on demand and track status, data, and error.\",\n \"category\": \"data\",\n \"signature\": \"useMutation<TArgs, TData>(mutationFn: (...args: TArgs) => Promise<TData>): UseMutationReturn<TArgs, TData>\",\n \"parameters\": [\n {\n \"name\": \"mutationFn\",\n \"type\": \"(...args: TArgs) => Promise<TData>\",\n \"defaultValue\": null,\n \"description\": \"Async function to execute when mutate is called.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"mutation\",\n \"type\": \"UseMutationReturn<TArgs, TData>\",\n \"description\": \"Object containing mutate, status, isLoading, data, error, and reset.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseMutationReturn<TArgs, TData>\",\n \"description\": \"Object returned by useMutation containing mutation state and actions.\",\n \"rows\": [\n {\n \"name\": \"mutate\",\n \"type\": \"(...args: TArgs) => Promise<TData | undefined>\",\n \"defaultValue\": null,\n \"description\": \"Executes the async mutation.\"\n },\n {\n \"name\": \"status\",\n \"type\": \"\\\"idle\\\" | \\\"loading\\\" | \\\"success\\\" | \\\"error\\\"\",\n \"defaultValue\": null,\n \"description\": \"Current mutation lifecycle status.\"\n },\n {\n \"name\": \"isLoading\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Convenience boolean for status === 'loading'.\"\n },\n {\n \"name\": \"data\",\n \"type\": \"TData | null\",\n \"defaultValue\": null,\n \"description\": \"Data returned by the last successful mutation.\"\n },\n {\n \"name\": \"error\",\n \"type\": \"Error | null\",\n \"defaultValue\": null,\n \"description\": \"Error thrown by the last failed mutation.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Resets status, data, and error back to idle.\"\n }\n ]\n }\n ],\n \"usage\": \"const createUser = async (name: string) => {\\n const res = await fetch(\\\"/api/users\\\", {\\n method: \\\"POST\\\",\\n body: JSON.stringify({ name }),\\n });\\n return res.json();\\n};\\n\\nexport function Demo() {\\n const { mutate, data, isLoading } = useMutation(createUser);\\n\\n return (\\n <div>\\n <button disabled={isLoading} onClick={() => mutate(\\\"Alice\\\")}>\\n {isLoading ? \\\"Saving...\\\" : \\\"Create User\\\"}\\n </button>\\n {data && <p>Created ID: {data.id}</p>}\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useRef, useState } from \\\"react\\\";\\n\\n/** The lifecycle status of a {@link useMutation}. */\\nexport type MutationStatus = \\\"idle\\\" | \\\"loading\\\" | \\\"success\\\" | \\\"error\\\";\\n\\n/**\\n * The value returned by {@link useMutation}.\\n */\\nexport interface UseMutationReturn<TArgs extends unknown[], TData> {\\n /** Run the mutation. Resolves with the data, or `undefined` if it errored. */\\n mutate: (...args: TArgs) => Promise<TData | undefined>;\\n /** Current lifecycle status. */\\n status: MutationStatus;\\n /** Convenience flag for `status === \\\"loading\\\"`. */\\n isLoading: boolean;\\n /** Data from the last successful run, or `null`. */\\n data: TData | null;\\n /** Error from the last failed run, or `null`. */\\n error: Error | null;\\n /** Reset back to the idle state. */\\n reset: () => void;\\n}\\n\\n/**\\n * Runs an async write action (create/update/delete) on demand and tracks its\\n * `status`, `data`, and `error` — the write-side companion to {@link useAsync}.\\n * `mutate` never throws: on failure it records the error and resolves to\\n * `undefined`. State is not set after unmount.\\n *\\n * @param mutationFn - The async function to run when `mutate` is called.\\n * @returns `{ mutate, status, isLoading, data, error, reset }`.\\n */\\nexport const useMutation = <TArgs extends unknown[], TData>(\\n mutationFn: (...args: TArgs) => Promise<TData>,\\n): UseMutationReturn<TArgs, TData> => {\\n const [status, setStatus] = useState<MutationStatus>(\\\"idle\\\");\\n const [data, setData] = useState<TData | null>(null);\\n const [error, setError] = useState<Error | null>(null);\\n\\n const fnRef = useRef(mutationFn);\\n fnRef.current = mutationFn;\\n const mounted = useRef(true);\\n\\n const mutate = useCallback(async (...args: TArgs) => {\\n setStatus(\\\"loading\\\");\\n setError(null);\\n try {\\n const result = await fnRef.current(...args);\\n if (mounted.current) {\\n setData(result);\\n setStatus(\\\"success\\\");\\n }\\n return result;\\n } catch (err) {\\n if (mounted.current) {\\n setError(err instanceof Error ? err : new Error(String(err)));\\n setStatus(\\\"error\\\");\\n }\\n return undefined;\\n }\\n }, []);\\n\\n const reset = useCallback(() => {\\n setStatus(\\\"idle\\\");\\n setData(null);\\n setError(null);\\n }, []);\\n\\n return { mutate, status, isLoading: status === \\\"loading\\\", data, error, reset };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-mutation/use-mutation.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-mutation\",\n \"useCases\": [\n \"data\",\n \"use-mutation\",\n \"usemutation\",\n \"data fetching\",\n \"api call\",\n \"server requests\",\n \"loading states\",\n \"async\",\n \"write\",\n \"action\",\n \"demand\",\n \"track\",\n \"status\",\n \"error\"\n ]\n },\n {\n \"slug\": \"use-pagination\",\n \"name\": \"usePagination\",\n \"description\": \"Page, page size, total pages, navigation helpers, and the current item range.\",\n \"category\": \"data\",\n \"signature\": \"usePagination(options?: UsePaginationOptions): UsePaginationReturn\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UsePaginationOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Options object with total (default 0), pageSize (default 10), and initialPage (default 1).\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"pagination\",\n \"type\": \"UsePaginationReturn\",\n \"description\": \"Pagination state and controls (page, totalPages, next, prev, first, last, range).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UsePaginationReturn\",\n \"description\": \"Pagination state and navigation helpers returned by usePagination.\",\n \"rows\": [\n {\n \"name\": \"page\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Current page number (1-indexed).\"\n },\n {\n \"name\": \"pageSize\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Number of items per page.\"\n },\n {\n \"name\": \"totalPages\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Total number of pages.\"\n },\n {\n \"name\": \"setPage\",\n \"type\": \"(page: number) => void\",\n \"defaultValue\": null,\n \"description\": \"Jumps directly to a specific page.\"\n },\n {\n \"name\": \"next\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Advances to the next page.\"\n },\n {\n \"name\": \"prev\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Moves to the previous page.\"\n },\n {\n \"name\": \"first\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Jumps to page 1.\"\n },\n {\n \"name\": \"last\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Jumps to the last page.\"\n },\n {\n \"name\": \"canNext\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether a subsequent page exists.\"\n },\n {\n \"name\": \"canPrev\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether an earlier page exists.\"\n },\n {\n \"name\": \"range\",\n \"type\": \"{ start: number; end: number }\",\n \"defaultValue\": null,\n \"description\": \"Zero-based item indices for the current page.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { page, totalPages, next, prev, canNext, canPrev } = usePagination({\\n total: 100,\\n pageSize: 10,\\n initialPage: 1,\\n });\\n\\n return (\\n <div>\\n <p>Page {page} of {totalPages}</p>\\n <button disabled={!canPrev} onClick={prev}>Prev</button>\\n <button disabled={!canNext} onClick={next}>Next</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useMemo, useState } from \\\"react\\\";\\n\\n/** Options for {@link usePagination}. */\\nexport interface UsePaginationOptions {\\n /** Total number of items. Defaults to `0`. */\\n total?: number;\\n /** Items per page. Defaults to `10`. */\\n pageSize?: number;\\n /** Starting page (1-indexed). Defaults to `1`. */\\n initialPage?: number;\\n}\\n\\n/** The value returned by {@link usePagination}. */\\nexport interface UsePaginationReturn {\\n /** Current page (1-indexed). */\\n page: number;\\n /** Items per page. */\\n pageSize: number;\\n /** Total number of pages (always ≥ 1). */\\n totalPages: number;\\n /** Jump to a page (clamped to `[1, totalPages]`). */\\n setPage: (page: number) => void;\\n /** Go to the next page (clamped). */\\n next: () => void;\\n /** Go to the previous page (clamped). */\\n prev: () => void;\\n /** Jump to the first page. */\\n first: () => void;\\n /** Jump to the last page. */\\n last: () => void;\\n /** Whether a previous page exists. */\\n canPrev: boolean;\\n /** Whether a next page exists. */\\n canNext: boolean;\\n /** Zero-based item index range for the current page: `[start, end)`. */\\n range: { start: number; end: number };\\n}\\n\\nconst clamp = (value: number, min: number, max: number): number =>\\n Math.min(Math.max(value, min), max);\\n\\n/**\\n * Manages 1-indexed pagination state — page, page size, total pages, navigation\\n * helpers, and the current item `range`. Pure state math; no data fetching.\\n *\\n * @param options - `{ total, pageSize, initialPage }`.\\n * @returns Pagination state and navigation helpers.\\n */\\nexport const usePagination = (\\n options: UsePaginationOptions = {},\\n): UsePaginationReturn => {\\n const { total = 0, pageSize = 10, initialPage = 1 } = options;\\n const totalPages = Math.max(1, Math.ceil(total / pageSize));\\n\\n const [page, setPageState] = useState<number>(() =>\\n clamp(initialPage, 1, totalPages),\\n );\\n\\n const setPage = useCallback(\\n (next: number) => setPageState(clamp(next, 1, totalPages)),\\n [totalPages],\\n );\\n const next = useCallback(\\n () => setPageState((p) => clamp(p + 1, 1, totalPages)),\\n [totalPages],\\n );\\n const prev = useCallback(\\n () => setPageState((p) => clamp(p - 1, 1, totalPages)),\\n [totalPages],\\n );\\n const first = useCallback(() => setPageState(1), []);\\n const last = useCallback(() => setPageState(totalPages), [totalPages]);\\n\\n const current = clamp(page, 1, totalPages);\\n const range = useMemo(\\n () => ({\\n start: (current - 1) * pageSize,\\n end: Math.min(current * pageSize, total),\\n }),\\n [current, pageSize, total],\\n );\\n\\n return {\\n page: current,\\n pageSize,\\n totalPages,\\n setPage,\\n next,\\n prev,\\n first,\\n last,\\n canPrev: current > 1,\\n canNext: current < totalPages,\\n range,\\n };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-pagination/use-pagination.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-pagination\",\n \"useCases\": [\n \"data\",\n \"use-pagination\",\n \"usepagination\",\n \"page\",\n \"size\",\n \"total\",\n \"pages\",\n \"navigation\",\n \"helpers\",\n \"current\",\n \"item\",\n \"range\"\n ]\n },\n {\n \"slug\": \"use-network-state\",\n \"name\": \"useNetworkState\",\n \"description\": \"Track online/offline status and connection details.\",\n \"category\": \"data\",\n \"signature\": \"useNetworkState(): NetworkState\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"networkState\",\n \"type\": \"NetworkState\",\n \"description\": \"Snapshot of network status (online, effectiveType, downlink, rtt, saveData).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"NetworkState\",\n \"description\": \"Snapshot of the browser connection returned by useNetworkState.\",\n \"rows\": [\n {\n \"name\": \"online\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether the browser has network connectivity.\"\n },\n {\n \"name\": \"effectiveType\",\n \"type\": \"string | undefined\",\n \"defaultValue\": null,\n \"description\": \"Effective connection type (e.g. '4g').\"\n },\n {\n \"name\": \"downlink\",\n \"type\": \"number | undefined\",\n \"defaultValue\": null,\n \"description\": \"Estimated bandwidth in megabits per second.\"\n },\n {\n \"name\": \"rtt\",\n \"type\": \"number | undefined\",\n \"defaultValue\": null,\n \"description\": \"Estimated round-trip time in milliseconds.\"\n },\n {\n \"name\": \"saveData\",\n \"type\": \"boolean | undefined\",\n \"defaultValue\": null,\n \"description\": \"Whether user enabled data-saving mode.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { online, effectiveType, downlink } = useNetworkState();\\n\\n return (\\n <div>\\n <p>Status: {online ? \\\"Online\\\" : \\\"Offline\\\"}</p>\\n <p>Effective Type: {effectiveType ?? \\\"unknown\\\"}</p>\\n <p>Downlink: {downlink ?? 0} Mbps</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * The network snapshot returned by {@link useNetworkState}. Connection details\\n * come from the Network Information API and are `undefined` where unsupported.\\n */\\nexport interface NetworkState {\\n /** Whether the browser is online (`navigator.onLine`). */\\n online: boolean;\\n /** Effective connection type, e.g. `\\\"4g\\\"` (if supported). */\\n effectiveType?: string;\\n /** Downlink speed estimate in Mbps (if supported). */\\n downlink?: number;\\n /** Round-trip time estimate in ms (if supported). */\\n rtt?: number;\\n /** Whether the user requested reduced data usage (if supported). */\\n saveData?: boolean;\\n}\\n\\ntype ConnectionLike = {\\n effectiveType?: string;\\n downlink?: number;\\n rtt?: number;\\n saveData?: boolean;\\n addEventListener?: (type: \\\"change\\\", listener: () => void) => void;\\n removeEventListener?: (type: \\\"change\\\", listener: () => void) => void;\\n};\\n\\nconst getConnection = (): ConnectionLike | undefined => {\\n if (typeof navigator === \\\"undefined\\\") return undefined;\\n return (\\n (navigator as unknown as { connection?: ConnectionLike }).connection ??\\n undefined\\n );\\n};\\n\\nconst read = (): NetworkState => {\\n if (typeof navigator === \\\"undefined\\\") return { online: true };\\n const c = getConnection();\\n return {\\n online: navigator.onLine,\\n effectiveType: c?.effectiveType,\\n downlink: c?.downlink,\\n rtt: c?.rtt,\\n saveData: c?.saveData,\\n };\\n};\\n\\n/**\\n * Tracks the browser's network state — online/offline plus connection details\\n * where the Network Information API is available. Listeners attach in an effect,\\n * so it is SSR-safe (returns `{ online: true }` on the server).\\n *\\n * @returns The current {@link NetworkState}.\\n */\\nexport const useNetworkState = (): NetworkState => {\\n const [state, setState] = useState<NetworkState>(() =>\\n typeof navigator === \\\"undefined\\\" ? { online: true } : read(),\\n );\\n\\n useEffect(() => {\\n const update = () => setState(read());\\n update();\\n window.addEventListener(\\\"online\\\", update);\\n window.addEventListener(\\\"offline\\\", update);\\n const c = getConnection();\\n c?.addEventListener?.(\\\"change\\\", update);\\n return () => {\\n window.removeEventListener(\\\"online\\\", update);\\n window.removeEventListener(\\\"offline\\\", update);\\n c?.removeEventListener?.(\\\"change\\\", update);\\n };\\n }, []);\\n\\n return state;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-network-state/use-network-state.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-network-state\",\n \"useCases\": [\n \"data\",\n \"use-network-state\",\n \"usenetworkstate\",\n \"track\",\n \"online\",\n \"offline\",\n \"status\",\n \"connection\",\n \"details\"\n ]\n },\n {\n \"slug\": \"use-page-visibility\",\n \"name\": \"usePageVisibility\",\n \"description\": \"Track whether the page/tab is currently visible.\",\n \"category\": \"effects\",\n \"signature\": \"usePageVisibility(): boolean\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"isVisible\",\n \"type\": \"boolean\",\n \"description\": \"True if the document/tab is currently visible, false when hidden or backgrounded.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const isVisible = usePageVisibility();\\n\\n return (\\n <div>\\n <p>Tab is currently: {isVisible ? \\\"Visible\\\" : \\\"Hidden\\\"}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * Tracks whether the page/tab is currently visible via the Page Visibility API\\n * (`document.visibilityState`). The listener attaches in an effect, so it is\\n * SSR-safe (returns `true` on the server).\\n *\\n * @returns `true` while the tab is visible, `false` when hidden/backgrounded.\\n */\\nexport const usePageVisibility = (): boolean => {\\n const [visible, setVisible] = useState<boolean>(true);\\n\\n useEffect(() => {\\n const update = () => setVisible(document.visibilityState === \\\"visible\\\");\\n update();\\n document.addEventListener(\\\"visibilitychange\\\", update);\\n return () => document.removeEventListener(\\\"visibilitychange\\\", update);\\n }, []);\\n\\n return visible;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-page-visibility/use-page-visibility.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-page-visibility\",\n \"useCases\": [\n \"effects\",\n \"use-page-visibility\",\n \"usepagevisibility\",\n \"track\",\n \"whether\",\n \"page\",\n \"currently\",\n \"visible\"\n ]\n },\n {\n \"slug\": \"use-idle\",\n \"name\": \"useIdle\",\n \"description\": \"Detect user inactivity after a configurable threshold.\",\n \"category\": \"dom\",\n \"signature\": \"useIdle(ms?: number): boolean\",\n \"parameters\": [\n {\n \"name\": \"ms\",\n \"type\": \"number\",\n \"defaultValue\": \"60000\",\n \"description\": \"Inactivity threshold in milliseconds before switching to idle.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"isIdle\",\n \"type\": \"boolean\",\n \"description\": \"True if user has been inactive for at least ms milliseconds.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const isIdle = useIdle(5000);\\n\\n return (\\n <div>\\n <p>User is: {isIdle ? \\\"Idle\\\" : \\\"Active\\\"}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\nconst ACTIVITY_EVENTS = [\\n \\\"mousemove\\\",\\n \\\"mousedown\\\",\\n \\\"keydown\\\",\\n \\\"touchstart\\\",\\n \\\"scroll\\\",\\n \\\"wheel\\\",\\n] as const;\\n\\n/**\\n * Reports whether the user has been idle (no activity) for at least `ms`\\n * milliseconds. Any mouse/keyboard/touch/scroll activity resets the timer.\\n * Listeners attach in an effect, so it is SSR-safe.\\n *\\n * @param ms - Inactivity threshold in milliseconds. Defaults to `60000` (1 min).\\n * @returns `true` once the user has been idle for `ms`, `false` while active.\\n */\\nexport const useIdle = (ms: number = 60_000): boolean => {\\n const [idle, setIdle] = useState<boolean>(false);\\n\\n useEffect(() => {\\n let timeoutId: ReturnType<typeof setTimeout>;\\n\\n const reset = () => {\\n setIdle(false);\\n clearTimeout(timeoutId);\\n timeoutId = setTimeout(() => setIdle(true), ms);\\n };\\n\\n reset();\\n for (const event of ACTIVITY_EVENTS) {\\n window.addEventListener(event, reset, { passive: true });\\n }\\n return () => {\\n clearTimeout(timeoutId);\\n for (const event of ACTIVITY_EVENTS) {\\n window.removeEventListener(event, reset);\\n }\\n };\\n }, [ms]);\\n\\n return idle;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-idle/use-idle.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-idle\",\n \"useCases\": [\n \"dom\",\n \"use-idle\",\n \"useidle\",\n \"detect\",\n \"user\",\n \"inactivity\",\n \"after\",\n \"configurable\",\n \"threshold\"\n ]\n },\n {\n \"slug\": \"use-queue\",\n \"name\": \"useQueue\",\n \"description\": \"FIFO queue state with add, remove, clear, and first/last/size.\",\n \"category\": \"state\",\n \"signature\": \"useQueue<T>(initial?: T[]): UseQueueReturn<T>\",\n \"parameters\": [\n {\n \"name\": \"initial\",\n \"type\": \"T[]\",\n \"defaultValue\": \"[]\",\n \"description\": \"Initial items for the queue.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"queueReturn\",\n \"type\": \"UseQueueReturn<T>\",\n \"description\": \"Object containing queue state and actions (queue, add, remove, clear, first, last, size).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseQueueReturn<T>\",\n \"description\": \"Object returned by useQueue containing queue state and actions.\",\n \"rows\": [\n {\n \"name\": \"queue\",\n \"type\": \"T[]\",\n \"defaultValue\": null,\n \"description\": \"The current queue array, oldest item first.\"\n },\n {\n \"name\": \"add\",\n \"type\": \"(item: T) => void\",\n \"defaultValue\": null,\n \"description\": \"Enqueues an item at the end of the queue.\"\n },\n {\n \"name\": \"remove\",\n \"type\": \"() => T | undefined\",\n \"defaultValue\": null,\n \"description\": \"Dequeues the oldest item and returns it (or undefined if empty).\"\n },\n {\n \"name\": \"clear\",\n \"type\": \"() => void\",\n \"defaultValue\": null,\n \"description\": \"Empties the queue.\"\n },\n {\n \"name\": \"first\",\n \"type\": \"T | undefined\",\n \"defaultValue\": null,\n \"description\": \"The oldest item at the front of the queue.\"\n },\n {\n \"name\": \"last\",\n \"type\": \"T | undefined\",\n \"defaultValue\": null,\n \"description\": \"The newest item at the back of the queue.\"\n },\n {\n \"name\": \"size\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"The number of items currently in the queue.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { queue, add, remove, clear, first, last, size } = useQueue<string>([\\\"first\\\", \\\"second\\\"]);\\n\\n return (\\n <div>\\n <p>Queue: {queue.join(\\\" -> \\\")}</p>\\n <p>Head: {first ?? \\\"(none)\\\"} | Size: {size}</p>\\n <button onClick={() => add(\\\"new-task\\\")}>Enqueue</button>\\n <button onClick={() => remove()}>Dequeue</button>\\n <button onClick={clear}>Clear</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useRef, useState } from \\\"react\\\";\\n\\n/** The value returned by {@link useQueue}. */\\nexport interface UseQueueReturn<T> {\\n /** The current queue, oldest item first. */\\n queue: T[];\\n /** Enqueue an item at the end. */\\n add: (item: T) => void;\\n /** Dequeue the oldest item and return it (`undefined` if empty). */\\n remove: () => T | undefined;\\n /** Empty the queue. */\\n clear: () => void;\\n /** The oldest item (next to be removed), or `undefined`. */\\n first: T | undefined;\\n /** The newest item, or `undefined`. */\\n last: T | undefined;\\n /** Number of items in the queue. */\\n size: number;\\n}\\n\\n/**\\n * Manages a FIFO queue with `add` (enqueue) and `remove` (dequeue) helpers.\\n * `remove` returns the item it removed. Every mutation produces a new array.\\n *\\n * @param initial - Initial items. Defaults to `[]`.\\n * @returns `{ queue, add, remove, clear, first, last, size }`.\\n */\\nexport const useQueue = <T>(initial: T[] = []): UseQueueReturn<T> => {\\n const [queue, setQueue] = useState<T[]>(initial);\\n const latest = useRef(queue);\\n latest.current = queue;\\n\\n const add = useCallback((item: T) => setQueue((q) => [...q, item]), []);\\n const remove = useCallback((): T | undefined => {\\n const removed = latest.current[0];\\n setQueue((q) => q.slice(1));\\n return removed;\\n }, []);\\n const clear = useCallback(() => setQueue([]), []);\\n\\n return {\\n queue,\\n add,\\n remove,\\n clear,\\n first: queue[0],\\n last: queue[queue.length - 1],\\n size: queue.length,\\n };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-queue/use-queue.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-queue\",\n \"useCases\": [\n \"state\",\n \"use-queue\",\n \"usequeue\",\n \"fifo\",\n \"queue\",\n \"with\",\n \"remove\",\n \"clear\",\n \"first\",\n \"last\",\n \"size\"\n ]\n },\n {\n \"slug\": \"use-default-value\",\n \"name\": \"useDefaultValue\",\n \"description\": \"Like useState, but falls back to a default when the value is nullish.\",\n \"category\": \"state\",\n \"signature\": \"useDefaultValue<T>(initialValue: T | null | undefined, defaultValue: T): [T, (value: T | null | undefined) => void]\",\n \"parameters\": [\n {\n \"name\": \"initialValue\",\n \"type\": \"T | null | undefined\",\n \"defaultValue\": null,\n \"description\": \"The initial value. If nullish, the defaultValue is returned.\"\n },\n {\n \"name\": \"defaultValue\",\n \"type\": \"T\",\n \"defaultValue\": null,\n \"description\": \"The value returned when the initial value is nullish.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] value\",\n \"type\": \"T\",\n \"description\": \"The current value.\"\n },\n {\n \"name\": \"[1] setValue\",\n \"type\": \"(value: T | null | undefined) => void\",\n \"description\": \"Sets the value.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [value, setValue] = useDefaultValue<string>(null, \\\"default\\\");\\n\\n return (\\n <div>\\n <p>{value}</p>\\n <button onClick={() => setValue(\\\"new value\\\")}>Set new value</button>\\n <button onClick={() => setValue(undefined)}>Set undefined</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useState } from \\\"react\\\";\\n\\n/**\\n * Like `useState`, but reads back the `defaultValue` whenever the state is\\n * `null` or `undefined`. The setter still accepts `null`/`undefined` — the\\n * fallback is applied only on read.\\n *\\n * @param initialValue - The initial value.\\n * @param defaultValue - The value returned whenever the state is nullish.\\n * @returns A `[value, setValue]` tuple.\\n */\\nexport const useDefaultValue = <T>(initialValue: T | null | undefined, defaultValue: T): [T, (value: T | null | undefined) => void] => {\\n const [value, setValue] = useState<T | null | undefined>(initialValue);\\n return [value === null || value === undefined ? defaultValue : value, setValue];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-default-value/use-default-value.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-default-value\",\n \"useCases\": [\n \"state\",\n \"use-default-value\",\n \"usedefaultvalue\",\n \"like\",\n \"usestate\",\n \"falls\",\n \"back\",\n \"default\",\n \"when\",\n \"value\",\n \"nullish\"\n ]\n },\n {\n \"slug\": \"use-raf-state\",\n \"name\": \"useRafState\",\n \"description\": \"useState whose updates are batched to the next animation frame.\",\n \"category\": \"state\",\n \"signature\": \"useRafState<T>(initialState: T | (() => T)): [T, Dispatch<SetStateAction<T>>]\",\n \"parameters\": [\n {\n \"name\": \"initialState\",\n \"type\": \"T | (() => T)\",\n \"defaultValue\": null,\n \"description\": \"The initial state or lazy initializer function.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"[0] state\",\n \"type\": \"T\",\n \"description\": \"The current state value.\"\n },\n {\n \"name\": \"[1] setState\",\n \"type\": \"Dispatch<SetStateAction<T>>\",\n \"description\": \"State setter whose updates are batched to requestAnimationFrame.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [pos, setPos] = useRafState({ x: 0, y: 0 });\\n\\n return (\\n <div\\n onPointerMove={(e) => {\\n setPos({ x: e.clientX, y: e.clientY });\\n }}\\n >\\n <p>Position: {pos.x}, {pos.y}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useRef, useState, type Dispatch, type SetStateAction } from \\\"react\\\";\\n\\n/**\\n * A `useState` whose updates are batched to the next animation frame. Useful for\\n * high-frequency values (scroll, pointer, resize) so React re-renders at most\\n * once per frame. Any pending frame is cancelled on unmount.\\n *\\n * @param initialState - Initial state, or a lazy initializer.\\n * @returns A `[state, setState]` tuple, same shape as `useState`.\\n */\\nexport const useRafState = <T>(\\n initialState: T | (() => T),\\n): [T, Dispatch<SetStateAction<T>>] => {\\n const [state, setState] = useState<T>(initialState);\\n const frame = useRef<number | null>(null);\\n\\n const setRafState = useCallback((value: SetStateAction<T>) => {\\n if (frame.current !== null) cancelAnimationFrame(frame.current);\\n frame.current = requestAnimationFrame(() => {\\n frame.current = null;\\n setState(value);\\n });\\n }, []);\\n\\n useEffect(\\n () => () => {\\n if (frame.current !== null) cancelAnimationFrame(frame.current);\\n },\\n [],\\n );\\n\\n return [state, setRafState];\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-raf-state/use-raf-state.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-raf-state\",\n \"useCases\": [\n \"state\",\n \"use-raf-state\",\n \"userafstate\",\n \"usestate\",\n \"whose\",\n \"updates\",\n \"batched\",\n \"next\",\n \"animation\",\n \"frame\"\n ]\n },\n {\n \"slug\": \"use-deep-compare-effect\",\n \"name\": \"useDeepCompareEffect\",\n \"description\": \"useEffect that compares dependencies by deep structural equality.\",\n \"category\": \"effects\",\n \"signature\": \"useDeepCompareEffect(effect: EffectCallback, deps: DependencyList): void\",\n \"parameters\": [\n {\n \"name\": \"effect\",\n \"type\": \"EffectCallback\",\n \"defaultValue\": null,\n \"description\": \"Effect callback executed when deep structural dependencies change.\"\n },\n {\n \"name\": \"deps\",\n \"type\": \"DependencyList\",\n \"defaultValue\": null,\n \"description\": \"Dependencies compared via deep structural equality instead of reference.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"void\",\n \"type\": \"void\",\n \"description\": \"Returns nothing.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const [user, setUser] = useState({ name: \\\"Alice\\\", age: 25 });\\n\\n useDeepCompareEffect(() => {\\n console.log(\\\"Deep effect triggered:\\\", user);\\n }, [user]);\\n\\n return (\\n <div>\\n <p>{user.name} ({user.age})</p>\\n <button onClick={() => setUser({ ...user })}>Recreate object reference</button>\\n <button onClick={() => setUser({ ...user, age: user.age + 1 })}>Increment age</button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useRef, type DependencyList, type EffectCallback } from \\\"react\\\";\\n\\n/** Minimal structural deep-equality for dependency lists (no external deps). */\\nconst deepEqual = (a: unknown, b: unknown): boolean => {\\n if (Object.is(a, b)) return true;\\n if (typeof a !== \\\"object\\\" || typeof b !== \\\"object\\\" || a === null || b === null) {\\n return false;\\n }\\n const aKeys = Object.keys(a as object);\\n const bKeys = Object.keys(b as object);\\n if (aKeys.length !== bKeys.length) return false;\\n return aKeys.every(\\n (key) =>\\n Object.prototype.hasOwnProperty.call(b, key) &&\\n deepEqual(\\n (a as Record<string, unknown>)[key],\\n (b as Record<string, unknown>)[key],\\n ),\\n );\\n};\\n\\n/**\\n * A `useEffect` that compares its dependencies by **deep** structural equality\\n * instead of reference. Use it when deps are objects/arrays recreated on every\\n * render (so a normal `useEffect` would fire every time).\\n *\\n * @param effect - Imperative effect callback; may return a cleanup function.\\n * @param deps - Dependency list, compared deeply.\\n */\\nexport const useDeepCompareEffect = (\\n effect: EffectCallback,\\n deps: DependencyList,\\n): void => {\\n const ref = useRef<DependencyList | undefined>(undefined);\\n const signal = useRef<number>(0);\\n\\n if (ref.current === undefined || !deepEqual(deps, ref.current)) {\\n ref.current = deps;\\n signal.current += 1;\\n }\\n\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n useEffect(effect, [signal.current]);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-deep-compare-effect/use-deep-compare-effect.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-deep-compare-effect\",\n \"useCases\": [\n \"effects\",\n \"use-deep-compare-effect\",\n \"usedeepcompareeffect\",\n \"useeffect\",\n \"that\",\n \"compares\",\n \"dependencies\",\n \"deep\",\n \"structural\",\n \"equality\"\n ]\n },\n {\n \"slug\": \"use-text-selection\",\n \"name\": \"useTextSelection\",\n \"description\": \"Track the text the user has currently selected on the page.\",\n \"category\": \"dom\",\n \"signature\": \"useTextSelection(): string\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"text\",\n \"type\": \"string\",\n \"description\": \"The currently selected text on the document.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const selection = useTextSelection();\\n\\n return (\\n <div>\\n <p>Select text on this page.</p>\\n <p>Selected: {selection || \\\"(none)\\\"}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * Tracks the text the user has currently selected on the page\\n * (`window.getSelection()`), updating on every `selectionchange`. The listener\\n * attaches in an effect, so it is SSR-safe (returns `\\\"\\\"` on the server).\\n *\\n * @returns The selected text, or `\\\"\\\"` when nothing is selected.\\n */\\nexport const useTextSelection = (): string => {\\n const [text, setText] = useState<string>(\\\"\\\");\\n\\n useEffect(() => {\\n const update = () => setText(window.getSelection()?.toString() ?? \\\"\\\");\\n update();\\n document.addEventListener(\\\"selectionchange\\\", update);\\n return () => document.removeEventListener(\\\"selectionchange\\\", update);\\n }, []);\\n\\n return text;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-text-selection/use-text-selection.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-text-selection\",\n \"useCases\": [\n \"dom\",\n \"use-text-selection\",\n \"usetextselection\",\n \"track\",\n \"text\",\n \"user\",\n \"currently\",\n \"selected\",\n \"page\"\n ]\n },\n {\n \"slug\": \"use-long-press\",\n \"name\": \"useLongPress\",\n \"description\": \"Detect a long press (mouse or touch) via spreadable handlers.\",\n \"category\": \"dom\",\n \"signature\": \"useLongPress(callback: (event: MouseEvent | TouchEvent) => void, options?: UseLongPressOptions): UseLongPressHandlers\",\n \"parameters\": [\n {\n \"name\": \"callback\",\n \"type\": \"(event: MouseEvent | TouchEvent) => void\",\n \"defaultValue\": null,\n \"description\": \"Callback invoked once the press is held for delay ms.\"\n },\n {\n \"name\": \"options\",\n \"type\": \"UseLongPressOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Options object containing delay (defaults to 400ms).\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"handlers\",\n \"type\": \"UseLongPressHandlers\",\n \"description\": \"Event handlers (onMouseDown, onMouseUp, etc.) to spread onto the target element.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const handlers = useLongPress(() => {\\n alert(\\\"Long pressed!\\\");\\n }, { delay: 500 });\\n\\n return <button {...handlers}>Press and hold</button>;\\n}\",\n \"source\": \"import { useCallback, useRef, type MouseEvent, type TouchEvent } from \\\"react\\\";\\n\\n/** Options for {@link useLongPress}. */\\nexport interface UseLongPressOptions {\\n /** How long the press must be held before firing, in ms. Defaults to `400`. */\\n delay?: number;\\n}\\n\\n/** Handlers returned by {@link useLongPress}, spread onto the target element. */\\nexport interface UseLongPressHandlers {\\n onMouseDown: (event: MouseEvent) => void;\\n onMouseUp: () => void;\\n onMouseLeave: () => void;\\n onTouchStart: (event: TouchEvent) => void;\\n onTouchEnd: () => void;\\n}\\n\\n/**\\n * Detects a long press (mouse or touch). Spread the returned handlers onto an\\n * element; `callback` fires once the press is held for `delay` ms, and is\\n * cancelled if the pointer is released or leaves first.\\n *\\n * @param callback - Called with the originating event once the press is held.\\n * @param options - `{ delay }`.\\n * @returns Event handlers to spread onto the target element.\\n */\\nexport const useLongPress = (\\n callback: (event: MouseEvent | TouchEvent) => void,\\n options: UseLongPressOptions = {},\\n): UseLongPressHandlers => {\\n const { delay = 400 } = options;\\n const timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\\n const callbackRef = useRef(callback);\\n callbackRef.current = callback;\\n\\n const start = useCallback(\\n (event: MouseEvent | TouchEvent) => {\\n timeout.current = setTimeout(() => callbackRef.current(event), delay);\\n },\\n [delay],\\n );\\n\\n const cancel = useCallback(() => {\\n if (timeout.current) {\\n clearTimeout(timeout.current);\\n timeout.current = null;\\n }\\n }, []);\\n\\n return {\\n onMouseDown: start,\\n onMouseUp: cancel,\\n onMouseLeave: cancel,\\n onTouchStart: start,\\n onTouchEnd: cancel,\\n };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-long-press/use-long-press.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-long-press\",\n \"useCases\": [\n \"dom\",\n \"use-long-press\",\n \"uselongpress\",\n \"detect\",\n \"long\",\n \"press\",\n \"mouse\",\n \"touch\",\n \"spreadable\",\n \"handlers\"\n ]\n },\n {\n \"slug\": \"use-draggable\",\n \"name\": \"useDraggable\",\n \"description\": \"Drag an element with pointer or keyboard: bounds, grid, axis lock, smoothing, and jump-to-click.\",\n \"category\": \"dom\",\n \"signature\": \"useDraggable<T extends HTMLElement, C extends HTMLElement>(options?: UseDraggableOptions): UseDraggableReturn<T, C>\",\n \"parameters\": [\n {\n \"name\": \"options\",\n \"type\": \"UseDraggableOptions\",\n \"defaultValue\": \"{}\",\n \"description\": \"Every option is optional. See the UseDraggableOptions table below.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"ref\",\n \"type\": \"(node: T | null) => void\",\n \"description\": \"Callback ref for the draggable element. The hook moves it with transform: translate3d(), so layout is untouched.\"\n },\n {\n \"name\": \"containerRef\",\n \"type\": \"(node: C | null) => void\",\n \"description\": \"Callback ref for the canvas that jumpOnClick listens on.\"\n },\n {\n \"name\": \"position\",\n \"type\": \"Position\",\n \"description\": \"The current position in unit. In controlled mode it is the position prop.\"\n },\n {\n \"name\": \"isDragging\",\n \"type\": \"boolean\",\n \"description\": \"true while a pointer drag is in progress.\"\n },\n {\n \"name\": \"moveTo\",\n \"type\": \"(position: Position, options?: { animate?: boolean }) => void\",\n \"description\": \"Move programmatically. Bounds and grid still apply; in controlled mode it calls onChange instead.\"\n },\n {\n \"name\": \"reset\",\n \"type\": \"() => void\",\n \"description\": \"Move back to initialPosition.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseDraggableOptions\",\n \"description\": \"Pass position + onChange for controlled use, or initialPosition for uncontrolled.\",\n \"rows\": [\n {\n \"name\": \"unit\",\n \"type\": \"\\\"px\\\" | \\\"ratio\\\"\",\n \"defaultValue\": \"\\\"px\\\"\",\n \"description\": \"px: translate offset from the layout spot. ratio: where the anchor point sits in the bounds box, 0..1 per axis, so it survives resizes. Needs element bounds.\"\n },\n {\n \"name\": \"position\",\n \"type\": \"Position\",\n \"defaultValue\": null,\n \"description\": \"Controlled position. Input calls onChange; the element moves only when this prop changes.\"\n },\n {\n \"name\": \"initialPosition\",\n \"type\": \"Position\",\n \"defaultValue\": \"{ x: 0, y: 0 }\",\n \"description\": \"Uncontrolled starting position.\"\n },\n {\n \"name\": \"onChange\",\n \"type\": \"(position: Position) => void\",\n \"defaultValue\": null,\n \"description\": \"Called when a drag, jump, arrow key or moveTo produces a new position. Not called for prop changes or resize re-clamps.\"\n },\n {\n \"name\": \"bounds\",\n \"type\": \"\\\"parent\\\" | RefObject<HTMLElement> | { left?, top?, right?, bottom? }\",\n \"defaultValue\": null,\n \"description\": \"Keep the element inside a box. Element bounds are live: re-measured on every gesture and on resize.\"\n },\n {\n \"name\": \"axis\",\n \"type\": \"\\\"x\\\" | \\\"y\\\" | \\\"both\\\"\",\n \"defaultValue\": \"\\\"both\\\"\",\n \"description\": \"Restrict movement to one axis.\"\n },\n {\n \"name\": \"grid\",\n \"type\": \"[number, number]\",\n \"defaultValue\": null,\n \"description\": \"Snap the translate offset to a px grid.\"\n },\n {\n \"name\": \"jumpOnClick\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Pressing an empty spot of the container jumps the element there; holding keeps dragging.\"\n },\n {\n \"name\": \"anchor\",\n \"type\": \"\\\"center\\\" | \\\"top-left\\\"\",\n \"defaultValue\": \"\\\"center\\\"\",\n \"description\": \"The element point that lands on the pointer when jumping, and that a ratio position describes.\"\n },\n {\n \"name\": \"transition\",\n \"type\": \"number\",\n \"defaultValue\": \"200\",\n \"description\": \"Jump animation length in ms; 0 snaps instantly.\"\n },\n {\n \"name\": \"smoothing\",\n \"type\": \"number\",\n \"defaultValue\": \"0.3\",\n \"description\": \"How softly the element trails the pointer, from 0 (glued) to just under 1 (floaty). Reduced motion turns it off.\"\n },\n {\n \"name\": \"keyboardStep\",\n \"type\": \"number | false\",\n \"defaultValue\": \"10\",\n \"description\": \"Arrow-key step in px when the element is focused; the grid step wins when grid is set.\"\n },\n {\n \"name\": \"disabled\",\n \"type\": \"boolean\",\n \"defaultValue\": \"false\",\n \"description\": \"Ignore pointer and keyboard input. moveTo still works.\"\n },\n {\n \"name\": \"onDragStart / onDrag / onDragEnd / onJump\",\n \"type\": \"(position: Position) => void\",\n \"defaultValue\": null,\n \"description\": \"Gesture callbacks, in unit. onDragEnd also fires after each keyboard move.\"\n }\n ]\n },\n {\n \"name\": \"Position\",\n \"description\": \"A point in the chosen unit.\",\n \"rows\": [\n {\n \"name\": \"x\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Horizontal: px offset, or 0..1 of the bounds box width.\"\n },\n {\n \"name\": \"y\",\n \"type\": \"number\",\n \"defaultValue\": null,\n \"description\": \"Vertical: px offset, or 0..1 of the bounds box height.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { ref, containerRef, position, isDragging } = useDraggable<\\n HTMLDivElement,\\n HTMLDivElement\\n >({\\n unit: \\\"ratio\\\",\\n bounds: \\\"parent\\\",\\n initialPosition: { x: 0.5, y: 0.5 },\\n jumpOnClick: true,\\n });\\n\\n return (\\n <div ref={containerRef} style={{ position: \\\"relative\\\", height: 224 }}>\\n <div\\n ref={ref}\\n tabIndex={0}\\n aria-label=\\\"Draggable puck\\\"\\n style={{ position: \\\"absolute\\\", top: 0, left: 0, width: 44, height: 44 }}\\n >\\n {isDragging ? \\\"●\\\" : \\\"○\\\"}\\n </div>\\n <p>\\n {(position.x * 100).toFixed(1)}% × {(position.y * 100).toFixed(1)}%\\n </p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useRef, useState, type RefObject } from \\\"react\\\";\\nimport { useIsomorphicLayoutEffect } from \\\"../use-isomorphic-layout-effect\\\";\\n\\n/** A point: translate px, or a `0..1` ratio of the bounds box when `unit` is `\\\"ratio\\\"`. */\\nexport interface Position {\\n x: number;\\n y: number;\\n}\\n\\n/**\\n * Where a draggable element may go: `\\\"parent\\\"` (its parent's inner box), a ref\\n * to any element's inner box, or explicit limits in translate px.\\n */\\nexport type DragBounds =\\n | \\\"parent\\\"\\n | RefObject<HTMLElement | null>\\n | { left?: number; top?: number; right?: number; bottom?: number };\\n\\n/** Options for {@link useDraggable}. */\\nexport interface UseDraggableOptions {\\n /**\\n * How positions are expressed. `\\\"px\\\"` is the translate offset from the element's\\n * layout spot. `\\\"ratio\\\"` is where the element's `anchor` point sits inside the\\n * bounds box, `0..1` on each axis, so it survives the box resizing. `\\\"ratio\\\"`\\n * needs element bounds (`\\\"parent\\\"` or a ref). Defaults to `\\\"px\\\"`.\\n */\\n unit?: \\\"px\\\" | \\\"ratio\\\";\\n /** Controlled position. When set, the element only moves when this prop changes; pair it with `onChange`. */\\n position?: Position;\\n /** Uncontrolled starting position. Defaults to `{ x: 0, y: 0 }`. */\\n initialPosition?: Position;\\n /** Called whenever input (drag, jump, keys, `moveTo`) produces a new position. */\\n onChange?: (position: Position) => void;\\n /** Restrict movement to one axis. Defaults to `\\\"both\\\"`. */\\n axis?: \\\"x\\\" | \\\"y\\\" | \\\"both\\\";\\n /**\\n * Keep the element inside a box. Element bounds are live: they are re-measured\\n * on every gesture and whenever the element or the box resizes. Unbounded by default.\\n */\\n bounds?: DragBounds;\\n /** Snap the translate offset to a `[x, y]` px grid. */\\n grid?: [number, number];\\n /** Ignore pointer and keyboard input (`moveTo` still works). Defaults to `false`. */\\n disabled?: boolean;\\n /**\\n * Pressing an empty spot of the `containerRef` element makes the element jump\\n * there, and holding the button keeps dragging. Defaults to `false`.\\n */\\n jumpOnClick?: boolean;\\n /**\\n * The element's reference point: what lands on the pointer when jumping, and\\n * what a `\\\"ratio\\\"` position describes. Defaults to `\\\"center\\\"`.\\n */\\n anchor?: \\\"center\\\" | \\\"top-left\\\";\\n /** Jump animation length in ms; `0` snaps instantly. Defaults to `200`. */\\n transition?: number;\\n /**\\n * How softly the element trails the pointer while dragging, from `0` (glued to\\n * the pointer) to just under `1` (very floaty). Defaults to `0.3`.\\n */\\n smoothing?: number;\\n /** Arrow-key step in px (the grid step wins when `grid` is set); `false` disables. Defaults to `10`. */\\n keyboardStep?: number | false;\\n /** Called when a drag starts (including the drag that follows a jump). */\\n onDragStart?: (position: Position) => void;\\n /** Called on every drag move with the new position. */\\n onDrag?: (position: Position) => void;\\n /** Called when a drag ends, and after each keyboard move. */\\n onDragEnd?: (position: Position) => void;\\n /** Called when a click on the container makes the element jump. */\\n onJump?: (position: Position) => void;\\n}\\n\\n/** Options for {@link UseDraggableReturn.moveTo}. */\\nexport interface MoveToOptions {\\n /** Animate with the `transition` duration instead of snapping. Defaults to `false`. */\\n animate?: boolean;\\n}\\n\\n/** Return value of {@link useDraggable}. */\\nexport interface UseDraggableReturn<T extends HTMLElement, C extends HTMLElement> {\\n /** Callback ref for the draggable element. */\\n ref: (node: T | null) => void;\\n /** Callback ref for the canvas that `jumpOnClick` listens on. */\\n containerRef: (node: C | null) => void;\\n /** The current position, in `unit`s (the controlled `position` when one is passed). */\\n position: Position;\\n /** `true` while a pointer drag is in progress. */\\n isDragging: boolean;\\n /** Move the element programmatically, in `unit`s (bounds and grid still apply). */\\n moveTo: (position: Position, options?: MoveToOptions) => void;\\n /** Move the element back to `initialPosition`. */\\n reset: () => void;\\n}\\n\\ntype Motion = \\\"tween\\\" | \\\"follow\\\" | \\\"none\\\";\\n\\ninterface Limits {\\n minX: number;\\n maxX: number;\\n minY: number;\\n maxY: number;\\n}\\n\\ninterface Box {\\n left: number;\\n top: number;\\n width: number;\\n height: number;\\n}\\n\\ninterface Geometry {\\n /** The element's layout spot in the viewport (its rect minus the offset on screen). */\\n origin: Position;\\n width: number;\\n height: number;\\n /** The bounds element's inner box, when bounds are an element. */\\n box: Box | null;\\n limits: Limits | null;\\n}\\n\\ninterface DragSession {\\n pointerId: number;\\n start: Position;\\n startPointer: Position;\\n geometry: Geometry;\\n last: Position;\\n}\\n\\nconst ORIGIN: Position = { x: 0, y: 0 };\\nconst FRAME_MS = 1000 / 60;\\nconst ARROWS: Record<string, Position> = {\\n ArrowLeft: { x: -1, y: 0 },\\n ArrowRight: { x: 1, y: 0 },\\n ArrowUp: { x: 0, y: -1 },\\n ArrowDown: { x: 0, y: 1 },\\n};\\n\\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\\nconst snap = (value: number, step: number) => (step > 0 ? Math.round(value / step) * step : value);\\nconst same = (a: Position, b: Position) => a.x === b.x && a.y === b.y;\\nconst near = (a: Position, b: Position) => Math.abs(a.x - b.x) < 1e-9 && Math.abs(a.y - b.y) < 1e-9;\\nconst easeOutCubic = (t: number) => 1 - Math.pow(1 - t, 3);\\nconst isPrimary = (event: PointerEvent) => event.button === 0 && event.isPrimary !== false;\\nconst prefersReducedMotion = () =>\\n typeof window !== \\\"undefined\\\" &&\\n typeof window.matchMedia === \\\"function\\\" &&\\n window.matchMedia(\\\"(prefers-reduced-motion: reduce)\\\").matches;\\nconst canAnimate = () => typeof requestAnimationFrame === \\\"function\\\" && !prefersReducedMotion();\\nconst paint = (element: HTMLElement, { x, y }: Position) => {\\n element.style.transform = `translate3d(${x}px, ${y}px, 0)`;\\n};\\n// Limits written directly in translate px need no DOM read, so they can be re-read on every move.\\nconst explicitLimits = (bounds: DragBounds | undefined): Limits | null =>\\n bounds && bounds !== \\\"parent\\\" && !(\\\"current\\\" in bounds)\\n ? {\\n minX: bounds.left ?? -Infinity,\\n maxX: bounds.right ?? Infinity,\\n minY: bounds.top ?? -Infinity,\\n maxY: bounds.bottom ?? Infinity,\\n }\\n : null;\\nconst boundsElement = (element: HTMLElement, bounds: DragBounds | undefined) =>\\n bounds === \\\"parent\\\" ? element.parentElement : bounds && \\\"current\\\" in bounds ? bounds.current : null;\\n\\n/**\\n * Makes an element draggable with pointer events (mouse, touch and pen), with\\n * optional axis lock, live bounds, grid snapping, arrow-key moves and smoothing.\\n * With `jumpOnClick`, pressing an empty spot of the container makes the element\\n * jump there (animated), and holding the button keeps dragging, like a slider.\\n *\\n * Works controlled (`position` + `onChange`) or uncontrolled (`initialPosition`),\\n * in translate px or as a `0..1` ratio of the bounds box (`unit: \\\"ratio\\\"`).\\n * The element is moved with `transform: translate3d()`, so layout is untouched.\\n * Give it `tabIndex={0}` and an `aria-label` for keyboard use.\\n *\\n * @param options - See {@link UseDraggableOptions}.\\n * @returns Refs to attach, the current `position`, `isDragging`, `moveTo` and `reset`.\\n */\\nexport const useDraggable = <\\n T extends HTMLElement = HTMLElement,\\n C extends HTMLElement = HTMLElement,\\n>(\\n options: UseDraggableOptions = {},\\n): UseDraggableReturn<T, C> => {\\n const optionsRef = useRef(options);\\n optionsRef.current = options;\\n const initialRef = useRef(options.initialPosition ?? ORIGIN);\\n const { jumpOnClick = false, position: controlled } = options;\\n\\n const [element, setElement] = useState<T | null>(null);\\n const [container, setContainer] = useState<C | null>(null);\\n const [uncontrolled, setUncontrolled] = useState<Position>(initialRef.current);\\n const [isDragging, setIsDragging] = useState(false);\\n const position = controlled ?? uncontrolled;\\n\\n const elementRef = useRef<T | null>(null);\\n elementRef.current = element;\\n const positionRef = useRef(position); // public position, in `unit`s\\n positionRef.current = position;\\n const targetRef = useRef<Position>(ORIGIN); // translate px the element is heading to\\n const renderedRef = useRef<Position>(ORIGIN); // translate px on screen right now\\n const pendingRef = useRef<{ position: Position; motion: Motion } | null>(null);\\n const sessionRef = useRef<DragSession | null>(null);\\n const tweenRef = useRef<{ from: Position; start: number | null } | null>(null);\\n const frameRef = useRef<number | null>(null);\\n const lastFrameRef = useRef<number | null>(null);\\n\\n const stopFrame = useCallback(() => {\\n if (frameRef.current !== null) cancelAnimationFrame(frameRef.current);\\n frameRef.current = null;\\n lastFrameRef.current = null;\\n }, []);\\n\\n // One rAF loop drives both the jump tween and the drag smoothing.\\n const step = useCallback((time: number) => {\\n frameRef.current = null;\\n const node = elementRef.current;\\n if (!node) return;\\n const target = targetRef.current;\\n const from = renderedRef.current;\\n const last = lastFrameRef.current ?? time - FRAME_MS;\\n lastFrameRef.current = time;\\n\\n let next: Position;\\n const tween = tweenRef.current;\\n if (tween) {\\n if (tween.start === null) tween.start = time;\\n const duration = optionsRef.current.transition ?? 200;\\n const t = duration > 0 ? Math.min(1, (time - tween.start) / duration) : 1;\\n const eased = easeOutCubic(t);\\n next = {\\n x: tween.from.x + (target.x - tween.from.x) * eased,\\n y: tween.from.y + (target.y - tween.from.y) * eased,\\n };\\n if (t >= 1) tweenRef.current = null;\\n } else {\\n const smoothing = clamp(optionsRef.current.smoothing ?? 0.3, 0, 0.99);\\n const k = 1 - Math.pow(smoothing, (time - last) / FRAME_MS);\\n next = { x: from.x + (target.x - from.x) * k, y: from.y + (target.y - from.y) * k };\\n if (Math.abs(target.x - next.x) < 0.1 && Math.abs(target.y - next.y) < 0.1) next = target;\\n }\\n\\n renderedRef.current = next;\\n paint(node, next);\\n if (next === target && !tweenRef.current) lastFrameRef.current = null;\\n else frameRef.current = requestAnimationFrame(step);\\n }, []);\\n\\n // Point the element at a translate offset, animated or not. Never touches React state.\\n const commit = useCallback(\\n (next: Position, motion: Motion) => {\\n targetRef.current = next;\\n const node = elementRef.current;\\n if (!node) {\\n renderedRef.current = next;\\n return;\\n }\\n const { transition = 200, smoothing = 0.3 } = optionsRef.current;\\n const animate =\\n canAnimate() &&\\n ((motion === \\\"tween\\\" && transition > 0) ||\\n (motion === \\\"follow\\\" && (smoothing > 0 || tweenRef.current !== null)));\\n if (!animate) {\\n stopFrame();\\n tweenRef.current = null;\\n renderedRef.current = next;\\n paint(node, next);\\n return;\\n }\\n if (motion === \\\"tween\\\") tweenRef.current = { from: renderedRef.current, start: null };\\n if (frameRef.current === null) frameRef.current = requestAnimationFrame(step);\\n },\\n [step, stopFrame],\\n );\\n\\n const measure = (): Geometry | null => {\\n const node = elementRef.current;\\n if (!node) return null;\\n const rect = node.getBoundingClientRect();\\n const origin = { x: rect.left - renderedRef.current.x, y: rect.top - renderedRef.current.y };\\n const { bounds } = optionsRef.current;\\n const geometry: Geometry = { origin, width: rect.width, height: rect.height, box: null, limits: null };\\n const explicit = explicitLimits(bounds);\\n if (explicit) {\\n geometry.limits = explicit;\\n return geometry;\\n }\\n const boxElement = boundsElement(node, bounds);\\n if (!boxElement) return geometry;\\n const boxRect = boxElement.getBoundingClientRect();\\n const box = {\\n left: boxRect.left + boxElement.clientLeft,\\n top: boxRect.top + boxElement.clientTop,\\n width: boxElement.clientWidth || boxRect.width,\\n height: boxElement.clientHeight || boxRect.height,\\n };\\n const minX = box.left - origin.x;\\n const minY = box.top - origin.y;\\n geometry.box = box;\\n geometry.limits = {\\n minX,\\n maxX: Math.max(minX, box.left + box.width - rect.width - origin.x),\\n minY,\\n maxY: Math.max(minY, box.top + box.height - rect.height - origin.y),\\n };\\n return geometry;\\n };\\n\\n const anchorOffset = (geometry: Geometry): Position =>\\n (optionsRef.current.anchor ?? \\\"center\\\") === \\\"center\\\"\\n ? { x: geometry.width / 2, y: geometry.height / 2 }\\n : ORIGIN;\\n\\n // translate px → public units\\n const toUnit = (px: Position, geometry: Geometry): Position => {\\n const { box } = geometry;\\n if (optionsRef.current.unit !== \\\"ratio\\\" || !box) return px;\\n const offset = anchorOffset(geometry);\\n return {\\n x: box.width ? (geometry.origin.x + px.x + offset.x - box.left) / box.width : 0,\\n y: box.height ? (geometry.origin.y + px.y + offset.y - box.top) / box.height : 0,\\n };\\n };\\n\\n // public units → translate px\\n const fromUnit = (value: Position, geometry: Geometry): Position => {\\n const { box } = geometry;\\n if (optionsRef.current.unit !== \\\"ratio\\\" || !box) return value;\\n const offset = anchorOffset(geometry);\\n return {\\n x: box.left + value.x * box.width - offset.x - geometry.origin.x,\\n y: box.top + value.y * box.height - offset.y - geometry.origin.y,\\n };\\n };\\n\\n const constrain = (raw: Position, limits: Limits | null): Position => {\\n const { grid } = optionsRef.current;\\n let { x, y } = raw;\\n if (grid) {\\n x = snap(x, grid[0]);\\n y = snap(y, grid[1]);\\n }\\n if (limits) {\\n x = clamp(x, limits.minX, limits.maxX);\\n y = clamp(y, limits.minY, limits.maxY);\\n }\\n return { x, y };\\n };\\n\\n // Input produced a new offset: move now (uncontrolled) or ask the owner (controlled).\\n const request = (next: Position, motion: Motion, geometry: Geometry): Position => {\\n const value = toUnit(next, geometry);\\n if (optionsRef.current.position !== undefined) {\\n pendingRef.current = { position: value, motion };\\n } else {\\n commit(next, motion);\\n setUncontrolled(value);\\n }\\n optionsRef.current.onChange?.(value);\\n return value;\\n };\\n\\n // Place the element at the public position, clamped to the current bounds. Runs on\\n // mount, on every controlled change, and when the element or the box resizes.\\n // A controlled change right after a request is the owner's answer to it, even when\\n // the owner rounded or converted the value, so it gets the requested motion.\\n const sync = useCallback((answer = false) => {\\n const geometry = measure();\\n if (!geometry) return;\\n const session = sessionRef.current;\\n if (session) session.geometry = geometry;\\n const pending = answer ? pendingRef.current : null;\\n if (answer) pendingRef.current = null;\\n const value = positionRef.current;\\n const motion = pending ? pending.motion : \\\"none\\\";\\n const next = constrain(fromUnit(value, geometry), geometry.limits);\\n if (!same(next, targetRef.current)) commit(next, motion);\\n // Uncontrolled values follow the clamp, like a range input whose max shrinks.\\n if (optionsRef.current.position === undefined) {\\n const clamped = toUnit(next, geometry);\\n if (!near(clamped, value)) setUncontrolled(clamped);\\n }\\n // measure/fromUnit/toUnit/constrain read only refs.\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n }, [commit]);\\n\\n const controlledX = controlled?.x;\\n const controlledY = controlled?.y;\\n useIsomorphicLayoutEffect(() => {\\n if (element && controlledX !== undefined) sync(true);\\n }, [element, controlledX, controlledY, sync]);\\n\\n // Paint before the first frame so the element never flashes at its layout spot.\\n useIsomorphicLayoutEffect(() => {\\n if (!element) return;\\n paint(element, renderedRef.current);\\n if (optionsRef.current.position === undefined) sync();\\n }, [element, sync]);\\n\\n // Live bounds: re-place the element when it or its bounds box resizes.\\n useEffect(() => {\\n if (!element || typeof ResizeObserver === \\\"undefined\\\") return;\\n const observer = new ResizeObserver(() => sync());\\n observer.observe(element);\\n const box = boundsElement(element, optionsRef.current.bounds);\\n if (box) observer.observe(box);\\n return () => observer.disconnect();\\n }, [element, sync]);\\n\\n useEffect(() => {\\n if (!element) return;\\n let previousUserSelect = \\\"\\\";\\n\\n const onMove = (event: PointerEvent) => {\\n const session = sessionRef.current;\\n if (!session || event.pointerId !== session.pointerId) return;\\n // No button held: it was released somewhere we never heard about.\\n if (event.buttons === 0) {\\n end();\\n return;\\n }\\n const { axis = \\\"both\\\", bounds } = optionsRef.current;\\n const { start, startPointer, geometry } = session;\\n const next = constrain(\\n {\\n x: axis === \\\"y\\\" ? start.x : start.x + event.clientX - startPointer.x,\\n y: axis === \\\"x\\\" ? start.y : start.y + event.clientY - startPointer.y,\\n },\\n explicitLimits(bounds) ?? geometry.limits,\\n );\\n if (same(next, session.last)) return;\\n session.last = next;\\n const value = request(next, \\\"follow\\\", geometry);\\n optionsRef.current.onDrag?.(value);\\n };\\n\\n const finish = () => {\\n const ended = sessionRef.current;\\n if (!ended) return null;\\n sessionRef.current = null;\\n window.removeEventListener(\\\"pointermove\\\", onMove);\\n window.removeEventListener(\\\"pointerup\\\", onEnd);\\n window.removeEventListener(\\\"pointercancel\\\", onEnd);\\n window.removeEventListener(\\\"blur\\\", end);\\n element.removeEventListener(\\\"lostpointercapture\\\", end);\\n if (element.hasPointerCapture?.(ended.pointerId)) element.releasePointerCapture(ended.pointerId);\\n document.body.style.userSelect = previousUserSelect;\\n setIsDragging(false);\\n return ended;\\n };\\n\\n const end = () => {\\n const ended = finish();\\n if (ended) optionsRef.current.onDragEnd?.(toUnit(ended.last, ended.geometry));\\n };\\n\\n const onEnd = (event: PointerEvent) => {\\n if (event.pointerId === sessionRef.current?.pointerId) end();\\n };\\n\\n const begin = (event: PointerEvent, start: Position, geometry: Geometry) => {\\n sessionRef.current = {\\n pointerId: event.pointerId,\\n start,\\n startPointer: { x: event.clientX, y: event.clientY },\\n geometry,\\n last: start,\\n };\\n previousUserSelect = document.body.style.userSelect;\\n document.body.style.userSelect = \\\"none\\\";\\n // Capture keeps pointerup coming even when it happens outside the window.\\n try {\\n element.setPointerCapture?.(event.pointerId);\\n } catch {\\n // Not an active pointer (synthetic event); the window listeners still work.\\n }\\n window.addEventListener(\\\"pointermove\\\", onMove);\\n window.addEventListener(\\\"pointerup\\\", onEnd);\\n window.addEventListener(\\\"pointercancel\\\", onEnd);\\n window.addEventListener(\\\"blur\\\", end);\\n element.addEventListener(\\\"lostpointercapture\\\", end);\\n setIsDragging(true);\\n optionsRef.current.onDragStart?.(toUnit(start, geometry));\\n };\\n\\n const onElementDown = (event: PointerEvent) => {\\n if (optionsRef.current.disabled || sessionRef.current || !isPrimary(event)) return;\\n const geometry = measure();\\n if (geometry) begin(event, targetRef.current, geometry);\\n };\\n\\n const onContainerDown = (event: PointerEvent) => {\\n if (optionsRef.current.disabled || sessionRef.current || !isPrimary(event)) return;\\n if (element.contains(event.target as Node)) return; // a normal drag, not a jump\\n const geometry = measure();\\n if (!geometry) return;\\n const { axis = \\\"both\\\" } = optionsRef.current;\\n const offset = anchorOffset(geometry);\\n const current = targetRef.current;\\n const next = constrain(\\n {\\n x: axis === \\\"y\\\" ? current.x : event.clientX - geometry.origin.x - offset.x,\\n y: axis === \\\"x\\\" ? current.y : event.clientY - geometry.origin.y - offset.y,\\n },\\n geometry.limits,\\n );\\n const value = request(next, \\\"tween\\\", geometry);\\n optionsRef.current.onJump?.(value);\\n begin(event, next, geometry);\\n };\\n\\n const onKeyDown = (event: KeyboardEvent) => {\\n const { disabled, keyboardStep = 10, grid, axis = \\\"both\\\" } = optionsRef.current;\\n const direction = ARROWS[event.key];\\n if (disabled || keyboardStep === false || !direction) return;\\n if ((axis === \\\"x\\\" && direction.y) || (axis === \\\"y\\\" && direction.x)) return;\\n const geometry = measure();\\n if (!geometry) return;\\n event.preventDefault();\\n const current = targetRef.current;\\n const next = constrain(\\n {\\n x: current.x + direction.x * (grid ? grid[0] : keyboardStep),\\n y: current.y + direction.y * (grid ? grid[1] : keyboardStep),\\n },\\n geometry.limits,\\n );\\n const value = request(next, \\\"follow\\\", geometry);\\n optionsRef.current.onDragEnd?.(value);\\n };\\n\\n const previousTouchAction = element.style.touchAction;\\n element.style.touchAction = \\\"none\\\";\\n element.addEventListener(\\\"pointerdown\\\", onElementDown);\\n element.addEventListener(\\\"keydown\\\", onKeyDown);\\n\\n const canvas = jumpOnClick ? container : null;\\n const previousCanvasTouchAction = canvas?.style.touchAction ?? \\\"\\\";\\n if (canvas) {\\n canvas.style.touchAction = \\\"none\\\";\\n canvas.addEventListener(\\\"pointerdown\\\", onContainerDown);\\n }\\n\\n return () => {\\n finish();\\n element.style.touchAction = previousTouchAction;\\n element.removeEventListener(\\\"pointerdown\\\", onElementDown);\\n element.removeEventListener(\\\"keydown\\\", onKeyDown);\\n if (canvas) {\\n canvas.style.touchAction = previousCanvasTouchAction;\\n canvas.removeEventListener(\\\"pointerdown\\\", onContainerDown);\\n }\\n };\\n // measure/constrain/request/toUnit read only refs, so they are safe to omit.\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n }, [element, container, jumpOnClick]);\\n\\n useEffect(() => stopFrame, [stopFrame]);\\n\\n const moveTo = useCallback((value: Position, moveOptions: MoveToOptions = {}) => {\\n const geometry = measure();\\n if (!geometry) {\\n if (optionsRef.current.position === undefined) setUncontrolled(value);\\n optionsRef.current.onChange?.(value);\\n return;\\n }\\n request(\\n constrain(fromUnit(value, geometry), geometry.limits),\\n moveOptions.animate ? \\\"tween\\\" : \\\"none\\\",\\n geometry,\\n );\\n // eslint-disable-next-line react-hooks/exhaustive-deps\\n }, []);\\n\\n const reset = useCallback(() => moveTo(initialRef.current), [moveTo]);\\n\\n return { ref: setElement, containerRef: setContainer, position, isDragging, moveTo, reset };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-draggable/use-draggable.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-draggable\",\n \"useCases\": [\n \"dom\",\n \"use-draggable\",\n \"usedraggable\",\n \"drag\",\n \"element\",\n \"with\",\n \"pointer\",\n \"keyboard\",\n \"bounds\",\n \"grid\",\n \"axis\",\n \"lock\",\n \"smoothing\",\n \"jump\",\n \"click\"\n ]\n },\n {\n \"slug\": \"use-hotkeys\",\n \"name\": \"useHotkeys\",\n \"description\": \"Bind a keyboard shortcut combo (e.g. ctrl+k) to a callback.\",\n \"category\": \"dom\",\n \"signature\": \"useHotkeys(keys: string, callback: (event: KeyboardEvent) => void): void\",\n \"parameters\": [\n {\n \"name\": \"keys\",\n \"type\": \"string\",\n \"defaultValue\": null,\n \"description\": \"Key combination string separated by '+' (e.g. 'ctrl+k', 'shift+s').\"\n },\n {\n \"name\": \"callback\",\n \"type\": \"(event: KeyboardEvent) => void\",\n \"defaultValue\": null,\n \"description\": \"Function called when the key combination is pressed.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"void\",\n \"type\": \"void\",\n \"description\": \"Returns nothing.\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n useHotkeys(\\\"ctrl+k\\\", () => {\\n console.log(\\\"Ctrl+K pressed\\\");\\n });\\n\\n return <div>Press Ctrl+K to trigger shortcut</div>;\\n}\",\n \"source\": \"import { useEffect, useRef } from \\\"react\\\";\\n\\nconst MODIFIERS = [\\n \\\"ctrl\\\",\\n \\\"control\\\",\\n \\\"meta\\\",\\n \\\"cmd\\\",\\n \\\"command\\\",\\n \\\"shift\\\",\\n \\\"alt\\\",\\n \\\"option\\\",\\n];\\n\\n/**\\n * Binds a keyboard shortcut to a callback. Accepts a `\\\"+\\\"`-separated combo such\\n * as `\\\"ctrl+k\\\"`, `\\\"meta+shift+p\\\"`, or a single key like `\\\"Escape\\\"`. The listener\\n * attaches to `window` in an effect (SSR-safe) and calls `preventDefault()` on a\\n * match. The callback is held in a ref, so re-renders don't re-bind.\\n *\\n * @param keys - The combo, e.g. `\\\"ctrl+k\\\"` (case-insensitive).\\n * @param callback - Called with the `KeyboardEvent` when the combo matches.\\n */\\nexport const useHotkeys = (\\n keys: string,\\n callback: (event: KeyboardEvent) => void,\\n): void => {\\n const callbackRef = useRef(callback);\\n callbackRef.current = callback;\\n\\n useEffect(() => {\\n const parts = keys.toLowerCase().split(\\\"+\\\").map((part) => part.trim());\\n const needCtrl = parts.includes(\\\"ctrl\\\") || parts.includes(\\\"control\\\");\\n const needMeta =\\n parts.includes(\\\"meta\\\") ||\\n parts.includes(\\\"cmd\\\") ||\\n parts.includes(\\\"command\\\");\\n const needShift = parts.includes(\\\"shift\\\");\\n const needAlt = parts.includes(\\\"alt\\\") || parts.includes(\\\"option\\\");\\n const mainKey = parts.find((part) => !MODIFIERS.includes(part));\\n\\n const handler = (event: KeyboardEvent) => {\\n if (!mainKey) return;\\n if (\\n event.ctrlKey === needCtrl &&\\n event.metaKey === needMeta &&\\n event.shiftKey === needShift &&\\n event.altKey === needAlt &&\\n event.key.toLowerCase() === mainKey\\n ) {\\n event.preventDefault();\\n callbackRef.current(event);\\n }\\n };\\n\\n window.addEventListener(\\\"keydown\\\", handler);\\n return () => window.removeEventListener(\\\"keydown\\\", handler);\\n }, [keys]);\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-hotkeys/use-hotkeys.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-hotkeys\",\n \"useCases\": [\n \"dom\",\n \"use-hotkeys\",\n \"usehotkeys\",\n \"shortcuts\",\n \"keyboard navigation\",\n \"accessibility\",\n \"bind\",\n \"keyboard\",\n \"shortcut\",\n \"combo\",\n \"ctrl\",\n \"callback\"\n ]\n },\n {\n \"slug\": \"use-fullscreen\",\n \"name\": \"useFullscreen\",\n \"description\": \"Control the Fullscreen API for an element and track its state.\",\n \"category\": \"dom\",\n \"signature\": \"useFullscreen<T extends HTMLElement>(ref: RefObject<T | null>): UseFullscreenReturn\",\n \"parameters\": [\n {\n \"name\": \"ref\",\n \"type\": \"RefObject<HTMLElement | null>\",\n \"defaultValue\": null,\n \"description\": \"Ref attached to the element to control fullscreen for.\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"fullscreen\",\n \"type\": \"UseFullscreenReturn\",\n \"description\": \"Object containing isFullscreen state and enter, exit, toggle methods.\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"UseFullscreenReturn\",\n \"description\": \"Fullscreen state and control actions returned by useFullscreen.\",\n \"rows\": [\n {\n \"name\": \"isFullscreen\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether the target element is currently fullscreen.\"\n },\n {\n \"name\": \"enter\",\n \"type\": \"() => Promise<void>\",\n \"defaultValue\": null,\n \"description\": \"Requests fullscreen for the referenced element.\"\n },\n {\n \"name\": \"exit\",\n \"type\": \"() => Promise<void>\",\n \"defaultValue\": null,\n \"description\": \"Exits fullscreen.\"\n },\n {\n \"name\": \"toggle\",\n \"type\": \"() => Promise<void>\",\n \"defaultValue\": null,\n \"description\": \"Toggles between fullscreen and normal state.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const ref = useRef<HTMLDivElement>(null);\\n const { isFullscreen, toggle } = useFullscreen(ref);\\n\\n return (\\n <div ref={ref}>\\n <button onClick={toggle}>\\n {isFullscreen ? \\\"Exit Fullscreen\\\" : \\\"Enter Fullscreen\\\"}\\n </button>\\n </div>\\n );\\n}\",\n \"source\": \"import { useCallback, useEffect, useState, type RefObject } from \\\"react\\\";\\n\\n/** The value returned by {@link useFullscreen}. */\\nexport interface UseFullscreenReturn {\\n /** Whether the referenced element is currently fullscreen. */\\n isFullscreen: boolean;\\n /** Request fullscreen for the referenced element. */\\n enter: () => Promise<void>;\\n /** Exit fullscreen (if this element is fullscreen). */\\n exit: () => Promise<void>;\\n /** Toggle fullscreen for the referenced element. */\\n toggle: () => Promise<void>;\\n}\\n\\n/**\\n * Controls the Fullscreen API for a referenced element and tracks whether it is\\n * currently fullscreen (via `fullscreenchange`). Listeners attach in an effect,\\n * so the hook is SSR-safe; calls are no-ops where the API is unavailable.\\n *\\n * @param ref - A ref to the element to make fullscreen.\\n * @returns `{ isFullscreen, enter, exit, toggle }`.\\n */\\nexport const useFullscreen = <T extends HTMLElement = HTMLElement>(\\n ref: RefObject<T | null>,\\n): UseFullscreenReturn => {\\n const [isFullscreen, setIsFullscreen] = useState(false);\\n\\n useEffect(() => {\\n const onChange = () =>\\n setIsFullscreen(document.fullscreenElement === ref.current);\\n document.addEventListener(\\\"fullscreenchange\\\", onChange);\\n return () => document.removeEventListener(\\\"fullscreenchange\\\", onChange);\\n }, [ref]);\\n\\n const enter = useCallback(async () => {\\n await ref.current?.requestFullscreen?.();\\n }, [ref]);\\n\\n const exit = useCallback(async () => {\\n if (typeof document !== \\\"undefined\\\" && document.fullscreenElement) {\\n await document.exitFullscreen?.();\\n }\\n }, []);\\n\\n const toggle = useCallback(async () => {\\n if (document.fullscreenElement === ref.current) await exit();\\n else await enter();\\n }, [enter, exit, ref]);\\n\\n return { isFullscreen, enter, exit, toggle };\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-fullscreen/use-fullscreen.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-fullscreen\",\n \"useCases\": [\n \"dom\",\n \"use-fullscreen\",\n \"usefullscreen\",\n \"responsive\",\n \"mobile detection\",\n \"viewport size\",\n \"control\",\n \"fullscreen\",\n \"element\",\n \"track\",\n \"state\"\n ]\n },\n {\n \"slug\": \"use-battery\",\n \"name\": \"useBattery\",\n \"description\": \"Read device battery level and charging state (where supported).\",\n \"category\": \"data\",\n \"signature\": \"useBattery(): BatteryState\",\n \"parameters\": [],\n \"returns\": [\n {\n \"name\": \"batteryState\",\n \"type\": \"BatteryState\",\n \"description\": \"Snapshot of device battery status (supported, loading, level, charging, chargingTime, dischargingTime).\"\n }\n ],\n \"typeAliases\": [\n {\n \"name\": \"BatteryState\",\n \"description\": \"Snapshot of device battery status returned by useBattery.\",\n \"rows\": [\n {\n \"name\": \"supported\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether the Battery Status API is supported in this browser.\"\n },\n {\n \"name\": \"loading\",\n \"type\": \"boolean\",\n \"defaultValue\": null,\n \"description\": \"Whether initial battery status is being queried.\"\n },\n {\n \"name\": \"level\",\n \"type\": \"number | null\",\n \"defaultValue\": null,\n \"description\": \"Battery charge level between 0 and 1.\"\n },\n {\n \"name\": \"charging\",\n \"type\": \"boolean | null\",\n \"defaultValue\": null,\n \"description\": \"Whether the device is plugged in and charging.\"\n },\n {\n \"name\": \"chargingTime\",\n \"type\": \"number | null\",\n \"defaultValue\": null,\n \"description\": \"Seconds until battery is fully charged.\"\n },\n {\n \"name\": \"dischargingTime\",\n \"type\": \"number | null\",\n \"defaultValue\": null,\n \"description\": \"Seconds until battery is completely discharged.\"\n }\n ]\n }\n ],\n \"usage\": \"export function Demo() {\\n const { supported, level, charging } = useBattery();\\n\\n if (!supported) return <p>Battery API not supported</p>;\\n\\n return (\\n <div>\\n <p>Battery level: {level !== null ? Math.round(level * 100) : 0}%</p>\\n <p>Charging: {charging ? \\\"Yes\\\" : \\\"No\\\"}</p>\\n </div>\\n );\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/** The battery snapshot returned by {@link useBattery}. */\\nexport interface BatteryState {\\n /** Whether the Battery Status API is available. */\\n supported: boolean;\\n /** Whether the first reading is still pending. */\\n loading: boolean;\\n /** Charge level from `0` to `1`, or `null`. */\\n level: number | null;\\n /** Whether the device is charging, or `null`. */\\n charging: boolean | null;\\n /** Seconds until fully charged, or `null`. */\\n chargingTime: number | null;\\n /** Seconds until empty, or `null`. */\\n dischargingTime: number | null;\\n}\\n\\ninterface BatteryManagerLike {\\n level: number;\\n charging: boolean;\\n chargingTime: number;\\n dischargingTime: number;\\n addEventListener: (type: string, listener: () => void) => void;\\n removeEventListener: (type: string, listener: () => void) => void;\\n}\\n\\nconst EVENTS = [\\n \\\"levelchange\\\",\\n \\\"chargingchange\\\",\\n \\\"chargingtimechange\\\",\\n \\\"dischargingtimechange\\\",\\n];\\n\\n/**\\n * Reads the device battery via the Battery Status API and keeps it updated.\\n * SSR-safe and degrades gracefully: where the API is missing, `supported` is\\n * `false` and the numeric fields stay `null`.\\n *\\n * @returns The current {@link BatteryState}.\\n */\\nexport const useBattery = (): BatteryState => {\\n const [state, setState] = useState<BatteryState>({\\n supported:\\n typeof navigator !== \\\"undefined\\\" && \\\"getBattery\\\" in navigator,\\n loading: true,\\n level: null,\\n charging: null,\\n chargingTime: null,\\n dischargingTime: null,\\n });\\n\\n useEffect(() => {\\n const getBattery = (\\n navigator as unknown as {\\n getBattery?: () => Promise<BatteryManagerLike>;\\n }\\n ).getBattery;\\n\\n if (!getBattery) {\\n setState((prev) => ({ ...prev, supported: false, loading: false }));\\n return;\\n }\\n\\n let battery: BatteryManagerLike | null = null;\\n let cancelled = false;\\n const update = () => {\\n if (!battery) return;\\n setState({\\n supported: true,\\n loading: false,\\n level: battery.level,\\n charging: battery.charging,\\n chargingTime: battery.chargingTime,\\n dischargingTime: battery.dischargingTime,\\n });\\n };\\n\\n void getBattery.call(navigator).then((result) => {\\n if (cancelled) return;\\n battery = result;\\n update();\\n for (const event of EVENTS) battery.addEventListener(event, update);\\n });\\n\\n return () => {\\n cancelled = true;\\n if (battery) {\\n for (const event of EVENTS) battery.removeEventListener(event, update);\\n }\\n };\\n }, []);\\n\\n return state;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-battery/use-battery.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-battery\",\n \"useCases\": [\n \"data\",\n \"use-battery\",\n \"usebattery\",\n \"read\",\n \"device\",\n \"battery\",\n \"level\",\n \"charging\",\n \"state\",\n \"where\",\n \"supported\"\n ]\n },\n {\n \"slug\": \"use-permission\",\n \"name\": \"usePermission\",\n \"description\": \"Query a Permissions API permission and track its state.\",\n \"category\": \"data\",\n \"signature\": \"usePermission(name: PermissionName): UsePermissionResult\",\n \"parameters\": [\n {\n \"name\": \"name\",\n \"type\": \"PermissionName\",\n \"defaultValue\": null,\n \"description\": \"The permission name to query (e.g. 'geolocation', 'notifications').\"\n }\n ],\n \"returns\": [\n {\n \"name\": \"status\",\n \"type\": \"UsePermissionResult\",\n \"description\": \"The permission state ('granted', 'denied', 'prompt', 'pending', or 'unsupported').\"\n }\n ],\n \"typeAliases\": [],\n \"usage\": \"export function Demo() {\\n const status = usePermission(\\\"geolocation\\\");\\n\\n return <p>Geolocation permission: {status}</p>;\\n}\",\n \"source\": \"import { useEffect, useState } from \\\"react\\\";\\n\\n/**\\n * The result of {@link usePermission}: a standard `PermissionState`\\n * (`\\\"granted\\\" | \\\"denied\\\" | \\\"prompt\\\"`), `\\\"pending\\\"` before the first read, or\\n * `\\\"unsupported\\\"` where the Permissions API is unavailable.\\n */\\nexport type UsePermissionResult = PermissionState | \\\"pending\\\" | \\\"unsupported\\\";\\n\\n/**\\n * Queries the Permissions API for a permission and tracks its state reactively\\n * (it updates if the user later changes the setting). SSR-safe; resolves to\\n * `\\\"unsupported\\\"` where the API — or the specific permission — is unavailable.\\n *\\n * @param name - The permission to query, e.g. `\\\"geolocation\\\"`, `\\\"camera\\\"`, `\\\"notifications\\\"`.\\n * @returns The current permission state.\\n */\\nexport const usePermission = (name: PermissionName): UsePermissionResult => {\\n const [state, setState] = useState<UsePermissionResult>(\\\"pending\\\");\\n\\n useEffect(() => {\\n if (typeof navigator === \\\"undefined\\\" || !navigator.permissions) {\\n setState(\\\"unsupported\\\");\\n return;\\n }\\n\\n let status: PermissionStatus | null = null;\\n let cancelled = false;\\n const onChange = () => {\\n if (status) setState(status.state);\\n };\\n\\n navigator.permissions\\n .query({ name })\\n .then((result) => {\\n if (cancelled) return;\\n status = result;\\n setState(result.state);\\n result.addEventListener(\\\"change\\\", onChange);\\n })\\n .catch(() => {\\n if (!cancelled) setState(\\\"unsupported\\\");\\n });\\n\\n return () => {\\n cancelled = true;\\n status?.removeEventListener(\\\"change\\\", onChange);\\n };\\n }, [name]);\\n\\n return state;\\n};\",\n \"sourcePath\": \"packages/hookli/src/hooks/use-permission/use-permission.ts\",\n \"docsUrl\": \"https://hookli.vercel.app/docs/use-permission\",\n \"useCases\": [\n \"data\",\n \"use-permission\",\n \"usepermission\",\n \"query\",\n \"permissions\",\n \"permission\",\n \"track\",\n \"state\"\n ]\n }\n]","import catalogData from \"./data/catalog.json\";\nimport type { HookCatalogItem, HookCategory } from \"./types.js\";\n\nexport const CATALOG: HookCatalogItem[] = catalogData as HookCatalogItem[];\n\nexport function getAllHooks(): HookCatalogItem[] {\n return CATALOG;\n}\n\nexport function getHookBySlugOrName(identifier: string): HookCatalogItem | undefined {\n const norm = identifier.trim().toLowerCase().replace(/^use-?/, \"use\");\n return CATALOG.find((hook) => {\n const slugMatch = hook.slug.toLowerCase() === identifier.trim().toLowerCase();\n const nameMatch = hook.name.toLowerCase() === identifier.trim().toLowerCase();\n const normMatch = hook.name.toLowerCase() === norm;\n return slugMatch || nameMatch || normMatch;\n });\n}\n\nexport function getHooksByCategory(category: HookCategory): HookCatalogItem[] {\n return CATALOG.filter((h) => h.category.toLowerCase() === category.toLowerCase());\n}\n\nexport function searchHooks(\n query: string,\n options?: {\n category?: HookCategory;\n limit?: number;\n },\n): Array<{ hook: HookCatalogItem; score: number }> {\n const q = query.trim().toLowerCase();\n const limit = options?.limit ?? 10;\n const terms = q.split(/\\s+/).filter(Boolean);\n\n const results: Array<{ hook: HookCatalogItem; score: number }> = [];\n\n for (const hook of CATALOG) {\n if (options?.category && hook.category.toLowerCase() !== options.category.toLowerCase()) {\n continue;\n }\n\n let score = 0;\n const nameLower = hook.name.toLowerCase();\n const descLower = hook.description.toLowerCase();\n const slugLower = hook.slug.toLowerCase();\n\n // Exact name match gets highest score\n if (nameLower === q || slugLower === q) {\n score += 100;\n } else if (nameLower.includes(q)) {\n score += 50;\n }\n\n for (const term of terms) {\n if (nameLower.includes(term)) score += 20;\n if (slugLower.includes(term)) score += 15;\n if (descLower.includes(term)) score += 10;\n if (hook.category.toLowerCase().includes(term)) score += 5;\n if (hook.useCases.some((uc) => uc.toLowerCase().includes(term))) score += 15;\n }\n\n if (score > 0) {\n results.push({ hook, score });\n }\n }\n\n results.sort((a, b) => b.score - a.score);\n return results.slice(0, limit);\n}\n\nexport function formatHookMarkdown(hook: HookCatalogItem): string {\n const sections: string[] = [\n `# ${hook.name}`,\n `> ${hook.description}`,\n [\n `- Category: \\`${hook.category}\\``,\n `- Package: \\`hookli\\` (\\`npm i hookli\\`)`,\n `- Docs: [${hook.docsUrl}](${hook.docsUrl})`,\n ].join(\"\\n\"),\n `## Signature\\n\\n\\`\\`\\`ts\\n${hook.signature}\\n\\`\\`\\``,\n ];\n\n if (hook.parameters.length > 0) {\n const params = hook.parameters\n .map((p) => {\n const def = p.defaultValue ? ` (default: \\`${p.defaultValue}\\`)` : \"\";\n return `- \\`${p.name}\\`: \\`${p.type}\\`${def} — ${p.description}`;\n })\n .join(\"\\n\");\n sections.push(`## Parameters\\n\\n${params}`);\n }\n\n if (hook.returns.length > 0) {\n const returns = hook.returns\n .map((r) => `- \\`${r.name}\\`: \\`${r.type}\\` — ${r.description}`)\n .join(\"\\n\");\n sections.push(`## Returns\\n\\n${returns}`);\n }\n\n if (hook.typeAliases.length > 0) {\n const types = hook.typeAliases\n .map((ta) => {\n const desc = ta.description ? `${ta.description}\\n\\n` : \"\";\n const rows = ta.rows\n .map((row) => {\n const def = row.defaultValue ? ` (default: \\`${row.defaultValue}\\`)` : \"\";\n return `- \\`${row.name}\\`: \\`${row.type}\\`${def} — ${row.description}`;\n })\n .join(\"\\n\");\n return `### ${ta.name}\\n\\n${desc}${rows}`;\n })\n .join(\"\\n\\n\");\n sections.push(`## Types\\n\\n${types}`);\n }\n\n if (hook.usage) {\n sections.push(`## Usage\\n\\n\\`\\`\\`tsx\\n${hook.usage}\\n\\`\\`\\``);\n }\n\n if (hook.source) {\n sections.push(`## Source Implementation\\n\\n\\`\\`\\`ts\\n${hook.source}\\n\\`\\`\\``);\n }\n\n return sections.join(\"\\n\\n\");\n}\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\nimport { formatHookMarkdown, getHookBySlugOrName } from \"../catalog.js\";\n\nexport function registerPrompts(server: McpServer): void {\n // 1. implement-hook prompt\n server.prompt(\n \"implement-hook\",\n \"Template for implementing a component with a hookli hook\",\n {\n hookName: z.string().describe(\"The name of the hook (e.g. 'useDebounce', 'useLocalStorage')\"),\n useCase: z.string().optional().describe(\"What you are trying to build with this hook\"),\n },\n ({ hookName, useCase }) => {\n const hook = getHookBySlugOrName(hookName);\n const hookDoc = hook ? formatHookMarkdown(hook) : `(Hook ${hookName} not found in catalog)`;\n\n return {\n messages: [\n {\n role: \"user\",\n content: {\n type: \"text\",\n text: [\n `I am implementing a React feature using the \\`hookli\\` library (zero-dependency, SSR-safe, typed).`,\n useCase ? `My specific goal is: ${useCase}` : \"\",\n \"\",\n `Here is the official documentation and API for \\`${hookName}\\`:`,\n \"---\",\n hookDoc,\n \"---\",\n \"\",\n `Please write a complete, idiomatic, and SSR-safe React TypeScript component that demonstrates how to use this hook cleanly.`,\n ]\n .filter(Boolean)\n .join(\"\\n\"),\n },\n },\n ],\n };\n },\n );\n\n // 2. migrate-to-hookli prompt\n server.prompt(\n \"migrate-to-hookli\",\n \"Template for migrating existing component code to use hookli\",\n {\n sourceLibrary: z.enum([\"react-use\", \"usehooks-ts\", \"custom\"]).describe(\"The origin of the existing hooks\"),\n currentCode: z.string().describe(\"The existing component code you want to migrate\"),\n },\n ({ sourceLibrary, currentCode }) => {\n return {\n messages: [\n {\n role: \"user\",\n content: {\n type: \"text\",\n text: [\n `I want to migrate this React component from \\`${sourceLibrary}\\` to \\`hookli\\`.`,\n `hookli features 66 typed, zero-runtime-dependency, SSR-safe React hooks.`,\n \"\",\n `Current component code:`,\n \"```tsx\",\n currentCode,\n \"```\",\n \"\",\n `Please:`,\n `1. Identify which hooks from \\`${sourceLibrary}\\` or custom implementations can be replaced by \\`hookli\\` hooks.`,\n `2. Rewrite the component using \\`import { ... } from \"hookli\"\\`.`,\n `3. Note any subtle API differences (e.g. argument order, return types, SSR guards) and explain the changes.`,\n ].join(\"\\n\"),\n },\n },\n ],\n };\n },\n );\n}\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { ResourceTemplate } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { CATALOG, formatHookMarkdown, getHookBySlugOrName } from \"../catalog.js\";\n\nexport function registerResources(server: McpServer): void {\n // 1. Full catalog resource\n server.resource(\n \"catalog\",\n \"hookli://catalog\",\n async (uri) => ({\n contents: [\n {\n uri: uri.href,\n mimeType: \"application/json\",\n text: JSON.stringify(CATALOG, null, 2),\n },\n ],\n }),\n );\n\n // 2. Summary manifest resource\n server.resource(\n \"manifest\",\n \"hookli://manifest\",\n async (uri) => {\n const summary = CATALOG.map((h) => ({\n slug: h.slug,\n name: h.name,\n category: h.category,\n description: h.description,\n signature: h.signature,\n docsUrl: h.docsUrl,\n }));\n return {\n contents: [\n {\n uri: uri.href,\n mimeType: \"application/json\",\n text: JSON.stringify({ library: \"hookli\", version: \"1.6.6\", hooks: summary }, null, 2),\n },\n ],\n };\n },\n );\n\n // 3. Dynamic template for individual hook documentation\n server.resource(\n \"hook-doc\",\n new ResourceTemplate(\"hookli://hooks/{slug}\", { list: undefined }),\n async (uri, { slug }) => {\n const hookSlug = Array.isArray(slug) ? slug[0] : slug;\n const hook = getHookBySlugOrName(hookSlug);\n if (!hook) {\n throw new Error(`Hook \"${hookSlug}\" not found`);\n }\n return {\n contents: [\n {\n uri: uri.href,\n mimeType: \"text/markdown\",\n text: formatHookMarkdown(hook),\n },\n ],\n };\n },\n );\n}\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\nimport {\n formatHookMarkdown,\n getAllHooks,\n getHookBySlugOrName,\n getHooksByCategory,\n searchHooks,\n} from \"../catalog.js\";\nimport type { HookCategory } from \"../types.js\";\n\nconst CategoryEnum = z.enum([\"state\", \"effects\", \"dom\", \"data\"]);\n\nexport function registerTools(server: McpServer): void {\n // 1. list_hooks\n server.tool(\n \"list_hooks\",\n \"List all available hooks in hookli, optionally filtered by category or search term.\",\n {\n category: CategoryEnum.optional().describe(\"Filter hooks by category: state, effects, dom, or data\"),\n query: z.string().optional().describe(\"Optional substring filter matching hook name or description\"),\n },\n async ({ category, query }) => {\n let hooks = category ? getHooksByCategory(category as HookCategory) : getAllHooks();\n\n if (query && query.trim()) {\n const q = query.trim().toLowerCase();\n hooks = hooks.filter(\n (h) => h.name.toLowerCase().includes(q) || h.description.toLowerCase().includes(q),\n );\n }\n\n const summary = hooks.map((h) => ({\n name: h.name,\n slug: h.slug,\n category: h.category,\n description: h.description,\n signature: h.signature,\n docsUrl: h.docsUrl,\n }));\n\n const text = [\n `# hookli Hooks (${hooks.length} found)`,\n category ? `Filtered by category: **${category}**` : \"\",\n query ? `Filtered by query: **${query}**` : \"\",\n \"\",\n ...summary.map(\n (h) => `- **\\`${h.name}\\`** (\\`${h.category}\\`): ${h.description}\\n Signature: \\`${h.signature}\\``,\n ),\n ]\n .filter(Boolean)\n .join(\"\\n\");\n\n return {\n content: [\n {\n type: \"text\",\n text,\n },\n ],\n };\n },\n );\n\n // 2. get_hook\n server.tool(\n \"get_hook\",\n \"Get full documentation, TypeScript signature, parameter types, return values, and usage examples for a specific hook.\",\n {\n name: z.string().describe(\"The name or slug of the hook (e.g. 'useDebounce', 'use-debounce', 'useLocalStorage')\"),\n },\n async ({ name }) => {\n const hook = getHookBySlugOrName(name);\n if (!hook) {\n const suggestions = searchHooks(name, { limit: 3 });\n const didYouMean = suggestions.length\n ? `\\n\\nDid you mean:\\n${suggestions.map((s) => `- \\`${s.hook.name}\\`: ${s.hook.description}`).join(\"\\n\")}`\n : \"\";\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: `Hook \"${name}\" not found in hookli catalog.${didYouMean}`,\n },\n ],\n };\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: formatHookMarkdown(hook),\n },\n ],\n };\n },\n );\n\n // 3. search_hooks\n server.tool(\n \"search_hooks\",\n \"Search hookli hooks by use-case description, intent, or keyword (e.g. 'persist state across reloads', 'listen to clicks outside dropdown', 'throttle api call').\",\n {\n query: z.string().describe(\"Natural language query or keywords describing what you want to achieve\"),\n category: CategoryEnum.optional().describe(\"Optional category constraint\"),\n limit: z.number().int().min(1).max(20).optional().default(5).describe(\"Max number of matches to return\"),\n },\n async ({ query, category, limit }) => {\n const results = searchHooks(query, {\n category: category as HookCategory | undefined,\n limit,\n });\n\n if (results.length === 0) {\n return {\n content: [\n {\n type: \"text\",\n text: `No hookli hooks matched your query \"${query}\". Try broader terms like \"events\", \"timer\", \"storage\", or \"scroll\".`,\n },\n ],\n };\n }\n\n const formatted = results\n .map(({ hook, score }, index) => {\n return [\n `### ${index + 1}. \\`${hook.name}\\` (Relevance: ${score})`,\n `> ${hook.description}`,\n `- **Category:** \\`${hook.category}\\``,\n `- **Signature:** \\`${hook.signature}\\``,\n `- **Docs:** [${hook.docsUrl}](${hook.docsUrl})`,\n `- **Common use-cases:** ${hook.useCases.slice(0, 6).join(\", \")}`,\n hook.usage ? `\\n\\`\\`\\`tsx\\n${hook.usage}\\n\\`\\`\\`` : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n })\n .join(\"\\n\\n---\\n\\n\");\n\n return {\n content: [\n {\n type: \"text\",\n text: `# Search Results for \"${query}\"\\n\\n${formatted}`,\n },\n ],\n };\n },\n );\n\n // 4. get_hook_source\n server.tool(\n \"get_hook_source\",\n \"Retrieve the exact zero-dependency TypeScript implementation of a hook to inspect how it works, see SSR guards, or adapt it.\",\n {\n name: z.string().describe(\"The name or slug of the hook (e.g. 'useAsync', 'useIntersectionObserver')\"),\n },\n async ({ name }) => {\n const hook = getHookBySlugOrName(name);\n if (!hook) {\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: `Hook \"${name}\" not found.`,\n },\n ],\n };\n }\n\n const text = [\n `# Source for \\`${hook.name}\\``,\n `File: \\`${hook.sourcePath}\\``,\n `SSR-Safe: Yes (all browser globals are guarded)`,\n `Runtime Dependencies: 0 (Pure React + TypeScript)`,\n \"\",\n \"```typescript\",\n hook.source,\n \"```\",\n ].join(\"\\n\");\n\n return {\n content: [\n {\n type: \"text\",\n text,\n },\n ],\n };\n },\n );\n\n // 5. suggest_hooks_for_task\n server.tool(\n \"suggest_hooks_for_task\",\n \"Analyze a developer's feature requirements and recommend how to compose multiple hookli hooks to build it.\",\n {\n taskDescription: z\n .string()\n .describe(\"Description of the UI component or feature you are building (e.g. 'A modal dialog with keyboard ESC escape, click-outside closing, and body scroll lock')\"),\n },\n async ({ taskDescription }) => {\n const searchTerms = taskDescription\n .toLowerCase()\n .replace(/[^a-z0-9 ]/g, \" \")\n .split(/\\s+/)\n .filter((w) => w.length > 2);\n\n const scoredMatches = searchHooks(taskDescription, { limit: 6 });\n\n if (scoredMatches.length === 0) {\n return {\n content: [\n {\n type: \"text\",\n text: `Could not identify matching hookli hooks for: \"${taskDescription}\".`,\n },\n ],\n };\n }\n\n const recommendations = scoredMatches.map(({ hook }) => ({\n name: hook.name,\n category: hook.category,\n description: hook.description,\n signature: hook.signature,\n docsUrl: hook.docsUrl,\n }));\n\n const text = [\n `# Hook Recommendations for: \"${taskDescription}\"`,\n \"\",\n \"Here are the hookli hooks that best fit this task:\",\n \"\",\n ...recommendations.map(\n (rec, i) =>\n `### ${i + 1}. \\`${rec.name}\\` (${rec.category})\\n- **Role:** ${rec.description}\\n- **API:** \\`${rec.signature}\\`\\n- **Docs:** ${rec.docsUrl}`,\n ),\n \"\",\n \"## Suggested Composition Pattern\",\n \"```tsx\",\n `import { ${recommendations.map((r) => r.name).join(\", \")} } from \"hookli\";`,\n \"\",\n \"export function MyFeatureComponent() {\",\n ...recommendations.map(\n (r) => ` // Use ${r.name}: ${r.description}\\n // const ... = ${r.name}(...);`,\n ),\n \"\",\n \" return (\",\n \" <div>\",\n \" {/* Feature UI elements wired with hook handlers */}\",\n \" </div>\",\n \" );\",\n \"}\",\n \"```\",\n ].join(\"\\n\");\n\n return {\n content: [\n {\n type: \"text\",\n text,\n },\n ],\n };\n },\n );\n}\n","import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { registerPrompts } from \"./prompts/index.js\";\nimport { registerResources } from \"./resources/index.js\";\nimport { registerTools } from \"./tools/index.js\";\n\nexport function createMcpServer(): McpServer {\n const server = new McpServer(\n {\n name: \"hookli\",\n version: \"1.6.6\",\n },\n {\n capabilities: {\n tools: {},\n resources: {},\n prompts: {},\n },\n },\n );\n\n registerTools(server);\n registerResources(server);\n registerPrompts(server);\n\n return server;\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,IACE,MAAQ;AAAA,IACR,MAAQ;AAAA,IACR,aAAe;AAAA,IACf,UAAY;AAAA,IACZ,WAAa;AAAA,IACb,YAAc;AAAA,MACZ;AAAA,QACE,MAAQ;AAAA,QACR,MAAQ;AAAA,QACR,cAAgB;AAAA,QAChB,aAAe;AAAA,MACjB;AAAA,IACF;AAAA,IACA,SAAW;AAAA,MACT;AAAA,QACE,MAAQ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