@grouparoo/core
Version:
The Grouparoo Core
18 lines (17 loc) • 777 B
TypeScript
import { Includeable } from "sequelize";
declare type StatefulCachedModel = {
state: string;
};
declare type FindAllWithCache<T extends StatefulCachedModel> = (modelId?: string, state?: T["state"]) => Promise<T[]>;
declare type FindOneWithCache<T extends StatefulCachedModel> = (value: string, modelId?: string, state?: T["state"], lookupKey?: keyof T) => Promise<T>;
export declare class ModelCache<T extends StatefulCachedModel> {
TTL: number;
expires: number;
instances: T[];
findAllWithCache: FindAllWithCache<T>;
findOneWithCache: FindOneWithCache<T>;
include: () => Includeable[];
constructor(findAllWithCache: FindAllWithCache<T>, findOneWithCache: FindOneWithCache<T>, include: () => Includeable[]);
invalidate(): void;
}
export {};