mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
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.
This commit is contained in:
Vendored
+4
@@ -16,6 +16,10 @@ declare module 'restify' {
|
||||
secure?: boolean;
|
||||
}
|
||||
|
||||
interface Request {
|
||||
cookies: any;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
setCookie(key: string, val: string, options?: CookieOptions): void;
|
||||
}
|
||||
|
||||
@@ -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: '/' });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user