mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Added typings for "restify-cookies". (#20489)
* Added typings for "require-dir". * Fixed dtslint errors. * Fixed By field. * Added typings for "restify-cookies".
This commit is contained in:
committed by
Wesley Wigham
parent
6fa7178e81
commit
fad8178fc8
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for restify-cookies 0.2
|
||||
// Project: https://github.com/nathschmidt/restify-cookies
|
||||
// Definitions by: weekens <https://github.com/weekens>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as restify from 'restify';
|
||||
|
||||
declare module 'restify' {
|
||||
interface CookieOptions {
|
||||
encode?: (input: string) => string; // tslint:disable-line:prefer-method-signature
|
||||
maxAge?: number;
|
||||
domain?: string;
|
||||
path?: string;
|
||||
expires?: string;
|
||||
httpOnly?: boolean;
|
||||
secure?: boolean;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
setCookie(key: string, val: string, options?: CookieOptions): void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Request, Response, Server } from 'restify';
|
||||
import 'restify-cookies';
|
||||
|
||||
function test(server: Server) {
|
||||
server.get('/api/test', (req: Request, res: Response) => {
|
||||
res.setCookie('myCookie', 'test', { path: '/' });
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"restify-cookies-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user