@types/cookiejar
- Version 2.1.5
- Published
- 7.23 kB
- No dependencies
- MIT license
Install
npm i @types/cookiejar
yarn add @types/cookiejar
pnpm add @types/cookiejar
Overview
TypeScript definitions for cookiejar
Index
Classes
class Cookie
class Cookie {}
constructor
constructor( cookie: string | Cookie, requestDomain?: string, requestPath?: string);
It turns input into a Cookie (singleton if given a Cookie), the request_domain argument is used to default the domain if it is not explicit in the cookie string, the request_path argument is used to set the path if it is not explicit in a cookie String.
Explicit domains/paths will cascade, implied domains/paths must exactly match (see http://en.wikipedia.org/wiki/HTTP_cookie#Domain_and_Pat).
Parameter cookie
string or a cookie to work on
Parameter requestDomain
string argument is used to default the domain if it is not explicit in the cookie string
Parameter requestPath
string argument is used to set the path if it is not explicit in a cookie String
property domain
domain: string;
property expiration_date
expiration_date: number;
property explicit_domain
explicit_domain: boolean;
property explicit_path
explicit_path: boolean;
property name
name: string;
property noscript
noscript: boolean;
property path
path: string;
property secure
secure: boolean;
property value
value: string;
method collidesWith
collidesWith: (cookie: Cookie) => boolean;
returns true if the cookies cannot exist in the same space (domain and path match)
Parameter cookie
Cookie
method matches
matches: (accessInfo: CookieAccessInfo) => boolean;
returns true if the access_info allows retrieval of this cookie
Parameter accessInfo
CookieAccessInfo
method parse
parse: (cookie: string, requestDomain?: string, requestPath?: string) => Cookie;
parses the string onto this cookie or a new one if called directly
Parameter cookie
string to be parsed into a Cookie
Parameter requestDomain
string definind the requesting domain
Parameter requestPath
string defining the requesting path
method toString
toString: () => string;
the set-cookie: string for this cookie
method toValueString
toValueString: () => string;
the cookie: string for this cookie
class CookieAccessInfo
class CookieAccessInfo {}
constructor
constructor(domain: string, path?: string, secure?: boolean, script?: boolean);
Class to determine matching qualities of a cookie
Parameter domain
string domain to match
Parameter path
string path to match
Parameter secure
boolean access is secure (ssl generally)
Parameter script
boolean access is from a script
property All
static All: CookieAccessInfo;
property domain
domain: string;
property path
path: string;
property script
script: boolean;
property secure
secure: boolean;
class CookieJar
class CookieJar {}
constructor
constructor();
class to hold numerous cookies from multiple domains correctly
method getCookie
getCookie: ( cookieName: string, accessInfo: CookieAccessInfo) => Cookie | undefined;
get a cookie with the name and access_info matching
Parameter cookieName
string to be parsed into a Cookie
Parameter accessInfo
CookieAccessInfo
method getCookies
getCookies: ( accessInfo: CookieAccessInfo) => readonly Cookie[] & { toValueString(): string };
grab all cookies matching this access_info
Parameter accessInfo
CookieAccessInfo
method setCookie
setCookie: ( cookie: string | Cookie, requestDomain?: string, requestPath?: string) => Cookie | false;
modify (or add if not already-existing) a cookie to the jar
Parameter cookie
string | Cookie
Parameter requestDomain
string argument is used to default the domain if it is not explicit in the cookie string
Parameter requestPath
string argument is used to set the path if it is not explicit in a cookie String
method setCookies
setCookies: ( cookie: string | readonly string[], requestDomain?: string, requestPath?: string) => Cookie[];
modify (or add if not already-existing) a large number of cookies to the jar
Parameter cookie
string or list of strings defining cookies
Parameter requestDomain
string argument is used to default the domain if it is not explicit in the cookie string
Parameter requestPath
string argument is used to set the path if it is not explicit in a cookie String
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/cookiejar
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/cookiejar)
- HTML<a href="https://www.jsdocs.io/package/@types/cookiejar"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2273 ms. - Missing or incorrect documentation? Open an issue for this package.