import { MastraStorage } from '@mastra/core/storage'; import type { StorageDomains } from '@mastra/core/storage'; import type { RedisClient, RedisConfig } from './types.js'; /** * Redis storage adapter for Mastra. * * Provides storage functionality for direct Redis connections using the official redis package. * * Access domain-specific storage via `getStore()`: * * @example * ```typescript * // Using connection string * const storage = new RedisStore({ * id: 'my-store', * connectionString: 'redis://localhost:6379', * }); * * // Using host/port * const storage = new RedisStore({ * id: 'my-store', * host: 'localhost', * port: 6379, * password: 'secret', * }); * * // Access memory domain * const memory = await storage.getStore('memory'); * await memory?.saveThread({ thread }); * * // Access workflows domain * const workflows = await storage.getStore('workflows'); * await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot }); * ``` * * @example * ```typescript * // Using a pre-configured client for advanced features * import { createClient } from 'redis'; * * const client = createClient({ * url: 'redis://localhost:6379', * socket: { * reconnectStrategy: (retries) => Math.min(retries * 50, 2000), * }, * }); * await client.connect(); * * const storage = new RedisStore({ * id: 'my-store', * client, * }); * ``` */ export declare class RedisStore extends MastraStorage { private client; private shouldManageConnection; stores: StorageDomains; constructor(config: RedisConfig); init(): Promise; getClient(): RedisClient; close(): Promise; private createClient; private createClientUrl; } //# sourceMappingURL=store.d.ts.map