mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
Added typings for tough-cookie-filestore
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
// Type definitions for tough-cookie-filestore 0.0
|
||||
// Project: https://github.com/mitsuru/tough-cookie-filestore
|
||||
// Definitions by: Christian Friedow <https://github.com/friedow>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Cookie {
|
||||
domain: string;
|
||||
path: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
export default class FileCookieStore {
|
||||
idx: {
|
||||
[domain: string]: {
|
||||
[path: string]: {
|
||||
[key: string]: Cookie,
|
||||
},
|
||||
},
|
||||
};
|
||||
filePath: string;
|
||||
synchronous: boolean;
|
||||
|
||||
constructor(filePath: string);
|
||||
|
||||
inspect(): string;
|
||||
|
||||
findCookie(domain: string, path: string, key: string, cb: (whatever: null, cookie: Cookie | null | undefined) => void): void;
|
||||
|
||||
findCookies(domain: string, path: string, cb: (whatever: null, cookies: Cookie[]) => void): void;
|
||||
|
||||
putCookie(cookie: Cookie, path: string, key: string, cb: (whatever: null) => void): void;
|
||||
|
||||
updateCookie(oldCookie: Cookie, newCookie: Cookie, cb: (whatever: null) => void): void;
|
||||
|
||||
removeCookie(domain: string, path: string, key: string, cb: (whatever: null) => void): void;
|
||||
|
||||
removeCookies(domain: string, path: string, cb: (whatever: null) => void): void;
|
||||
|
||||
saveToFile(filePath: string, data: any, cb: () => void): void;
|
||||
|
||||
loadFromFile(filePath: string, cb: (data: any) => void): void;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import FileCookieStore from 'tough-cookie-filestore';
|
||||
|
||||
const cookiestore = new FileCookieStore('cookies.json');
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"tough-cookie-filestore-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user