UNPKG

cookies-next

Version:

Set, Get, Remove cookies on both client and server side with Next.js

29 lines (28 loc) 2.39 kB
import type { OptionsType, TmpCookiesObj, CookieValueTypes } from '../common/types'; import type { PollingOptions } from './types'; export declare const useCookiesPolling: (onChange: (newCookies: TmpCookiesObj | undefined) => void, pollingOptions?: PollingOptions) => void; declare const useGetCookies: () => (_options?: OptionsType | undefined) => TmpCookiesObj | undefined; declare const useGetCookie: () => (key: string, options?: OptionsType | undefined) => CookieValueTypes; declare const useHasCookie: () => (key: string, options?: OptionsType | undefined) => boolean; declare const useSetCookie: () => (key: string, data: any, options?: OptionsType | undefined) => void; declare const useDeleteCookie: () => (key: string, options?: OptionsType | undefined) => void; declare const useCookiesNext: () => { getCookies: (_options?: OptionsType | undefined) => TmpCookiesObj | undefined; getCookie: (key: string, options?: OptionsType | undefined) => CookieValueTypes; hasCookie: (key: string, options?: OptionsType | undefined) => boolean; setCookie: (key: string, data: any, options?: OptionsType | undefined) => void; deleteCookie: (key: string, options?: OptionsType | undefined) => void; }; declare const useReactiveGetCookies: () => (_options?: OptionsType | undefined) => TmpCookiesObj | undefined; declare const useReactiveGetCookie: () => (key: string, _options?: OptionsType | undefined) => CookieValueTypes; declare const useReactiveSetCookie: () => (key: string, data: any, _options?: OptionsType) => void; declare const useReactiveDeleteCookie: () => (key: string, _options?: OptionsType) => void; declare const useReactiveHasCookie: () => (key: string, _options?: OptionsType) => boolean; declare const useReactiveCookiesNext: () => { getCookies: (_options?: OptionsType | undefined) => TmpCookiesObj | undefined; getCookie: (key: string, _options?: OptionsType | undefined) => CookieValueTypes; hasCookie: (key: string, _options?: OptionsType) => boolean; setCookie: (key: string, data: any, _options?: OptionsType) => void; deleteCookie: (key: string, _options?: OptionsType) => void; }; export { useGetCookies, useGetCookie, useSetCookie, useDeleteCookie, useHasCookie, useCookiesNext, useReactiveCookiesNext, useReactiveGetCookies, useReactiveGetCookie, useReactiveSetCookie, useReactiveDeleteCookie, useReactiveHasCookie, };