@mirawision/reactive-hooks
Version:
A comprehensive collection of 50+ React hooks for state management, UI interactions, device APIs, async operations, drag & drop, audio/speech, and more. Full TypeScript support with SSR safety.
17 lines (16 loc) • 603 B
TypeScript
export interface CookieOptions {
days?: number;
path?: string;
sameSite?: 'Lax' | 'Strict' | 'None';
secure?: boolean;
}
type UseCookieReturn = [string | undefined, (value: string | null) => void, () => void];
/**
* A hook that manages state bound to a cookie.
* @param name Cookie name
* @param initial Initial value if cookie doesn't exist
* @param opts Cookie options (expiration, path, etc.)
* @returns Tuple with current value, setter, and remove function
*/
export declare function useCookie(name: string, initial?: string, opts?: CookieOptions): UseCookieReturn;
export {};