diff --git a/packages/engine.io/lib/contrib/cookie.types.d.ts b/packages/engine.io/lib/contrib/types.cookie.ts similarity index 80% rename from packages/engine.io/lib/contrib/cookie.types.d.ts rename to packages/engine.io/lib/contrib/types.cookie.ts index 78c2b2fe6..7e546707e 100644 --- a/packages/engine.io/lib/contrib/cookie.types.d.ts +++ b/packages/engine.io/lib/contrib/types.cookie.ts @@ -115,48 +115,3 @@ export interface CookieSerializeOptions { */ secure?: boolean | undefined; } - -/** - * Additional parsing options - */ -export interface CookieParseOptions { - /** - * Specifies a function that will be used to decode a cookie's value. Since - * the value of a cookie has a limited character set (and must be a simple - * string), this function can be used to decode a previously-encoded cookie - * value into a JavaScript string or other object. - * - * The default function is the global `decodeURIComponent`, which will decode - * any URL-encoded sequences into their byte representations. - * - * *Note* if an error is thrown from this function, the original, non-decoded - * cookie value will be returned as the cookie's value. - */ - decode?(value: string): string; -} - -/** - * 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 function parse( - str: string, - options?: CookieParseOptions, -): Record; - -/** - * 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 function serialize( - name: string, - value: string, - options?: CookieSerializeOptions, -): string; diff --git a/packages/engine.io/lib/server.ts b/packages/engine.io/lib/server.ts index 24576b131..bf53f994a 100644 --- a/packages/engine.io/lib/server.ts +++ b/packages/engine.io/lib/server.ts @@ -17,7 +17,7 @@ import type { Duplex } from "stream"; import { WebTransport } from "./transports/webtransport"; import { createPacketDecoderStream } from "engine.io-parser"; import type { EngineRequest } from "./transport"; -import { CookieSerializeOptions } from "./contrib/cookie.types"; +import type { CookieSerializeOptions } from "./contrib/types.cookie"; const debug = debugModule("engine");