// src/preload/index.d.ts export interface ConnectionConfig { id: string name: string host: string port: number auth: string username: string tls: boolean tlsCaPath: string tlsCertPath: string tlsKeyPath: string tlsRejectUnauthorized: boolean sshEnabled: boolean sshHost: string sshPort: number sshUsername: string sshPassword: string sshPrivateKeyPath: string sshPassphrase: string cluster: boolean sentinelEnabled: boolean sentinelHost: string sentinelPort: number sentinelMasterName: string sentinelNodePassword: string separator: string order: number createdAt: number color?: string } export interface ElectronAPI { window: { minimize: () => void maximize: () => void close: () => void } theme: { get: () => Promise set: (theme: 'system' | 'dark' | 'light') => void onOsUpdated: (callback: (isDark: boolean) => void) => void } dialog: { openFile: (options: { title?: string; filters?: { name: string; extensions: string[] }[] }) => Promise<{ path: string; content: string } | null> } credential: { encrypt: (text: string) => Promise decrypt: (encoded: string) => Promise } storage: { getConnections: () => Promise saveConnection: (conn: ConnectionConfig) => Promise deleteConnection: (id: string) => Promise reorderConnections: (ids: string[]) => Promise getSettings: () => Promise saveSettings: (settings: any) => Promise } redis: { connect: (id: string, opts: any) => Promise<{ success: boolean; error?: string }> disconnect: (id: string) => Promise execute: (id: string, command: string, args: string[]) => Promise getInfo: (id: string) => Promise scanKeys: (id: string, cursor: string, pattern: string, count: number) => Promise<{ cursor: string; keys: string[] }> getKeyType: (id: string, key: string) => Promise getKeyTTL: (id: string, key: string) => Promise getString: (id: string, key: string) => Promise setString: (id: string, key: string, value: string) => Promise rejsonGet: (id: string, key: string, path: string) => Promise rejsonSet: (id: string, key: string, path: string, value: string) => Promise deleteKey: (id: string, key: string) => Promise hashScan: (id: string, key: string, cursor: string, count: number) => Promise<{ cursor: string; fields: [string, string][] }> hashSet: (id: string, key: string, field: string, value: string) => Promise hashDel: (id: string, key: string, field: string) => Promise setTTL: (id: string, key: string, ttl: number) => Promise selectDb: (id: string, db: number) => Promise dbSize: (id: string) => Promise listRange: (id: string, key: string, start: number, stop: number) => Promise listLength: (id: string, key: string) => Promise listPush: (id: string, key: string, values: string[]) => Promise listSet: (id: string, key: string, index: number, value: string) => Promise listRemove: (id: string, key: string, count: number, value: string) => Promise setMembers: (id: string, key: string) => Promise setSize: (id: string, key: string) => Promise setAdd: (id: string, key: string, members: string[]) => Promise setRemove: (id: string, key: string, members: string[]) => Promise zsetRange: (id: string, key: string, start: number, stop: number, withScores: boolean) => Promise zsetSize: (id: string, key: string) => Promise zsetAdd: (id: string, key: string, score: number, member: string) => Promise zsetRemove: (id: string, key: string, members: string[]) => Promise slowLogGet: (id: string, count: number) => Promise slowLogLen: (id: string) => Promise memoryUsage: (id: string, key: string) => Promise batchDelete: (id: string, keys: string[]) => Promise streamInfo: (id: string, key: string) => Promise streamRange: (id: string, key: string, start: string, end: string, count: number) => Promise streamAdd: (id: string, key: string, streamId: string, fieldValues: string[]) => Promise streamTrim: (id: string, key: string, maxLen: number) => Promise streamDel: (id: string, key: string, ids: string[]) => Promise streamGroups: (id: string, key: string) => Promise streamConsumers: (id: string, key: string, group: string) => Promise streamGroupCreate: (id: string, key: string, group: string, startId: string, mkstream: boolean) => Promise streamGroupDestroy: (id: string, key: string, group: string) => Promise streamAck: (id: string, key: string, group: string, ids: string[]) => Promise renameKey: (id: string, oldKey: string, newKey: string) => Promise existsKey: (id: string, key: string) => Promise ping: (id: string) => Promise isConnected: (id: string) => Promise getCommandLog: () => Promise clearCommandLog: () => Promise decodeValue: (value: string, format: string) => Promise detectFormat: (value: string) => Promise customFormat: (value: string, command: string, key: string) => Promise subscribe: (id: string, channels: string[], isPattern: boolean) => Promise<{ success: boolean; error?: string }> unsubscribe: (id: string) => Promise onSubscribeMessage: (callback: (msg: any) => void) => void monitor: (id: string) => Promise<{ success: boolean; error?: string }> monitorStop: (id: string) => Promise onMonitorMessage: (callback: (msg: any) => void) => void } updater: { check: () => Promise<{ available: boolean; version?: string }> download: () => Promise<{ success: boolean; error?: string }> install: () => void onStatus: (callback: (status: any) => void) => void } } declare global { interface Window { electronAPI: ElectronAPI } }