1 Star 2 Fork 0

MacXiang/egg-cache

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
itf.d.ts 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
MacXiang 提交于 2021-04-16 09:48 +08:00 . 1.0.1-13修复 根目录没有logs时报错.
export interface oa {
[propName: string]: any;
}
export declare function mkdir(path: string): void;
export declare class LOG {
private dir;
private suffix;
constructor(filePath?: string, suffix?: string);
getPath(filePath?: string): string;
getFileName(p: string): string;
readLog(file: string): oa[] | undefined;
write(file: string, data: any, line?: number, insert?: boolean): void;
get newLog(): string;
}
interface cacheSign {
pid: number;
sign: string;
path: string[];
}
export interface setCache extends cacheSign {
value: any;
push?: any;
}
/** 读取方法method值 【比特位】 如下:
* @1: 读取后删除; 设置比特位2时无效
* @2: 读取_tmkTimeData数据时有效,根据传递path的第二个元素查找history子项,返回拥有此参数的父级key
*/
export interface getCache extends cacheSign {
method: number;
}
export interface delCache extends cacheSign {
pop?: any;
}
export declare type ns = number | string;
export interface funGetCache {
(param: undefined | ns | ns[]): Promise<oa>;
}
export interface funSetCache {
(node: ns | ns[], data: any): Promise<boolean>;
}
export interface funDelCache {
(node: ns | ns[]): Promise<boolean>;
}
export interface HistoryS {
[node: string]: Array<any>;
}
export interface TmkTimeData {
time?: number;
rooms: string[];
history?: HistoryS;
[node: string]: any;
}
export interface Cache {
_tmkTimeData: {
[node: string]: TmkTimeData;
};
[node: string]: any;
}
export {};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/MacXiang/egg-cache.git
git@gitee.com:MacXiang/egg-cache.git
MacXiang
egg-cache
egg-cache
master

搜索帮助