@leyyo/cache
Version:
Common cache library
23 lines (22 loc) • 1.35 kB
TypeScript
import { CacheClient } from "../client";
import { CacheEntity, CacheEntityDef, CacheEntityInfo, CacheEntityProp, CacheEntityPropData, CacheEntityPropLambda, CacheEntitySecure } from "./types";
import { CacheSegment } from "../segment";
import { CacheChannel, CacheChannelDef, CacheChannelPropLambda } from "../channel";
import { CacheInfoCheck, Id, TR } from "../types";
export declare abstract class CacheEntityAbstract<A extends TR> implements CacheEntity<A>, CacheEntitySecure<A> {
protected readonly _channels: Array<CacheChannelDef>;
readonly path: string;
readonly id: string;
readonly segment: CacheSegment;
readonly defaultClient: CacheClient;
readonly prop: Readonly<CacheEntityProp<A>>;
protected constructor(segment: CacheSegment, path: string, prop: CacheEntityPropData<A>, id: string, defaultClient: CacheClient);
get channels(): Array<CacheChannel<A, Id>>;
newChannel<B extends TR = A, N extends Id = Id>(path: string, fn: CacheChannelPropLambda<B>, id?: string, differentClient?: CacheClient): CacheChannel<B, N>;
info(check: CacheInfoCheck): Promise<CacheEntityInfo>;
changeProp(lambda: CacheEntityPropLambda<A>): void;
get $flat(): CacheEntityDef;
get $secure(): CacheEntitySecure<A>;
get $back(): CacheEntity<A>;
$setProp(prop: Partial<CacheEntityPropData<A>>): void;
}