Socket
Socket
Sign inDemoInstall

@types/tough-cookie

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/tough-cookie - npm Package Compare versions

Comparing version 2.3.6 to 4.0.0

75

tough-cookie/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for tough-cookie 2.3
// Type definitions for tough-cookie 4.0
// Project: https://github.com/salesforce/tough-cookie

@@ -9,2 +9,10 @@ // Definitions by: Leonard Thieu <https://github.com/leonard-thieu>

export const version: string;
export const PrefixSecurityEnum: Readonly<{
DISABLED: string;
SILENT: string;
STRICT: string;
}>;
/**

@@ -56,2 +64,7 @@ * Parse a cookie date string into a Date.

/**
* alias for Cookie.parse(cookieString[, options])
*/
export function parse(cookieString: string, options?: Cookie.ParseOptions): Cookie | undefined;
/**
* alias for Cookie.fromJSON(string)

@@ -65,8 +78,6 @@ */

export function permuteDomain(domain: string): string[];
export function permuteDomain(domain: string, allowSpecialUseDomain?: boolean): string[];
export function permutePath(path: string): string[];
// region Cookie
export class Cookie {

@@ -94,2 +105,3 @@ static parse(cookieString: string, options?: Cookie.ParseOptions): Cookie | undefined;

lastAccessed: Date | null;
sameSite: string;

@@ -100,7 +112,7 @@ toString(): string;

setExpires(String: string): void;
setExpires(exp: Date | string): void;
setMaxAge(number: number): void;
expiryTime(now?: number): number | typeof Infinity;
expiryTime(now?: number): number;

@@ -111,6 +123,10 @@ expiryDate(now?: number): Date;

canonicalizedDomain(): string;
isPersistent(): boolean;
cdomain(): string;
canonicalizedDomain(): string | null;
cdomain(): string | null;
inspect(): string;
toJSON(): { [key: string]: any; };

@@ -144,2 +160,3 @@

lastAccessed?: Date;
sameSite?: string;
}

@@ -152,7 +169,4 @@

// endregion
// region CookieJar
export class CookieJar {
static deserialize(serialized: CookieJar.Serialized | string, store?: Store): Promise<CookieJar>;
static deserialize(serialized: CookieJar.Serialized | string, store: Store, cb: (err: Error | null, object: CookieJar) => void): void;

@@ -167,7 +181,9 @@ static deserialize(serialized: CookieJar.Serialized | string, cb: (err: Error | null, object: CookieJar) => void): void;

setCookie(cookieOrString: Cookie | string, currentUrl: string, options?: CookieJar.SetCookieOptions): Promise<Cookie>;
setCookie(cookieOrString: Cookie | string, currentUrl: string, options: CookieJar.SetCookieOptions, cb: (err: Error | null, cookie: Cookie) => void): void;
setCookie(cookieOrString: Cookie | string, currentUrl: string, cb: (err: Error, cookie: Cookie) => void): void;
setCookie(cookieOrString: Cookie | string, currentUrl: string, cb: (err: Error | null, cookie: Cookie) => void): void;
setCookieSync(cookieOrString: Cookie | string, currentUrl: string, options?: CookieJar.SetCookieOptions): void;
setCookieSync(cookieOrString: Cookie | string, currentUrl: string, options?: CookieJar.SetCookieOptions): Cookie;
getCookies(currentUrl: string, options?: CookieJar.GetCookiesOptions): Promise<Cookie[]>;
getCookies(currentUrl: string, options: CookieJar.GetCookiesOptions, cb: (err: Error | null, cookies: Cookie[]) => void): void;

@@ -178,2 +194,3 @@ getCookies(currentUrl: string, cb: (err: Error | null, cookies: Cookie[]) => void): void;

getCookieString(currentUrl: string, options?: CookieJar.GetCookiesOptions): Promise<string>;
getCookieString(currentUrl: string, options: CookieJar.GetCookiesOptions, cb: (err: Error | null, cookies: string) => void): void;

@@ -184,7 +201,9 @@ getCookieString(currentUrl: string, cb: (err: Error | null, cookies: string) => void): void;

getSetCookieStrings(currentUrl: string, options: CookieJar.GetCookiesOptions, cb: (err: Error | null, cookies: string) => void): void;
getSetCookieStrings(currentUrl: string, cb: (err: Error | null, cookies: string) => void): void;
getSetCookieStrings(currentUrl: string, options?: CookieJar.GetCookiesOptions): Promise<string[]>;
getSetCookieStrings(currentUrl: string, options: CookieJar.GetCookiesOptions, cb: (err: Error | null, cookies: string[]) => void): void;
getSetCookieStrings(currentUrl: string, cb: (err: Error | null, cookies: string[]) => void): void;
getSetCookieStringsSync(currentUrl: string, options?: CookieJar.GetCookiesOptions): string;
getSetCookieStringsSync(currentUrl: string, options?: CookieJar.GetCookiesOptions): string[];
serialize(): Promise<CookieJar.Serialized>;
serialize(cb: (err: Error | null, serializedObject: CookieJar.Serialized) => void): void;

@@ -196,6 +215,12 @@

clone(store?: Store): Promise<CookieJar>;
clone(store: Store, cb: (err: Error | null, newJar: CookieJar) => void): void;
clone(cb: (err: Error | null, newJar: CookieJar) => void): void;
cloneSync(store: Store): CookieJar;
cloneSync(store?: Store): CookieJar;
removeAllCookies(): Promise<void>;
removeAllCookies(cb: (err: Error | null) => void): void;
removeAllCookiesSync(): void;
}

@@ -205,4 +230,6 @@

interface Options {
allowSpecialUseDomain?: boolean;
looseMode?: boolean;
rejectPublicSuffixes?: boolean;
looseMode?: boolean;
prefixSecurity?: string;
}

@@ -233,10 +260,8 @@

// endregion
export abstract class Store {
synchronous: boolean;
// region Store
export abstract class Store {
findCookie(domain: string, path: string, key: string, cb: (err: Error | null, cookie: Cookie | null) => void): void;
findCookies(domain: string, path: string, cb: (err: Error | null, cookie: Cookie[]) => void): void;
findCookies(domain: string, path: string, allowSpecialUseDomain: boolean, cb: (err: Error | null, cookie: Cookie[]) => void): void;

@@ -255,3 +280,1 @@ putCookie(cookie: Cookie, cb: (err: Error | null) => void): void;

export class MemoryCookieStore extends Store { }
// endregion
{
"name": "@types/tough-cookie",
"version": "2.3.6",
"version": "4.0.0",
"description": "TypeScript definitions for tough-cookie",

@@ -32,4 +32,4 @@ "license": "MIT",

"dependencies": {},
"typesPublisherContentHash": "f99963c45ef837887ac7831d070f874eb7ced3aded2d0a245b0d5cb7b7bf937e",
"typesPublisherContentHash": "ca0d31f2e9fc2a883ed38f569a7c21cb47c3ad66089c59faa840a59b14c0daf5",
"typeScriptVersion": "2.8"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Fri, 06 Dec 2019 06:02:13 GMT
* Last updated: Tue, 31 Mar 2020 23:35:07 GMT
* Dependencies: none

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Leonard Thieu (https://github.com/leonard-thieu), LiJinyao (https://github.com/LiJinyao), and Michael Wei (https://github.com/no2chem).
These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu), [LiJinyao](https://github.com/LiJinyao), and [Michael Wei](https://github.com/no2chem).
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