sveltekit-flash-message
Version:
Send temporary data to the next request after redirect. Works with both SSR and client.
20 lines (19 loc) • 867 B
TypeScript
import type { CookieParseOptions, CookieSerializeOptions } from './types.js';
export type { CookieParseOptions, CookieSerializeOptions } from './types.js';
/**
* Parse an HTTP Cookie header string and returning an object of all cookie
* name-value pairs.
*
* @param str the string representing a `Cookie` header value
* @param [options] object containing parsing options
*/
export declare function parse(str: string, options?: CookieParseOptions): Record<string, unknown>;
/**
* Serialize a cookie name-value pair into a `Set-Cookie` header string.
*
* @param name the name for the cookie
* @param value value to set the cookie to
* @param [options] object containing serialization options
* @throws {TypeError} when `maxAge` options is invalid
*/
export declare function serialize(name: string, value: string, options?: CookieSerializeOptions): string;