import { SmpAbstractRxjsTtlCacheStrategy } from '@tonysamperi/ts-mapi-core/rxjs'; import { Observable } from 'rxjs'; /** * Extend this to make your own injectables. * You just need to provide the "raw" flush/read/remove/write implementations. * They will be called through the flush/read/remove/write methods. * You can also customise such methods, but remember they hold the TTL logic, so you might need to access the source code to avoid losing the TTL handling. * * @example * * ```ts * @Injectable() * export class MyCacheStrategy extends SmpCacheInterceptorStrategy { * * protected _memory: Map = new Map(); * * protected _flushRaw(): Observable { * return of(void 0).pipe(map(() => this._memory.clear()); * } * * protected _readRaw(_key_: string): Observable { * // READ * } * * protected _removeRaw(_key_: string): Observable { * // REMOVE * } * * protected _writeRaw(_key_: string, _value_: unknown): Observable { * // WRITE * } * } * ``` */ declare class SmpCacheInterceptorStrategy extends SmpAbstractRxjsTtlCacheStrategy { constructor(); removeByPrefix(_prefix_: string): Observable; protected _flushRaw(): Observable; protected _readRaw(_key_: string): Observable; protected _removeRaw(_key_: string): Observable; protected _writeRaw(_key_: string, _value_: unknown): Observable; } export { SmpCacheInterceptorStrategy as S };