UNPKG

apply-hooks

Version:

A high-quality & reliable JavaScript Hooks library.

13 lines (12 loc) 457 B
import { CookieAttributes } from '../types'; export interface IGetCookie { <T>(cookieKey: string): T; } export interface IGetCookies { (): Record<string, string>; } export interface ISetCookie { (cookieKey: string, cookieValue: unknown, options?: CookieAttributes): boolean; } declare const useCookie: <T extends string>(defaultKey?: string, defaultOptions?: CookieAttributes) => [IGetCookie, ISetCookie, IGetCookies]; export default useCookie;