CacheTimestampsModel.d.ts
1.43 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import '../_version.js';
/**
* Returns the timestamp model.
*
* @private
*/
declare class CacheTimestampsModel {
private readonly _cacheName;
private readonly _db;
/**
*
* @param {string} cacheName
*
* @private
*/
constructor(cacheName: string);
/**
* Should perform an upgrade of indexedDB.
*
* @param {Event} event
*
* @private
*/
private _handleUpgrade;
/**
* @param {string} url
* @param {number} timestamp
*
* @private
*/
setTimestamp(url: string, timestamp: number): Promise<void>;
/**
* Returns the timestamp stored for a given URL.
*
* @param {string} url
* @return {number}
*
* @private
*/
getTimestamp(url: string): Promise<number>;
/**
* Iterates through all the entries in the object store (from newest to
* oldest) and removes entries once either `maxCount` is reached or the
* entry's timestamp is less than `minTimestamp`.
*
* @param {number} minTimestamp
* @param {number} maxCount
* @return {Array<string>}
*
* @private
*/
expireEntries(minTimestamp: number, maxCount?: number): Promise<string[]>;
/**
* Takes a URL and returns an ID that will be unique in the object store.
*
* @param {string} url
* @return {string}
*
* @private
*/
private _getId;
}
export { CacheTimestampsModel };