@types/cookie-parser
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -10,2 +10,16 @@ // Type definitions for cookie-parser 1.4 | ||
declare global { | ||
namespace Express { | ||
// Inject additional properties on express.Request | ||
interface Request { | ||
/** | ||
* This request's secret. | ||
* Optionally set by cookie-parser if secret(s) are provided. Can be used by other middleware. | ||
* [Declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to add your own properties. | ||
*/ | ||
secret?: string; | ||
} | ||
} | ||
} | ||
declare function cookieParser(secret?: string | string[], options?: cookieParser.CookieParseOptions): express.RequestHandler; | ||
@@ -12,0 +26,0 @@ |
{ | ||
"name": "@types/cookie-parser", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "TypeScript definitions for cookie-parser", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie-parser", | ||
"license": "MIT", | ||
@@ -19,3 +20,3 @@ "contributors": [ | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -30,4 +31,4 @@ "type": "git", | ||
}, | ||
"typesPublisherContentHash": "c7f1bd64948c00975ec74c2ebc516c33bdb987d6f802c2b45a3378a31f37bf4b", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "ec228e770576f43dd247dbfd15428c81cf1fbd84c02d978f6c4f0275d6394cf0", | ||
"typeScriptVersion": "3.9" | ||
} |
@@ -8,10 +8,54 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie-parser | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie-parser. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie-parser/index.d.ts) | ||
````ts | ||
// Type definitions for cookie-parser 1.4 | ||
// Project: https://github.com/expressjs/cookie-parser | ||
// Definitions by: Santi Albo <https://github.com/santialbo> | ||
// BendingBender <https://github.com/BendingBender> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
Additional Details | ||
* Last updated: Mon, 19 Aug 2019 00:51:10 GMT | ||
* Dependencies: @types/express | ||
import * as express from 'express'; | ||
declare global { | ||
namespace Express { | ||
// Inject additional properties on express.Request | ||
interface Request { | ||
/** | ||
* This request's secret. | ||
* Optionally set by cookie-parser if secret(s) are provided. Can be used by other middleware. | ||
* [Declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to add your own properties. | ||
*/ | ||
secret?: string; | ||
} | ||
} | ||
} | ||
declare function cookieParser(secret?: string | string[], options?: cookieParser.CookieParseOptions): express.RequestHandler; | ||
declare namespace cookieParser { | ||
interface CookieParseOptions { | ||
decode?(val: string): string; | ||
} | ||
function JSONCookie(jsonCookie: string): object | undefined; | ||
function JSONCookies<T extends { [key: string]: string }>(jsonCookies: T): { [P in keyof T]: object | undefined }; | ||
function signedCookie(cookie: string, secret: string | string[]): string | false; | ||
function signedCookies<T extends { [key: string]: string }>(cookies: T, secret: string | string[]): { [P in keyof T]?: string | false}; | ||
} | ||
export = cookieParser; | ||
```` | ||
### Additional Details | ||
* Last updated: Wed, 27 Apr 2022 10:31:34 GMT | ||
* Dependencies: [@types/express](https://npmjs.com/package/@types/express) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Santi Albo <https://github.com/santialbo>, and BendingBender <https://github.com/BendingBender>. | ||
These definitions were written by [Santi Albo](https://github.com/santialbo), and [BendingBender](https://github.com/BendingBender). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5974
31
0
61