Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/cookies

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/cookies - npm Package Compare versions

Comparing version 0.5.30 to 0.6.0

129

cookies/index.d.ts

@@ -1,41 +0,51 @@

// Type definitions for cookie-parser v0.5.1
// Type definitions for cookies 0.6
// Project: https://github.com/pillarjs/cookies
// Definitions by: Wang Zishi <https://github.com/WangZishi/>
// Definitions by: Wang Zishi <https://github.com/WangZishi/>, jKey Lu <https://github.com/jkeylu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from 'http';
import * as Keygrip from 'keygrip';
declare interface Cookies {
secure: boolean;
request: IncomingMessage;
response: ServerResponse;
import * as http from "http"
/**
* This extracts the cookie with the given name from the
* Cookie header in the request. If such a cookie exists,
* its value is returned. Otherwise, nothing is returned.
*/
get(name: string, opts?: Cookies.GetOption): string;
declare namespace cookies {
interface ICookies {
/**
* This extracts the cookie with the given name from the
* Cookie header in the request. If such a cookie exists,
* its value is returned. Otherwise, nothing is returned.
*/
get(name: string): string;
/**
* This extracts the cookie with the given name from the
* Cookie header in the request. If such a cookie exists,
* its value is returned. Otherwise, nothing is returned.
*/
get(name: string, opts: IOptions): string;
/**
* This sets the given cookie in the response and returns
* the current context to allow chaining.If the value is omitted,
* an outbound header with an expired date is used to delete the cookie.
*/
set(name: string, value?: string, opts?: Cookies.SetOption): this;
}
/**
* This sets the given cookie in the response and returns
* the current context to allow chaining.If the value is omitted,
* an outbound header with an expired date is used to delete the cookie.
*/
set(name: string, value: string): ICookies;
/**
* This sets the given cookie in the response and returns
* the current context to allow chaining.If the value is omitted,
* an outbound header with an expired date is used to delete the cookie.
*/
set(name: string, value: string, opts: IOptions): ICookies;
declare namespace Cookies {
/**
* for backward-compatibility
*/
export type ICookies = Cookies;
/**
* for backward-compatibility
*/
export type IOptions = SetOption;
export interface Option {
keys: string[] | Keygrip;
secure?: boolean;
}
interface IOptions {
export interface GetOption {
signed: boolean;
}
export interface SetOption {
/**

@@ -64,4 +74,3 @@ * a number representing the milliseconds from Date.now() for expiry

/**
* a boolean indicating whether the cookie is only to be sent
* over HTTPS (use this if you handle SSL not in your node process).
* "secureProxy" option is deprecated; use "secure" option, provide "secure" to constructor if needed
*/

@@ -91,11 +100,57 @@ secureProxy?: boolean;

}
export type CookieAttr = SetOption;
export interface Cookie {
name: string;
value: string;
/**
* "maxage"" is deprecated, use "maxAge" instead
*/
maxage: number;
maxAge: number;
expires: Date;
path: string;
domain: string;
secure: boolean;
httpOnly: boolean;
overwrite: boolean;
toString(): string;
toHeader(): string;
}
}
interface CookiesStatic {
new (request: http.IncomingMessage, response: http.ServerResponse): cookies.ICookies;
new (request: http.IncomingMessage, response: http.ServerResponse, keys?: Array<string>): cookies.ICookies;
declare interface CookiesFunction {
(request: IncomingMessage, response: ServerResponse, options?: Cookies.Option): Cookies;
/**
* "options" array of key strings is deprecated, provide using options {"keys": keygrip}
*/
// tslint:disable-next-line:unified-signatures
(request: IncomingMessage, response: ServerResponse, options: string[]): Cookies;
/**
* "options" instance of Keygrip is deprecated, provide using options {"keys": keygrip}
*/
// tslint:disable-next-line:unified-signatures
(request: IncomingMessage, response: ServerResponse, options: Keygrip): Cookies;
new (request: IncomingMessage, response: ServerResponse, options?: Cookies.Option): Cookies;
/**
* "options" array of key strings is deprecated, provide using options {"keys": keygrip}
*/
// tslint:disable-next-line:unified-signatures
new (request: IncomingMessage, response: ServerResponse, options: string[]): Cookies;
/**
* "options" instance of Keygrip is deprecated, provide using options {"keys": keygrip}
*/
// tslint:disable-next-line:unified-signatures
new (request: IncomingMessage, response: ServerResponse, options: Keygrip): Cookies;
Cookie: {
new (name: string, value?: string, attrs?: Cookies.CookieAttr): Cookies.Cookie;
};
}
declare const cookies: CookiesStatic;
declare const Cookies: CookiesFunction;
export = cookies
export = Cookies;
{
"name": "@types/cookies",
"version": "0.5.30",
"description": "TypeScript definitions for cookie-parser v0.5.1",
"version": "0.6.0",
"description": "TypeScript definitions for cookies",
"license": "MIT",
"author": "Wang Zishi <https://github.com/WangZishi/>",
"author": "Wang Zishi <https://github.com/WangZishi/>, jKey Lu <https://github.com/jkeylu>",
"main": "",

@@ -14,6 +14,8 @@ "repository": {

"dependencies": {
"@types/keygrip": "*",
"@types/node": "*"
},
"typings": "index.d.ts",
"typesPublisherContentHash": "85c3325f41be9194559424a61bd59eef985132e2764a039ccfe4426588603d25"
"peerDependencies": {},
"typesPublisherContentHash": "7b1edb6a235916a104c3e6d0738c1c94983aecb712b9f7e07d33ae40b2432744",
"typeScriptVersion": "2.0"
}

@@ -5,15 +5,13 @@ # Installation

# Summary
This package contains type definitions for cookie-parser v0.5.1 (https://github.com/pillarjs/cookies).
This package contains type definitions for cookies (https://github.com/pillarjs/cookies).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/cookies
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cookies
Additional Details
* Last updated: Mon, 19 Sep 2016 16:15:24 GMT
* File structure: ProperModule
* Library Dependencies: node
* Module Dependencies: http
* Global values: cookies
* Last updated: Wed, 11 Jan 2017 17:17:27 GMT
* Dependencies: http, keygrip, node
* Global values: none
# Credits
These definitions were written by Wang Zishi <https://github.com/WangZishi/>.
These definitions were written by Wang Zishi <https://github.com/WangZishi/>, jKey Lu <https://github.com/jkeylu>.
{
"authors": "Wang Zishi <https://github.com/WangZishi/>",
"definitionFilename": "index.d.ts",
"libraryDependencies": [
"node"
],
"moduleDependencies": [
"http"
],
"libraryMajorVersion": "0",
"libraryMinorVersion": "5",
"libraryName": "cookie-parser v0.5.1",
"typingsPackageName": "cookies",
"projectName": "https://github.com/pillarjs/cookies",
"name": "cookies",
"libraryName": "cookies",
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
"sourceBranch": "types-2.0",
"kind": "ProperModule",
"globals": [
"cookies"
],
"declaredModules": [
"cookies"
],
"files": [
"index.d.ts"
],
"hasPackageJson": false,
"contentHash": "85c3325f41be9194559424a61bd59eef985132e2764a039ccfe4426588603d25"
"data": {
"authors": "Wang Zishi <https://github.com/WangZishi/>, jKey Lu <https://github.com/jkeylu>",
"dependencies": {
"http": "*",
"keygrip": "*",
"node": "*"
},
"libraryMajorVersion": 0,
"libraryMinorVersion": 6,
"typeScriptVersion": "2.0",
"libraryName": "cookies",
"typingsPackageName": "cookies",
"projectName": "https://github.com/pillarjs/cookies",
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
"globals": [],
"declaredModules": [
"cookies/."
],
"files": [
"index.d.ts"
],
"hasPackageJson": false,
"contentHash": "7b1edb6a235916a104c3e6d0738c1c94983aecb712b9f7e07d33ae40b2432744"
},
"isLatest": true
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc