1 | import { Duration } from '@salesforce/kit';
|
2 | import { JsonMap, Nullable } from '@salesforce/ts-types';
|
3 | import { ConfigFile } from './configFile';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export declare class TTLConfig<T extends TTLConfig.Options, P extends JsonMap> extends ConfigFile<T, TTLConfig.Contents<P>> {
|
15 | set(key: string, value: Partial<TTLConfig.Entry<P>>): void;
|
16 | getLatestEntry(): Nullable<[string, TTLConfig.Entry<P>]>;
|
17 | getLatestKey(): Nullable<string>;
|
18 | isExpired(dateTime: number, value: P & {
|
19 | timestamp: string;
|
20 | }): boolean;
|
21 | protected init(): Promise<void>;
|
22 | private timestamp;
|
23 | }
|
24 | export declare namespace TTLConfig {
|
25 | type Options = ConfigFile.Options & {
|
26 | ttl: Duration;
|
27 | };
|
28 | type Entry<T extends JsonMap> = T & {
|
29 | timestamp: string;
|
30 | };
|
31 | type Contents<T extends JsonMap> = Record<string, Entry<T>>;
|
32 | }
|