diff --git a/types/restify-cookies/index.d.ts b/types/restify-cookies/index.d.ts index 842e6c425e..7e794855cb 100644 --- a/types/restify-cookies/index.d.ts +++ b/types/restify-cookies/index.d.ts @@ -16,6 +16,10 @@ declare module 'restify' { secure?: boolean; } + interface Request { + cookies: any; + } + interface Response { setCookie(key: string, val: string, options?: CookieOptions): void; } diff --git a/types/restify-cookies/restify-cookies-tests.ts b/types/restify-cookies/restify-cookies-tests.ts index e6a68e5689..6ca7d9965c 100644 --- a/types/restify-cookies/restify-cookies-tests.ts +++ b/types/restify-cookies/restify-cookies-tests.ts @@ -3,6 +3,6 @@ import 'restify-cookies'; function test(server: Server) { server.get('/api/test', (req: Request, res: Response) => { - res.setCookie('myCookie', 'test', { path: '/' }); + res.setCookie('myCookie', 'test' + req.cookies.foo, { path: '/' }); }); }