UNPKG

@zenweb/cache

Version:
25 lines (24 loc) 756 B
import { Redis, RedisKey, RedisValue } from 'ioredis'; import { CacheKeyType } from './types.js'; export declare const debug: import("@zenweb/core").Debugger; /** * Promise 等待 * @param ms 毫秒 * @returns */ export declare function sleep(ms: number): Promise<void>; /** * 执行 Redis Lua 脚本 * @param redis Redis 实例 * @param hash 脚本 sha1 hash * @param script 脚本代码 * @param keys 输入键 * @param values 输入值 * @returns 执行结果 */ export declare function runRedisScript(redis: Redis, hash: string, script: string, keys: RedisKey[], values?: RedisValue[]): Promise<unknown>; /** * 生成一个参数缓存key * - 多个元素用 : 连接 */ export declare function cacheKey(...key: CacheKeyType[]): string;