-
Notifications
You must be signed in to change notification settings - Fork 0
/
typedefs.js
47 lines (42 loc) · 1.12 KB
/
typedefs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/////////////////////////////////
// Begin Interface definitions //
/////////////////////////////////
/** Interface for classes that cache responses */
class ICache {
constructor() {}
/**
* Checks cache
*
* @param {String} key Cache key to get
* @param {Array} rest Additional args required for provided cache
*
* @returns {Promise<{}>}
*/
get(key, ...rest) {
throw new Error(`Not implemented: ${key}, ${rest}`);
}
/**
* Adds a cache value from Cayenne Core
*
* @param {String} key Cache key to set
* @param {{}} value Cache value
* @param {Array} rest Additional args required for provided cache
*
* @returns {Promise<Boolean>}
*/
set(key, value, ...rest) {
throw new Error(`Not implemented: ${key}, ${value}, ${rest}`);
}
/**
* Drops the value at provided cache key
*
* @param {String} key Cache key to drop
* @param {Array} rest Additional args required for provided caache function
*
* @returns {Promise<Boolean>}
*/
drop(key, ...rest) {
throw new Error(`Not implemented: ${key}, ${rest}`);
}
}
module.exports = { ICache };