import { Context } from 'react'; import { default as default_2 } from 'node_modules/@types/js-cookie'; import { FC } from 'react'; import { PropsWithChildren } from 'react'; export declare type CookieAttributes = default_2.CookieAttributes; /** * Context for managing cookies. */ export declare const CookieContext: Context; export declare interface CookieContextProps { getCookie: (name: K) => ValidCookieObject[K] | undefined; setCookie: (name: K, value: ValidCookieObject[K], options?: CookieAttributes) => void; removeCookieValue: (name: K, options?: CookieAttributes) => void; removeCookieValues: () => void; checkCookie: () => void; cookieValues: ValidCookieObject | undefined; } export declare function getFromCookie(key: string): T | null; /** * Provider component for managing cookies. * * @remarks * You should understand which cookies you are changing and whether you have access to them. * * @remarks * The local storage is typed using the `jenesei-kit-react.d.ts` file: * * ```typescript * import '@jenesei-software/jenesei-kit-react' * * declare module '@jenesei-software/jenesei-kit-react' { * export interface ValidCookieObject { * access_token: string * refresh_token: string * } * } * ``` */ export declare const ProviderCookie: FC; export declare interface ProviderCookieProps extends PropsWithChildren { validate?: { validateKeys: (keyof ValidCookieObject)[]; getValidateCookieValue: (key: K, value: ValidCookieObject[K]) => value is ValidCookieObject[K]; }; } export declare function setToCookie(key: string, value: T, options?: CookieAttributes): void; /** * Custom hook to access the CookieContext. * * @remarks * You should understand which cookies you are changing and whether you have access to them. * */ export declare const useCookie: () => CookieContextProps; export declare interface ValidCookieObject { } export { }