@leyyo/cache
Version:
Common cache library
39 lines (38 loc) • 2.34 kB
TypeScript
import { CacheInvalidator, CacheInvalidatorResult, CacheInvalidatorSecure } from "./types";
import { CacheChannel } from "../channel";
import { Id, TR } from "../types";
export declare class CacheInvalidatorImpl<A extends TR, N extends Id> implements CacheInvalidator<A>, CacheInvalidatorSecure<A> {
protected readonly channel: CacheChannel<A, N>;
constructor(channel: CacheChannel<A, N>);
private _disabled;
private _ignore;
private _grabId;
private _add;
private _addMore;
private _addFromRelationsSelf;
private _addFromRelationsRemote;
private _addFromRelationsGroup;
private _addFromRelations;
private _delete;
private _deleteMore;
failed<T>(error: string | Error, keys?: Array<string>, command?: string): CacheInvalidatorResult<A, T>;
success<T>(result: T, keys?: Array<string>, command?: string): CacheInvalidatorResult<A, T>;
disabledArray<T>(cmd?: string): CacheInvalidatorResult<A, Array<T>>;
disabledFalse(cmd?: string): CacheInvalidatorResult<A, boolean>;
disabledText(cmd?: string): CacheInvalidatorResult<A, string>;
disabledNull<T>(cmd?: string): CacheInvalidatorResult<A, T>;
disabledRecord<T>(cmd?: string): CacheInvalidatorResult<A, Record<string, T>>;
disabledTrue(cmd?: string): CacheInvalidatorResult<A, boolean>;
disabledNumber<N extends number = number>(v1?: N | string, v2?: string): CacheInvalidatorResult<A, N>;
ignoreArray<T>(error?: string | Error, cmd?: string): CacheInvalidatorResult<A, Array<T>>;
ignoreFalse(error?: string | Error, cmd?: string): CacheInvalidatorResult<A, boolean>;
ignoreText(error?: string | Error, cmd?: string): CacheInvalidatorResult<A, string>;
ignoreNull<T>(error?: string | Error, cmd?: string): CacheInvalidatorResult<A, T>;
ignoreRecord<T>(error?: string | Error, cmd?: string): CacheInvalidatorResult<A, Record<string, T>>;
ignoreTrue(error?: string | Error, cmd?: string): CacheInvalidatorResult<A, boolean>;
ignoreNumber<N extends number = number>(v1: N | string | Error, v2?: string | Error, v3?: string): CacheInvalidatorResult<A, N>;
get $back(): CacheInvalidator<A>;
get $secure(): CacheInvalidatorSecure<A>;
protected _notify(fullDataKey: string, basicIds: Array<string>, idOwner?: string): void;
protected _invalidate(basicId: string): void;
}