cookies-next
Version:
Set, Get, Remove cookies on both client and server side with Next.js
20 lines (19 loc) • 721 B
TypeScript
import React, { ReactNode } from 'react';
import { CookieValueTypes, TmpCookiesObj } from '.';
import { PollingOptions } from './types';
type CookieState = TmpCookiesObj;
type CookieContextType = {
cookies: CookieState;
set: (key: string, data: any) => void;
get: (key: string) => CookieValueTypes;
getAll: () => TmpCookiesObj | undefined;
has: (key: string) => boolean;
delete: (key: string) => void;
};
type CookieProviderProps = {
children: ReactNode;
pollingOptions?: PollingOptions;
};
export declare const CookieContext: React.Context<CookieContextType | null>;
export declare function CookieProvider({ children, pollingOptions }: CookieProviderProps): React.JSX.Element;
export {};