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 |
|
15 |
|
16 | export declare class TTLConfig<T extends TTLConfig.Options, P extends JsonMap> extends ConfigFile<T, TTLConfig.Contents<P>> {
|
17 | set(key: string, value: Partial<TTLConfig.Entry<P>>): void;
|
18 | getLatestEntry(): Nullable<[string, TTLConfig.Entry<P>]>;
|
19 | getLatestKey(): Nullable<string>;
|
20 | isExpired(dateTime: number, value: P & {
|
21 | timestamp: string;
|
22 | }): boolean;
|
23 | protected init(): Promise<void>;
|
24 | private timestamp;
|
25 | }
|
26 | export declare namespace TTLConfig {
|
27 | type Options = ConfigFile.Options & {
|
28 | ttl: Duration;
|
29 | };
|
30 | type Entry<T extends JsonMap> = T & {
|
31 | timestamp: string;
|
32 | };
|
33 | type Contents<T extends JsonMap> = Record<string, Entry<T>>;
|
34 | }
|