/// import 'isomorphic-fetch'; import { IncomingMessage, ServerResponse } from 'http'; import { SerializeOptions } from 'cookie'; export interface CookieOptions { encoded?: boolean; isJson?: boolean; } /** * Whether cookies set in response to this request should use the Secure * attribute. * * Secure is only left off outside production builds, for plain HTTP requests * to a loopback host such as http://localhost. Safari discards Secure cookies there, * unlike other browsers, which loses the login session right after logging in. * See https://bugs.webkit.org/show_bug.cgi?id=218980. Remove this exception * once supported versions of Safari treat loopback hosts as secure. */ export declare function shouldUseSecureCookies(req: IncomingMessage): boolean; export declare class Cookies { private request; private response?; private cookies; /** * Whether cookies for this request should use the Secure attribute. See * `shouldUseSecureCookies`. */ readonly secure: boolean; constructor(req: IncomingMessage, res?: ServerResponse); getCookie(key: string, options: CookieOptions & { isJson: true; }): any | undefined; getCookie(key: string, options?: CookieOptions): string | undefined; setCookie(key: string, value: string | Record, { encoded, isJson, ...serializeOptions }?: CookieOptions & SerializeOptions): void; removeCookie(key: string): void; }