index.d.ts 763 B

1234567891011121314151617181920212223242526272829
  1. /// <reference types="node" />
  2. /**
  3. * Redis command list
  4. *
  5. * All commands are lowercased.
  6. */
  7. export declare const list: string[];
  8. /**
  9. * Check if the command exists
  10. */
  11. export declare function exists(commandName: string): boolean;
  12. /**
  13. * Check if the command has the flag
  14. *
  15. * Some of possible flags: readonly, noscript, loading
  16. */
  17. export declare function hasFlag(commandName: string, flag: string): boolean;
  18. /**
  19. * Get indexes of keys in the command arguments
  20. *
  21. * @example
  22. * ```javascript
  23. * getKeyIndexes('set', ['key', 'value']) // [0]
  24. * getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]
  25. * ```
  26. */
  27. export declare function getKeyIndexes(commandName: string, args: (string | Buffer | number)[], options?: {
  28. parseExternalKey: boolean;
  29. }): number[];