From cfbaa7d5181cd9f25ca9c64f84121d0385400103 Mon Sep 17 00:00:00 2001 From: Viktor Isaev Date: Mon, 16 Oct 2017 23:46:17 +0300 Subject: [PATCH] Updated typings for "restify-cookies". (#20548) * Added typings for "require-dir". * Fixed dtslint errors. * Fixed By field. * Added typings for "restify-cookies". * Added "cookies" field to Request interface. --- types/restify-cookies/index.d.ts | 4 ++++ types/restify-cookies/restify-cookies-tests.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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: '/' }); }); }