import { default as Cookies } from 'js-cookie'; import { PropsWithChildren } from 'react'; export type ICookieAttributes = NonNullable[2]>; export interface ICookieProvider extends PropsWithChildren { validate?: { validateKeys: (keyof IValidCookieObject)[]; getValidateCookieValue: (key: K, value: IValidCookieObject[K]) => value is IValidCookieObject[K]; }; } export type IValidCookieObject = {}; export interface ICookieContext { getCookie: (name: K) => IValidCookieObject[K] | undefined; setCookie: (name: K, value: IValidCookieObject[K], options?: ICookieAttributes) => void; removeCookieValue: (name: K, options?: ICookieAttributes) => void; removeCookieValues: () => void; checkCookie: () => void; cookieValues: IValidCookieObject | undefined; }