/** * Represents a generic cookie. */ export interface IZCookie { /** * The cookie name. */ name: string; /** * The cookie value. */ value: string; /** * The scope domain attached to the cookie. */ domain?: string; /** * The utc formatted date at which the cookie expires */ expires?: string; /** * A flag that determines if this is a secure cookie. */ secure?: boolean; /** * A flag that determines if this cookie can be ready by javascript. */ httpOnly?: boolean; /** * A value that determines how the cookie is sent by the browser. */ sameSite?: "lax" | "strict" | "none"; } /** * Represents a builder for an IZCookie object. */ export declare class ZCookieBuilder { static readonly MillisecondsOneDay = 86400000; private _cookie; /** * Initializes a new instance of this object. */ constructor(); /** * Sets the cookie name. * * @param val - * The value to set. * * @returns * This object. */ name(val: string): this; /** * Sets the cookie value. * * @param val - * The value to set. * * @returns * This object. */ value(val: string): this; /** * Sets the cookie domain. * * @param val - * The value to set. * * @returns * This object. */ domain(val: string | undefined): this; /** * Sets the cookie expiration date. * * @param val - * The value to set. * * @returns * This object. */ expires(val: Date | string | undefined): this; /** * Sets the cookie expiration date to one day from the moment this is invoked. * * @returns * This object. */ expiresTomorrow(): this; /** * Removes the cookie expiration. * * @returns * This object. */ immortal: () => this; /** * Sets the cookie secure flag. * * @param val - * The value to set. * * @returns * This object. */ secure(val?: boolean): this; /** * Sets the cookie same site policy. * * @param val - * The value to set. * * @returns * This object. */ sameSite(val: "lax" | "strict" | "none"): this; /** * Sets the same site policy to 'lax' * * @returns * This object. */ lax: () => this; /** * Sets the same site polity to 'strict' * * @returns * This object. */ strict: () => this; /** * Sets the same site policy to 'none' and turns on the secure flag. * * @returns * This object. */ allowCrossSite(): this; /** * Sets the cookie http only flag. * * @param val - * The value to set. * * @returns * This object. */ httpOnly(val?: boolean): this; /** * Creates a token based authentication cookie. * * @param token - * The token value for the cookie. You * can leave this as undefined to set it * later. * * @returns * This object. */ authentication(token?: string): this; /** * Returns a copy of the built instance of the cookie. * * @returns * A shallow copy of the current cookie object. */ build(): IZCookie; }