import type { CommandOptions } from "./command"; import { Command } from "./command"; export type ScriptFlushCommandOptions = | { sync: true; async?: never } | { sync?: never; async: true }; /** * @see https://redis.io/commands/script-flush * @see node_modules/@upstash/redis/docs/commands/scripts/script_flush.mdx */ export class ScriptFlushCommand extends Command<"OK", "OK"> { constructor([opts]: [opts?: ScriptFlushCommandOptions], cmdOpts?: CommandOptions<"OK", "OK">) { const cmd = ["script", "flush"]; if (opts?.sync) { cmd.push("sync"); } else if (opts?.async) { cmd.push("async"); } super(cmd, cmdOpts); } }