/** * Strict argument parser for FT.* commands (SPEC_D D.13). * Args are Buffer[]; decode as UTF-8 and reject invalid UTF-8. */ /** Error messages always start with "ERR ", so `if (parsed.error)` narrows to the success shape. */ type ParseError = { error: `ERR ${string}`; }; type ParseResult = (T & { error?: undefined; }) | ParseError; /** * Parse FT.CREATE args: IndexName SCHEMA FieldSpec+ */ export declare function parseFtCreate(args: Buffer[]): ParseResult<{ indexName: string; fields: { name: string; type: string; }[]; }>; /** * Parse FT.INFO args: IndexName (exactly one token). */ export declare function parseFtInfo(args: Buffer[]): ParseResult<{ indexName: string; }>; /** * Parse FT.ADD args: IndexName DocId Score [REPLACE] FIELDS FieldValuePair+ * Field names are validated in handler against schema (after getIndexMeta). */ export declare function parseFtAdd(args: Buffer[]): ParseResult<{ indexName: string; docId: string; score: number; replace: boolean; fields: Record; }>; /** * Parse FT.DEL args: IndexName DocId */ export declare function parseFtDel(args: Buffer[]): ParseResult<{ indexName: string; docId: string; }>; /** * Parse FT.GET args: IndexName DocId (same doc id rules as FT.DEL) */ export declare function parseFtGet(args: Buffer[]): ParseResult<{ indexName: string; docId: string; }>; /** * Parse FT.SEARCH args: IndexName Query [NOCONTENT] [LIMIT offset count] [TIMEOUT ms] * TIMEOUT 0 disables the time budget for this query, as in RediSearch. */ export declare function parseFtSearch(args: Buffer[]): ParseResult<{ indexName: string; query: string; noContent: boolean; offset: number; count: number; timeoutMs?: number; }>; /** * Parse FT.SUGADD args: IndexName Term Score [INCR] [PAYLOAD payload] */ export declare function parseFtSugadd(args: Buffer[]): ParseResult<{ indexName: string; term: string; score: number; incr: boolean; payload?: string; }>; /** * Parse FT.SUGGET args: IndexName Prefix [MAX n] [WITHSCORES] [WITHPAYLOADS] [FUZZY] */ export declare function parseFtSugget(args: Buffer[]): ParseResult<{ indexName: string; prefix: string; max: number; withScores: boolean; withPayloads: boolean; }>; /** * Parse FT.SUGDEL args: IndexName Term */ export declare function parseFtSugdel(args: Buffer[]): ParseResult<{ indexName: string; term: string; }>; export {};