mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[tough-cookie] Revert weak-type workaround.
This commit is contained in:
Vendored
+42
-62
@@ -65,11 +65,11 @@ export function permutePath(path: string): string[];
|
||||
// region Cookie
|
||||
|
||||
export class Cookie {
|
||||
static parse(cookieString: string, options?: Cookie.ParseOptions | object): Cookie | undefined;
|
||||
static parse(cookieString: string, options?: Cookie.ParseOptions): Cookie | undefined;
|
||||
|
||||
static fromJSON(strOrObj: string | object): Cookie | null;
|
||||
|
||||
constructor(properties?: Cookie.Properties | object);
|
||||
constructor(properties?: Cookie.Properties);
|
||||
|
||||
// TODO: Some of the following properties might actually be nullable.
|
||||
|
||||
@@ -115,34 +115,26 @@ export class Cookie {
|
||||
}
|
||||
|
||||
export namespace Cookie {
|
||||
interface ParseOptions extends Pick<ParseOptions._Impl, keyof ParseOptions._Impl> { }
|
||||
|
||||
namespace ParseOptions {
|
||||
interface _Impl {
|
||||
loose: boolean;
|
||||
}
|
||||
interface ParseOptions {
|
||||
loose?: boolean;
|
||||
}
|
||||
|
||||
interface Properties extends Pick<Properties._Impl, keyof Properties._Impl> { }
|
||||
interface Properties {
|
||||
key?: string;
|
||||
value?: string;
|
||||
expires?: Date;
|
||||
maxAge?: number | 'Infinity' | '-Infinity';
|
||||
domain?: string;
|
||||
path?: string;
|
||||
secure?: boolean;
|
||||
httpOnly?: boolean;
|
||||
extensions?: string[];
|
||||
creation?: Date;
|
||||
creationIndex?: number;
|
||||
|
||||
namespace Properties {
|
||||
interface _Impl {
|
||||
key: string;
|
||||
value: string;
|
||||
expires: Date;
|
||||
maxAge: number | 'Infinity' | '-Infinity';
|
||||
domain: string;
|
||||
path: string;
|
||||
secure: boolean;
|
||||
httpOnly: boolean;
|
||||
extensions: string[];
|
||||
creation: Date;
|
||||
creationIndex: number;
|
||||
|
||||
hostOnly: boolean;
|
||||
pathIsDefault: boolean;
|
||||
lastAccessed: Date;
|
||||
}
|
||||
hostOnly?: boolean;
|
||||
pathIsDefault?: boolean;
|
||||
lastAccessed?: Date;
|
||||
}
|
||||
|
||||
interface Serialized {
|
||||
@@ -162,27 +154,27 @@ export class CookieJar {
|
||||
|
||||
static fromJSON(string: string): CookieJar;
|
||||
|
||||
constructor(store?: Store, options?: CookieJar.Options | object);
|
||||
constructor(store?: Store, options?: CookieJar.Options);
|
||||
|
||||
setCookie(cookieOrString: Cookie | string, currentUrl: string, options: CookieJar.SetCookieOptions | object, cb: (err: Error | null, cookie: Cookie) => void): void;
|
||||
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;
|
||||
|
||||
setCookieSync(cookieOrString: Cookie | string, currentUrl: string, options: CookieJar.SetCookieOptions | object): void;
|
||||
setCookieSync(cookieOrString: Cookie | string, currentUrl: string, options: CookieJar.SetCookieOptions): void;
|
||||
|
||||
getCookies(currentUrl: string, options: CookieJar.GetCookiesOptions | object, cb: (err: Error | null, cookies: Cookie[]) => void): void;
|
||||
getCookies(currentUrl: string, options: CookieJar.GetCookiesOptions, cb: (err: Error | null, cookies: Cookie[]) => void): void;
|
||||
getCookies(currentUrl: string, cb: (err: Error | null, cookies: Cookie[]) => void): void;
|
||||
|
||||
getCookiesSync(currentUrl: string, options?: CookieJar.GetCookiesOptions | object): Cookie[];
|
||||
getCookiesSync(currentUrl: string, options?: CookieJar.GetCookiesOptions): Cookie[];
|
||||
|
||||
getCookieString(currentUrl: string, options: CookieJar.GetCookiesOptions | object, cb: (err: Error | null, cookies: string) => void): void;
|
||||
getCookieString(currentUrl: string, options: CookieJar.GetCookiesOptions, cb: (err: Error | null, cookies: string) => void): void;
|
||||
getCookieString(currentUrl: string, cb: (err: Error | null, cookies: string) => void): void;
|
||||
|
||||
getCookieStringSync(currentUrl: string, options?: CookieJar.GetCookiesOptions | object): string;
|
||||
getCookieStringSync(currentUrl: string, options?: CookieJar.GetCookiesOptions): string;
|
||||
|
||||
getSetCookieStrings(currentUrl: string, options: CookieJar.GetCookiesOptions | object, 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;
|
||||
|
||||
getSetCookieStringsSync(currentUrl: string, options?: CookieJar.GetCookiesOptions | object): string;
|
||||
getSetCookieStringsSync(currentUrl: string, options?: CookieJar.GetCookiesOptions): string;
|
||||
|
||||
serialize(cb: (err: Error | null, serializedObject: CookieJar.Serialized) => void): void;
|
||||
|
||||
@@ -197,36 +189,24 @@ export class CookieJar {
|
||||
}
|
||||
|
||||
export namespace CookieJar {
|
||||
interface Options extends Pick<Options._Impl, keyof Options._Impl> { }
|
||||
|
||||
namespace Options {
|
||||
interface _Impl {
|
||||
rejectPublicSuffixes: boolean;
|
||||
looseMode: boolean;
|
||||
}
|
||||
interface Options {
|
||||
rejectPublicSuffixes?: boolean;
|
||||
looseMode?: boolean;
|
||||
}
|
||||
|
||||
interface SetCookieOptions extends Pick<SetCookieOptions._Impl, keyof SetCookieOptions._Impl> { }
|
||||
|
||||
namespace SetCookieOptions {
|
||||
interface _Impl {
|
||||
http: boolean;
|
||||
secure: boolean;
|
||||
now: Date;
|
||||
ignoreError: boolean;
|
||||
}
|
||||
interface SetCookieOptions {
|
||||
http?: boolean;
|
||||
secure?: boolean;
|
||||
now?: Date;
|
||||
ignoreError?: boolean;
|
||||
}
|
||||
|
||||
interface GetCookiesOptions extends Pick<GetCookiesOptions._Impl, keyof GetCookiesOptions._Impl> { }
|
||||
|
||||
namespace GetCookiesOptions {
|
||||
interface _Impl {
|
||||
http: boolean;
|
||||
secure: boolean;
|
||||
date: Date;
|
||||
expire: boolean;
|
||||
allPoints: boolean;
|
||||
}
|
||||
interface GetCookiesOptions {
|
||||
http?: boolean;
|
||||
secure?: boolean;
|
||||
date?: Date;
|
||||
expire?: boolean;
|
||||
allPoints?: boolean;
|
||||
}
|
||||
|
||||
interface Serialized {
|
||||
|
||||
Reference in New Issue
Block a user