49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
|
import type { LLMConfig, DocumentMetadata } from './types';
|
||
|
|
||
|
interface Directory {
|
||
|
name: string;
|
||
|
path: string;
|
||
|
}
|
||
|
|
||
|
declare global {
|
||
|
interface Window {
|
||
|
electron: {
|
||
|
// File System Operations
|
||
|
startWatching: (dirPath: string) => Promise<void>;
|
||
|
stopWatching: (dirPath: string) => Promise<void>;
|
||
|
addExcludedPath: (path: string) => Promise<void>;
|
||
|
|
||
|
// LLM Operations
|
||
|
queryLLM: (question: string) => Promise<{
|
||
|
answer: string;
|
||
|
sources: DocumentMetadata[];
|
||
|
}>;
|
||
|
updateLLMConfig: (config: LLMConfig) => Promise<void>;
|
||
|
getLLMConfig: () => Promise<LLMConfig>;
|
||
|
getOllamaModels: () => Promise<{ success: boolean; data?: string[]; error?: string }>;
|
||
|
|
||
|
// Vector Store Operations
|
||
|
getDocuments: () => Promise<{ success: boolean; data?: DocumentMetadata[]; error?: string }>;
|
||
|
addDocument: (content: string, metadata: DocumentMetadata) => Promise<void>;
|
||
|
deleteDocument: (path: string) => Promise<void>;
|
||
|
updateDocument: (content: string, metadata: DocumentMetadata) => Promise<void>;
|
||
|
|
||
|
// File Processing
|
||
|
processFile: (filePath: string) => Promise<void>;
|
||
|
|
||
|
// System Paths
|
||
|
getUserHome: () => Promise<{ success: boolean; data?: string; error?: string }>;
|
||
|
getAppPath: () => Promise<string>;
|
||
|
|
||
|
// Directory Operations
|
||
|
listDirectories: (dirPath: string) => Promise<{ success: boolean; data?: Directory[]; error?: string }>;
|
||
|
|
||
|
// Event Handling
|
||
|
on: (channel: string, callback: (event: unknown, ...args: any[]) => void) => void;
|
||
|
off: (channel: string, callback: (event: unknown, ...args: any[]) => void) => void;
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export {};
|