@types/node-fetch-cache 3.0.4 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node-fetch-cache/README.md +2 -62
- node-fetch-cache/package.json +5 -20
- node-fetch-cache/index.d.ts +0 -44
node-fetch-cache/README.md
CHANGED
|
@@ -1,63 +1,3 @@
|
|
|
1
|
-
#
|
|
2
|
-
> `npm install --save @types/node-fetch-cache`
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for node-fetch-cache (https://github.com/mistval/node-fetch-cache#readme).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch-cache.
|
|
9
|
-
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch-cache/index.d.ts)
|
|
10
|
-
````ts
|
|
11
|
-
import fetch, { Response } from "node-fetch";
|
|
1
|
+
This is a stub types definition for @types/node-fetch-cache (https://github.com/mistval/node-fetch-cache#readme).
|
|
12
2
|
|
|
13
|
-
|
|
14
|
-
ejectFromCache(): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface Cache {
|
|
18
|
-
get(key: string): Promise<any>;
|
|
19
|
-
remove(key: string): Promise<void>;
|
|
20
|
-
set(key: string, bodyStream: Response["body"], metaData: any): Promise<any>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface MemoryCacheOptions {
|
|
24
|
-
ttl?: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class MemoryCache implements Cache {
|
|
28
|
-
constructor(options?: MemoryCacheOptions);
|
|
29
|
-
get(key: string): Promise<any>;
|
|
30
|
-
remove(key: string): Promise<void>;
|
|
31
|
-
set(key: string, bodyStream: Response["body"], metaData: any): Promise<any>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface FileSystemCacheOptions {
|
|
35
|
-
ttl?: number;
|
|
36
|
-
cacheDirectory?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class FileSystemCache implements Cache {
|
|
40
|
-
constructor(options?: FileSystemCacheOptions);
|
|
41
|
-
get(key: string): Promise<any>;
|
|
42
|
-
remove(key: string): Promise<void>;
|
|
43
|
-
set(key: string, bodyStream: Response["body"], metaData: any): Promise<any>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
type FetchBuilder = (cache: Cache) => FetchCache;
|
|
47
|
-
type FetchCache = ((...args: Parameters<typeof fetch>) => Promise<NFCResponse>) & {
|
|
48
|
-
withCache: FetchBuilder;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
declare const defaultFetch: FetchCache;
|
|
52
|
-
export default defaultFetch;
|
|
53
|
-
|
|
54
|
-
export const fetchBuilder: FetchCache;
|
|
55
|
-
|
|
56
|
-
````
|
|
57
|
-
|
|
58
|
-
### Additional Details
|
|
59
|
-
* Last updated: Tue, 07 Nov 2023 09:09:39 GMT
|
|
60
|
-
* Dependencies: [@types/node-fetch](https://npmjs.com/package/@types/node-fetch)
|
|
61
|
-
|
|
62
|
-
# Credits
|
|
63
|
-
These definitions were written by [Yusuke Fujiki](https://github.com/fujikky).
|
|
3
|
+
node-fetch-cache provides its own type definitions, so you don't need @types/node-fetch-cache installed!
|
node-fetch-cache/package.json
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node-fetch-cache",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "TypeScript definitions for node-fetch-cache",
|
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch-cache",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": "Yusuke Fujiki",
|
|
10
|
-
"githubUsername": "fujikky",
|
|
11
|
-
"url": "https://github.com/fujikky"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
3
|
+
"version": "5.1.1",
|
|
4
|
+
"description": "Stub TypeScript definitions entry for node-fetch-cache, which provides its own types definitions",
|
|
14
5
|
"main": "",
|
|
15
|
-
"types": "index.d.ts",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
19
|
-
"directory": "types/node-fetch-cache"
|
|
20
|
-
},
|
|
21
6
|
"scripts": {},
|
|
7
|
+
"license": "MIT",
|
|
22
8
|
"dependencies": {
|
|
23
|
-
"
|
|
9
|
+
"node-fetch-cache": "*"
|
|
24
10
|
},
|
|
25
|
-
"
|
|
26
|
-
"typeScriptVersion": "4.5"
|
|
11
|
+
"deprecated": "This is a stub types definition. node-fetch-cache provides its own type definitions, so you do not need this installed."
|
|
27
12
|
}
|
node-fetch-cache/index.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import fetch, { Response } from "node-fetch";
|
|
2
|
-
|
|
3
|
-
declare class NFCResponse extends Response {
|
|
4
|
-
ejectFromCache(): Promise<void>;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface Cache {
|
|
8
|
-
get(key: string): Promise<any>;
|
|
9
|
-
remove(key: string): Promise<void>;
|
|
10
|
-
set(key: string, bodyStream: Response["body"], metaData: any): Promise<any>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface MemoryCacheOptions {
|
|
14
|
-
ttl?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class MemoryCache implements Cache {
|
|
18
|
-
constructor(options?: MemoryCacheOptions);
|
|
19
|
-
get(key: string): Promise<any>;
|
|
20
|
-
remove(key: string): Promise<void>;
|
|
21
|
-
set(key: string, bodyStream: Response["body"], metaData: any): Promise<any>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface FileSystemCacheOptions {
|
|
25
|
-
ttl?: number;
|
|
26
|
-
cacheDirectory?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export class FileSystemCache implements Cache {
|
|
30
|
-
constructor(options?: FileSystemCacheOptions);
|
|
31
|
-
get(key: string): Promise<any>;
|
|
32
|
-
remove(key: string): Promise<void>;
|
|
33
|
-
set(key: string, bodyStream: Response["body"], metaData: any): Promise<any>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
type FetchBuilder = (cache: Cache) => FetchCache;
|
|
37
|
-
type FetchCache = ((...args: Parameters<typeof fetch>) => Promise<NFCResponse>) & {
|
|
38
|
-
withCache: FetchBuilder;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
declare const defaultFetch: FetchCache;
|
|
42
|
-
export default defaultFetch;
|
|
43
|
-
|
|
44
|
-
export const fetchBuilder: FetchCache;
|