@merkl/api 0.10.110 → 0.10.111

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ export declare enum TTLPresets {
2
+ MIN_1 = 60,
3
+ MIN_5 = 300,
4
+ MIN_10 = 600,
5
+ MIN_30 = 1800,
6
+ HOUR_1 = 3600,
7
+ HOUR_4 = 14400,
8
+ HOUR_8 = 28800,
9
+ HOUR_12 = 43200,
10
+ DAY_1 = 86400,
11
+ WEEK_1 = 604800,
12
+ MONTH_1 = 2592000
13
+ }
@@ -0,0 +1,4 @@
1
+ export declare abstract class CacheRepository {
2
+ static set(ttl: number, key: string, value: string): Promise<void>;
3
+ static get(key: string): Promise<string | null>;
4
+ }
@@ -0,0 +1,8 @@
1
+ export declare abstract class CacheService {
2
+ #private;
3
+ private static encoder;
4
+ private static decoder;
5
+ static wrap<Fn extends (...args: Args) => Promise<unknown>, Args extends unknown[], T extends Awaited<ReturnType<Fn>>>(ttl: number, fn: Fn, ...args: Args): Promise<T>;
6
+ static set<Fn extends (...args: Args) => Promise<unknown>, Args extends unknown[], T extends Awaited<ReturnType<Fn>>>(ttl: number, fn: Fn, ...args: Args): Promise<T>;
7
+ static get<Fn extends (...args: Args) => Promise<unknown>, Args extends unknown[], T extends Awaited<ReturnType<Fn>>>(fn: Fn, args: Args): Promise<T | null>;
8
+ }
@@ -0,0 +1 @@
1
+ export * from "./cache.service";