import Store from "./store"; import LoopFrame from "../modules/time/frame"; import DPipeparallel from "./pipeparallel"; export interface ITriggerRecord { time: number; count: number; cycle: "day" | ""; } export declare class Joker { state: Store & Record; frame: LoopFrame; cache: Map; cacheTime: Map; setCache: (cacheId: string, cached: any) => boolean; hasCache: (id: string) => boolean; getCache: (id: string) => any; getCacheTime: (id: string) => number; removeCache: (id: string) => void; cacheId: (prefix: string) => string; /** * 触发次数记录 * @param id * @param options * @returns */ timesRecord: (id: string, options?: { cycle?: "day" | ""; mode?: "storage" | "running"; }) => any; /** * 检测是否可以触发 * @param id * @param options * @returns */ timesValid: (id: string, options?: { cycle?: "day" | ""; max?: number; interval?: number; mode?: "storage" | "running"; }) => boolean; /** * 清理触发次数数据 * @param mode * @returns */ timesClean: (mode?: "storage" | "running") => void; parallel: () => DPipeparallel; } declare const joker: Joker; export default joker;