import { CookieValueTypes } from './CookieValueTypes.mjs'; import { ServerOptions } from './ServerOptions.mjs'; import { TmpCookiesObj } from './TmpCookiesObj.mjs'; import 'cookie'; import 'http'; /** * An interface containing all the cookie management methods. */ interface CookieManager { /** * Computes and gets the cookies from the server or the client. * * @param {ServerOptions} [options] - An optional {@link ServerOptions} object containing the res and req objects for ServerResponse and IncomingMessage with cookies respectively. Required for server-side rendering session management. * * @returns {TmpCookiesObj} A key, value pair object of type {@link CookieValueTypes} holding cookie values. */ getCookies(options?: ServerOptions): Promise; /** * Gets a cookie with the provided key. * * @param {string} key - A string representing the key value of the cookie. * @param {ServerOptions} [options] - An optional {@link ServerOptions} object containing the res and req objects for ServerResponse and IncomingMessage with cookies respectively. Required for server-side rendering session management. * * @returns {TmpCookiesObj} A key, value pair object of type {@link CookieValueTypes} holding cookie values. */ getCookie(key: string, options?: ServerOptions): Promise; /** * Sets the cookie from the server or the client. * * @param {string} key - A string representing the key in which to set the cookie. * @param {ServerOptions} [options] - An optional {@link ServerOptions} object containing the res and req objects for ServerResponse and IncomingMessage with cookies respectively. Required for server-side rendering session management. * * @returns {void} void. */ setCookie(key: string, data: any, options?: ServerOptions): Promise; /** * Deletes the cookie. * * @param {string} key - A string representing the key of the cookie. * @param {ServerOptions} [options] - An optional {@link ServerOptions} object containing the res and req objects for ServerResponse and IncomingMessage with cookies respectively. Required for server-side rendering session management. * * @returns {void} void. */ deleteCookie(key: string, options?: ServerOptions): Promise; /** * Checks if the cookie is present. * * @param {string} key - A string representing the key of the cookie. * @param {ServerOptions} [options] - An optional {@link ServerOptions} object containing the res and req objects for ServerResponse and IncomingMessage with cookies respectively. Required for server-side rendering session management. * * @returns {boolean} A boolean indicating if the cookie is present. */ hasCookie(key: string, options?: ServerOptions): Promise; } export type { CookieManager };