///
///
import { ConnectionOptions } from "tls";
import { MemcacheConnection } from "./lib/connection";
export declare type CommandCallback = (conn: MemcacheConnection) => void;
export interface CompressorLibrary {
compressSync(payload?: {
input: string | number | Buffer | Record;
}): Buffer;
decompressSync(payload: {
input: string | number | Buffer;
}): string | Buffer;
}
export declare type SingleServerEntry = {
server: string;
maxConnections?: number;
};
export declare type MultipleServerEntry = {
servers: Array;
};
declare type Serverconfig = {
retryFailedServerInterval: number;
failedServerOutTime: number;
keepLastServer?: boolean;
};
export declare type ServerDefinition = {
server: SingleServerEntry | MultipleServerEntry;
config: Serverconfig;
};
export declare type ResolveCallback = (result: T) => void;
export declare type RejectCallback = (error: Error) => void;
export declare type ErrorFirstCallback = (error?: Error | null, data?: any) => void;
export declare type PackedData = {
flag: number;
data: string | Buffer;
cmdTokens: number[];
cmd?: string;
};
export declare type MemcacheClientOptions = {
server: ServerDefinition | SingleServerEntry | MultipleServerEntry | string;
ignoreNotStored?: boolean;
lifetime?: number;
noDelay?: boolean;
cmdTimeout?: number;
connectTimeout?: number;
keepAlive?: number | false;
keepDangleSocket?: boolean;
dangleSocketWaitTimeout?: number;
compressor?: CompressorLibrary;
logger?: any;
Promise?: PromiseConstructor;
tls?: ConnectionOptions;
};
export declare type CommandContext = {
error?: Error | null;
results: Record;
callback: ErrorFirstCallback;
};
export declare type QueuedCommandContext = CommandContext & {
queuedTime: number;
};
export declare type ConnectionError = Error & {
connecting?: boolean;
};
export {};