UNPKG

@oxog/environment-detector

Version:

Comprehensive, zero-dependency environment detection for Node.js

24 lines 1.02 kB
import type { Plugin, PluginContext, EventHandler } from '@/types/plugin'; import type { Detector } from '@/types'; export declare abstract class BasePlugin implements Plugin { abstract readonly name: string; abstract readonly version: string; description?: string; abstract readonly detectors: Detector[]; install(context: PluginContext): Promise<void>; uninstall(): Promise<void>; protected onInstall?(context: PluginContext): void | Promise<void>; protected onUninstall?(): void | Promise<void>; } export declare class PluginContextImpl implements PluginContext { private detectors; private eventHandlers; registerDetector(detector: Detector): void; unregisterDetector(name: string): void; getDetector(name: string): Detector | undefined; getAllDetectors(): Detector[]; emit(event: string, data?: unknown): void; on(event: string, handler: EventHandler): void; off(event: string, handler: EventHandler): void; } //# sourceMappingURL=base.d.ts.map