UNPKG

@creditkarma/memcached

Version:

A fully featured Memcached API client, supporting both single and clustered Memcached servers through consistent hashing and failover/failure. Memcached is rewrite of nMemcached, which will be deprecated in the near future.

27 lines (26 loc) 1.19 kB
import { CallbackFunction, Key } from './types'; export declare type NativeConstructor = StringConstructor | NumberConstructor | FunctionConstructor | ArrayConstructor | BooleanConstructor | ObjectConstructor; export declare type ValidationItem = [ string, NativeConstructor ]; export declare type ValidationItems = Array<ValidationItem>; export declare type CommandType = 'touch' | 'get' | 'gets' | 'delete' | 'stats cachedump' | 'set' | 'replace' | 'add' | 'cas' | 'append' | 'prepend' | 'incr' | 'decr' | 'version' | 'flush_all' | 'stats' | 'stats settings' | 'stats slabs' | 'stats items'; export declare type CommandCompiler = (noreply?: boolean) => CommandOptions; export interface IMemcachedCommand { key: Key; value: any; callback: CallbackFunction; lifetime: number; validate: ValidationItems; type: CommandType; command: string; redundancyEnabled: boolean; multi: boolean; cas: string; start: number; execution: number; } export declare const DEFAULT_COMMAND: IMemcachedCommand; export declare type CommandOptions = Partial<IMemcachedCommand>; export declare function makeCommand(options: CommandOptions): IMemcachedCommand;