feat(plugins): implement plugin loading and management system
- Added PluginLoader component to dynamically load and initialize plugins. - Created Plugins component for managing installed and marketplace plugins. - Introduced PluginAPI for plugin interaction and settings management. - Defined types for plugin metadata, installed plugins, and plugin index. - Implemented settings rendering for plugins based on their schema. - Integrated marketplace plugin fetching and installation logic. - Added support for enabling/disabling and uninstalling plugins.
This commit is contained in:
Vendored
+30
@@ -33,3 +33,33 @@ declare module '*.svg' {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
interface PluginAPI {
|
||||
getPath: () => Promise<{ success: boolean; data?: string; error?: string }>;
|
||||
download: (
|
||||
pluginId: string,
|
||||
downloadUrl: string,
|
||||
name: string
|
||||
) => Promise<{ success: boolean; data?: { path: string }; error?: string }>;
|
||||
list: () => Promise<{
|
||||
success: boolean;
|
||||
data?: Array<{ id: string; name: string; installedDate: string; path: string }>;
|
||||
error?: string;
|
||||
}>;
|
||||
uninstall: (pluginId: string) => Promise<{ success: boolean; error?: string }>;
|
||||
readPluginCode: (pluginId: string) => Promise<{ success: boolean; data?: string; error?: string }>;
|
||||
}
|
||||
|
||||
interface ElectronAPI {
|
||||
platform?: string;
|
||||
arch?: string;
|
||||
plugins?: PluginAPI;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electron?: ElectronAPI;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
Reference in New Issue
Block a user