Louis 96dba2690d feat: class-based plugin manager
chore: add facades

refactor: core module export

refactor: inference plugin - deprecate function registering (#537)

* refactor: revamp inference plugin as class - deprecate function registering

* refactor: monitoring plugin - deprecate service registering (#538)

refactor: revamp inference plugin as class - deprecate function registering

chore: update import

refactor: plugin revamp - model management

chore: update build steps and remove experimental plugins

refactor: remove pluggable electron

chore: add sorting for conversations

chore: build plugins for testing

chore: consistent plugin directory name

chore: docs

chore: fix CI

chore: update conversation prefix
2023-11-06 13:46:01 +07:00

44 lines
1.2 KiB
TypeScript

import { PluginType } from "@janhq/core";
import { MonitoringPlugin } from "@janhq/core/lib/plugins";
import { executeOnMain } from "@janhq/core";
/**
* JanMonitoringPlugin is a plugin that provides system monitoring functionality.
* It implements the MonitoringPlugin interface from the @janhq/core package.
*/
export default class JanMonitoringPlugin implements MonitoringPlugin {
/**
* Returns the type of the plugin.
* @returns The PluginType.SystemMonitoring value.
*/
type(): PluginType {
return PluginType.SystemMonitoring;
}
/**
* Called when the plugin is loaded.
*/
onLoad(): void {}
/**
* Called when the plugin is unloaded.
*/
onUnload(): void {}
/**
* Returns information about the system resources.
* @returns A Promise that resolves to an object containing information about the system resources.
*/
getResourcesInfo(): Promise<any> {
return executeOnMain(MODULE, "getResourcesInfo");
}
/**
* Returns information about the current system load.
* @returns A Promise that resolves to an object containing information about the current system load.
*/
getCurrentLoad(): Promise<any> {
return executeOnMain(MODULE, "getCurrentLoad");
}
}