-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump node-cache to latest * update test * 2.16.1
- Loading branch information
1 parent
2bf9d23
commit e7ecb74
Showing
9 changed files
with
403 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,35 @@ | ||
// MOST Web Framework 2.0 Codename Blueshift BSD-3-Clause license Copyright (c) 2017-2022, THEMOST LP All rights reserved | ||
import {ConfigurationStrategy} from "@themost/common"; | ||
|
||
|
||
export declare interface DataCacheStrategyBase { | ||
add(key: string, value: any, absoluteExpiration?: number): Promise<any>; | ||
remove(key: string): Promise<any>; | ||
clear(): Promise<any>; | ||
get(key: string): Promise<any>; | ||
getOrDefault(key: string, getFunc: Promise<any>, absoluteExpiration?: number): Promise<any>; | ||
clear(): Promise<void>; | ||
get<T>(key: string): Promise<T>; | ||
getOrDefault<T>(key: string, getFunc: () => Promise<T>, absoluteExpiration?: number): Promise<T>; | ||
} | ||
|
||
export declare interface DataCacheFinalize extends DataCacheStrategyBase { | ||
finalize(): Promise<void>; | ||
} | ||
|
||
export declare class DataCache { | ||
init(callback: (err?: Error) => void): void; | ||
|
||
remove(key: string, callback: (err?: Error) => void): void; | ||
|
||
removeAll(callback: (err?: Error) => void): void; | ||
|
||
add(key: string, value: any, ttl?: number, callback?: (err?: Error) => void): void; | ||
|
||
ensure(key: string, getFunc: (err?: Error, res?: any) => void, callback?: (err?: Error) => void): void; | ||
|
||
get(key: string, callback?: (err?: Error, res?: any) => void): void; | ||
|
||
static getCurrent(): DataCache; | ||
} | ||
|
||
export declare abstract class DataCacheStrategy extends ConfigurationStrategy implements DataCacheStrategyBase { | ||
|
||
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, getFunc: Promise<any>, absoluteExpiration?: number): Promise<any>; | ||
abstract clear(): Promise<void>; | ||
abstract get<T>(key: string): Promise<T>; | ||
abstract getOrDefault<T>(key: string, getFunc: () => Promise<T>, absoluteExpiration?: number): Promise<T>; | ||
|
||
} | ||
|
||
export declare class DefaultDataCacheStrategy extends DataCacheStrategy implements DataCacheFinalize { | ||
|
||
add(key: string, value: any, absoluteExpiration?: number): Promise<any>; | ||
remove(key: string): Promise<any>; | ||
clear(): Promise<any>; | ||
get(key: string): Promise<any>; | ||
getOrDefault(key: string, getFunc: Promise<any>, absoluteExpiration?: number): Promise<any>; | ||
clear(): Promise<void>; | ||
get<T>(key: string): Promise<T>; | ||
getOrDefault<T>(key: string, getFunc: () => Promise<T>, absoluteExpiration?: number): Promise<T>; | ||
finalize(): Promise<void>; | ||
|
||
} |
Oops, something went wrong.