| 276 | }; |
| 277 | |
| 278 | interface AppActions { |
| 279 | // Auth actions |
| 280 | setUser: (user: GitHubUser | null) => void; |
| 281 | setGitHubToken: (token: string | null) => void; |
| 282 | logout: () => void; |
| 283 | |
| 284 | // Repository actions |
| 285 | setRepositories: (repos: Repository[]) => void; |
| 286 | updateRepository: (repo: Repository) => void; |
| 287 | /** 批量更新多个仓库的指定字段,保留当前过滤的 searchResults 不被重置 */ |
| 288 | updateRepositoriesMetadata: (updates: { id: number; patch: Partial<Repository> }[]) => void; |
| 289 | addRepository: (repo: Repository) => void; |
| 290 | setLoading: (loading: boolean) => void; |
| 291 | setSyncingStars: (syncing: boolean) => void; |
| 292 | setLastSync: (timestamp: string) => void; |
| 293 | deleteRepository: (repoId: number) => void; |
| 294 | setAnalyzingRepository: (repoId: number, isAnalyzing: boolean) => void; |
| 295 | |
| 296 | // Gist actions |
| 297 | setGists: (gists: Gist[]) => void; |
| 298 | setStarredGists: (gists: Gist[]) => void; |
| 299 | updateGist: (gist: Gist) => void; |
| 300 | deleteGist: (gistId: string) => void; |
| 301 | setGistSearchFilters: (filters: Partial<GistSearchFilters>) => void; |
| 302 | setGistSearchResults: (results: Gist[]) => void; |
| 303 | setSelectedGistCategory: (category: GistCategoryId) => void; |
| 304 | setAnalyzingGist: (gistId: string, isAnalyzing: boolean) => void; |
| 305 | |
| 306 | // AI actions |
| 307 | addAIConfig: (config: AIConfig) => void; |
| 308 | updateAIConfig: (id: string, updates: Partial<AIConfig>) => void; |
| 309 | deleteAIConfig: (id: string) => void; |
| 310 | setActiveAIConfig: (id: string | null) => void; |
| 311 | setAIConfigs: (configs: AIConfig[]) => void; |
| 312 | |
| 313 | // WebDAV actions |
| 314 | addWebDAVConfig: (config: WebDAVConfig) => void; |
| 315 | updateWebDAVConfig: (id: string, updates: Partial<WebDAVConfig>) => void; |
| 316 | deleteWebDAVConfig: (id: string) => void; |
| 317 | setActiveWebDAVConfig: (id: string | null) => void; |
| 318 | setWebDAVConfigs: (configs: WebDAVConfig[]) => void; |
| 319 | setLastBackup: (timestamp: string) => void; |
| 320 | |
| 321 | // Embedding actions |
| 322 | addEmbeddingConfig: (config: EmbeddingConfig) => void; |
| 323 | updateEmbeddingConfig: (id: string, updates: Partial<EmbeddingConfig>) => void; |
| 324 | deleteEmbeddingConfig: (id: string) => void; |
| 325 | setActiveEmbeddingConfig: (id: string | null) => void; |
| 326 | setEmbeddingConfigs: (configs: EmbeddingConfig[]) => void; |
| 327 | |
| 328 | // Vector Search actions |
| 329 | setVectorSearchConfig: (config: Partial<VectorSearchConfig>) => void; |
| 330 | setVectorSearchStatus: (status: VectorSearchStatus | undefined) => void; |
| 331 | setVectorIndexingState: (state: Partial<VectorIndexingState>) => void; |
| 332 | |
| 333 | // Search actions |
| 334 | setSearchFilters: (filters: Partial<SearchFilters>) => void; |
| 335 | setSearchResults: (results: Repository[]) => void; |
nothing calls this directly
no outgoing calls
no test coverage detected