UNPKG

@polgubau/utils

Version:

A collection of utility functions for TypeScript

21 lines (19 loc) 857 B
/** * Sets a cookie with the specified name, value, and optional expiration in days. * @param {string} name - The name of the cookie. * @param {string} value - The value to be stored in the cookie. * @param {number} [days] - Optional number of days until the cookie expires. */ declare const setCookie: (name: string, value: string, days?: number) => void; /** * Retrieves the value of a cookie by its name. * @param {string} name - The name of the cookie to retrieve. * @returns {string|null} The value of the cookie if found, or null if not found. */ declare const getCookie: (name: string) => string | undefined; /** * Deletes a cookie by setting its expiration date to the past. * @param {string} name - The name of the cookie to delete. */ declare const deleteCookie: (name: string) => void; export { deleteCookie, getCookie, setCookie };