-
Notifications
You must be signed in to change notification settings - Fork 1
/
cache.d.ts
40 lines (22 loc) · 1.1 KB
/
cache.d.ts
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
// @themost-framework 2.0 Codename Blueshift Copyright (c) 2017-2025, THEMOST LP All rights reserved
import {HttpApplicationService} from "./types";
import * as NodeCache from "node-cache";
export declare abstract class CacheStrategy extends HttpApplicationService {
abstract add(key: string, value: any, absoluteExpiration?: number): Promise<any>;
abstract remove(key: string): Promise<any>;
abstract clear(): Promise<any>;
abstract get(key: string): Promise<any>;
abstract getOrDefault(key: string, fn: Promise<any>, absoluteExpiration?: number): Promise<any>;
abstract finalize(): Promise<void>;
abstract finalizeAsync(): Promise<void>;
}
export declare class DefaultCacheStrategy extends CacheStrategy {
get rawCache(): NodeCache;
add(key: string, value: any, absoluteExpiration?: number): Promise<any>;
clear(): Promise<any>;
get(key: string): Promise<any>;
getOrDefault(key: string, fn: Promise<any>, absoluteExpiration?: number): Promise<any>;
remove(key: string): Promise<any>;
finalize(): Promise<void>;
finalizeAsync(): Promise<void>;
}