import { Primitive } from '../'; /** * Generates cookie string * * @example * ``` * // Create a cookie, valid across the entire site: * document.cookie = generateCookie('name', 'value') * * // Create a cookie that expires 7 days from now, valid across the entire site: * document.cookie = generateCookie('name', 'value', { expires: 7 }) * * // Delete a cookie by setting the expires parameter to zero: * document.cookie = generateCookie('name', 'value', { expires: 0 }) * ``` * @param name cookie name * @param value cookie value */ export declare function generateCookie(name: string, value: string, options?: { /** * Expire cookie after x days (negative to remove cookie) * * @default undefined Cookie is removed when the user closes the browser */ expires?: number; /** * A String indicating the path where the cookie is visible. * * @default undefined */ path?: string; /** * A String indicating a valid domain where the cookie should be visible. The cookie will also be visible to all subdomains. * * @default undefined Cookie is visible only to the domain or subdomain of the page where the cookie was created */ domain?: string; /** * A Boolean indicating if the cookie transmission requires a secure protocol (https). * * @default undefined No secure protocol requirement */ secure?: boolean; /** * A String, allowing to control whether the browser is sending a cookie along with cross-site requests. * * @default undefined No SameSite attribute set */ sameSite?: 'strict' | 'lax' | 'none'; }): string; /** * Parses cookies string * * @example * ``` * parseCookies(document.cookie) * // {session: '26e761be168533cbf0742f8c295176c7'} * ``` * @group Http * @param cookieString `document.cookie` value */ export declare function parseCookies(cookieString: string): Record; /** * Parse a query string given as a string argument. * * @example * ``` * location.search * // ?page=1&limit=20 * * parseQueryString(location.search) * // { page: ['1'], limit: ['20']} * ``` * @group Http */ export declare function parseQueryString(query: string, options?: { /** * @default `&` */ separator?: string; }): Record; /** * Generates query string form provided object. * * @example * ``` * generateQueryString({ page: 1, limit: 20}) * // 'page=1&limit=20' * ``` * @group Http * @param query * @param options * @returns */ export declare function generateQueryString(query: Record, options?: { /** * @default `&` */ separator?: string; }): string; /** * Converts absolute URL to relative * * @example * ``` * urlToRelative('https://domain.com/index.html') * // /index.html * ``` */ export declare function urlToRelative(url: string): string;