/// import { CommandParser } from "@redis/client/dist/lib/client/parser"; import { TsIgnoreOptions } from "./ADD"; import { ArrayReply, BlobStringReply, DoubleReply, MapReply, NullReply, NumberReply, ReplyUnion, Resp2Reply, RespType, TuplesReply, TypeMapping, UnwrapReply } from "@redis/client/dist/lib/RESP/types"; import { RedisVariadicArgument } from "@redis/client/dist/lib/commands/generic-transformers"; export declare function parseIgnoreArgument(parser: CommandParser, ignore?: TsIgnoreOptions): void; export declare function parseRetentionArgument(parser: CommandParser, retention?: number): void; export declare const TIME_SERIES_ENCODING: { readonly COMPRESSED: "COMPRESSED"; readonly UNCOMPRESSED: "UNCOMPRESSED"; }; export type TimeSeriesEncoding = typeof TIME_SERIES_ENCODING[keyof typeof TIME_SERIES_ENCODING]; export declare function parseEncodingArgument(parser: CommandParser, encoding?: TimeSeriesEncoding): void; export declare function parseChunkSizeArgument(parser: CommandParser, chunkSize?: number): void; export declare const TIME_SERIES_DUPLICATE_POLICIES: { readonly BLOCK: "BLOCK"; readonly FIRST: "FIRST"; readonly LAST: "LAST"; readonly MIN: "MIN"; readonly MAX: "MAX"; readonly SUM: "SUM"; }; export type TimeSeriesDuplicatePolicies = typeof TIME_SERIES_DUPLICATE_POLICIES[keyof typeof TIME_SERIES_DUPLICATE_POLICIES]; export declare function parseDuplicatePolicy(parser: CommandParser, duplicatePolicy?: TimeSeriesDuplicatePolicies): void; export type Timestamp = number | Date | string; export declare function transformTimestampArgument(timestamp: Timestamp): string; /** * Options shared by every `TS.RANGE`-family command, emitted in canonical order * before the optional `ALIGN`/`AGGREGATION` tail (which differs per command). */ export interface TsRangeCommonOptions { LATEST?: boolean; FILTER_BY_TS?: Array; FILTER_BY_VALUE?: { min: number; max: number; }; COUNT?: number; } /** * Pushes `fromTimestamp toTimestamp [LATEST] [FILTER_BY_TS ...] [FILTER_BY_VALUE ...] [COUNT ...]`, * the portion common to `TS.RANGE`, `TS.REVRANGE`, their multi-aggregation variants, and * `TS.NRANGE`/`TS.NREVRANGE`. Callers append their own `ALIGN`/`AGGREGATION` tail. */ export declare function parseRangeCommonArguments(parser: CommandParser, fromTimestamp: Timestamp, toTimestamp: Timestamp, options?: TsRangeCommonOptions): void; /** * Pushes the bare `EXCLUDEEMPTY` flag for `TS.MRANGE`/`TS.MREVRANGE` when requested. * The flag omits matching series with an empty samples array from the reply. It is * not valid on single-key `TS.RANGE`/`TS.REVRANGE` nor combinable with `GROUPBY`. * * @since Redis 8.10 */ export declare function parseExcludeEmptyArgument(parser: CommandParser, excludeEmpty?: boolean): void; export type Labels = { [label: string]: string; }; export declare function parseLabelsArgument(parser: CommandParser, labels?: Labels): void; export type SampleRawReply = TuplesReply<[timestamp: NumberReply, value: DoubleReply]>; export declare const transformSampleReply: { 2(reply: RespType<42, [NumberReply, BlobStringReply], never, [NumberReply, BlobStringReply]>): { timestamp: NumberReply; value: number; }; 3(reply: SampleRawReply): { timestamp: NumberReply; value: DoubleReply; }; }; export declare const transformNullableSampleReply: { 2(reply: Resp2Reply | SampleRawReply>): { timestamp: NumberReply; value: number; } | null; 3(reply: TuplesReply<[]> | SampleRawReply): { timestamp: NumberReply; value: DoubleReply; } | null; }; export type SamplesRawReply = ArrayReply; export declare const transformSamplesReply: { 2(reply: RespType<42, RespType<42, [NumberReply, BlobStringReply], never, [NumberReply, BlobStringReply]>[], never, RespType<42, [NumberReply, BlobStringReply], never, [NumberReply, BlobStringReply]>[]>): { timestamp: NumberReply; value: number; }[]; 3(reply: SamplesRawReply): { timestamp: NumberReply; value: DoubleReply; }[]; }; export type MultiAggregationSampleRawReply = TuplesReply<[ timestamp: NumberReply, ...values: Array ]>; export declare const transformMultiAggregationSampleReply: { 2(reply: RespType<42, [NumberReply, ...BlobStringReply[]], never, [NumberReply, ...BlobStringReply[]]>): { timestamp: NumberReply; values: number[]; }; 3(reply: MultiAggregationSampleRawReply): { timestamp: NumberReply; values: DoubleReply[]; }; }; export type MultiAggregationSamplesRawReply = ArrayReply; export declare const transformMultiAggregationSamplesReply: { 2(reply: RespType<42, RespType<42, [NumberReply, ...BlobStringReply[]], never, [NumberReply, ...BlobStringReply[]]>[], never, RespType<42, [NumberReply, ...BlobStringReply[]], never, [NumberReply, ...BlobStringReply[]]>[]>): { timestamp: NumberReply; values: number[]; }[]; 3(reply: MultiAggregationSamplesRawReply): { timestamp: NumberReply; values: DoubleReply[]; }[]; }; /** * A single timestamp-major pivot row as returned by `TS.NRANGE` / `TS.NREVRANGE`: * `[timestamp, [value_for_key_0, value_for_key_1, ...]]`. The value array preserves * the input key order; a missing cell is surfaced as `NaN`. */ export type PivotSampleRawReply = TuplesReply<[ timestamp: NumberReply, values: ArrayReply ]>; export type PivotSamplesRawReply = ArrayReply; export declare const transformPivotSamplesReply: { 2(reply: RespType<42, RespType<42, [NumberReply, RespType<42, BlobStringReply[], never, BlobStringReply[]>], never, [NumberReply, RespType<42, BlobStringReply[], never, BlobStringReply[]>]>[], never, RespType<42, [NumberReply, RespType<42, BlobStringReply[], never, BlobStringReply[]>], never, [NumberReply, RespType<42, BlobStringReply[], never, BlobStringReply[]>]>[]>): { timestamp: NumberReply; values: number[]; }[]; 3(reply: PivotSamplesRawReply): { timestamp: NumberReply; values: ArrayReply>; }[]; }; export declare function resp2MapToValue]>, TRANSFORMED>(wrappedReply: ArrayReply, parseFunc: (rawValue: UnwrapReply) => TRANSFORMED, typeMapping?: TypeMapping): MapReply; export declare function resp3MapToValue, // TODO: simplify types TRANSFORMED>(wrappedReply: MapReply, parseFunc: (rawValue: UnwrapReply) => TRANSFORMED): MapReply; export declare function parseSelectedLabelsArguments(parser: CommandParser, selectedLabels: RedisVariadicArgument): void; /** * Pushes the optional `FILTER filterExpr [filterExpr ...]` tail shared by the * `TS.QUERYLABELS` forms. Omitting `filter` queries all indexed series; passing * an explicitly empty array is a local usage error rather than a silent widen to * all series (the server also rejects a bare `FILTER` token). Expressions are * sent verbatim — not parsed, reordered, or deduplicated. */ export declare function parseQueryLabelsFilterArgument(parser: CommandParser, filter?: RedisVariadicArgument): void; export type RawLabelValue = BlobStringReply | NullReply; export type RawLabels = ArrayReply>; export declare function transformRESP2Labels(labels: RawLabels, typeMapping?: TypeMapping): MapReply; export declare function transformRESP2LabelsWithSources(labels: RawLabels, typeMapping?: TypeMapping): { labels: MapReply, T>; sources: string[] | Buffer[]; }; //# sourceMappingURL=helpers.d.ts.map