tough-cookie-file-store
Version:
A JSON file store for tough-cookie module
24 lines (23 loc) • 968 B
TypeScript
import type { CookiesIndex } from '../cookies-index.js';
export type ParseCookiesJsonOptions = {
filePath?: string;
};
/**
* Parses the text of a cookies json file.
* @param {string} data - The json string to parse
* @param {object} options - Options for parsing the cookies
* @returns {CookiesIndex} the parsed cookies index
*/
export declare function parseCookiesJson(data: string, options?: ParseCookiesJsonOptions): CookiesIndex;
/**
* Processes the json object of a cookies json file, converting cookie objects to tough.Cookie instances
* @param {any} data - The json object to parse
* @returns {CookiesIndex} the parsed cookies index
*/
export declare function parseCookiesJsonObject(data: any): CookiesIndex;
/**
* Serializes a cookies index to json
* @param {CookiesIndex} cookies - The cookies index to serialize
* @returns {string} the serialized cookies index
*/
export declare function stringifyCookiesJson(cookies: CookiesIndex): string;