diff --git a/src/index.ts b/src/index.ts index 617d4178..ad1a738f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -80,7 +80,11 @@ function createCookie( * @param options */ export function parseCookies( - ctx?: Pick | null | undefined, + ctx?: + | Pick + | { req: next.NextApiRequest } + | null + | undefined, options?: cookie.CookieParseOptions, ) { if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) { @@ -104,7 +108,11 @@ export function parseCookies( * @param options */ export function setCookie( - ctx: Pick | null | undefined, + ctx: + | Pick + | { res: next.NextApiResponse } + | null + | undefined, name: string, value: string, options: cookie.CookieSerializeOptions, @@ -152,7 +160,11 @@ export function setCookie( * @param options */ export function destroyCookie( - ctx: next.NextPageContext | null | undefined, + ctx: + | Pick + | { res: next.NextApiResponse } + | null + | undefined, name: string, options?: cookie.CookieSerializeOptions, ) {