import { Plugin, PluginHooks, PluginOptions } from './types'; import { BluetoothPrintError } from '../errors/baseError'; import { PrinterState } from '../types'; /** * Manages plugins for BluetoothPrinter */ export declare class PluginManager { private plugins; private readonly logger; /** * Register a plugin * @param plugin - Plugin to register * @param options - Plugin options * @throws {BluetoothPrintError} If plugin with same name already exists */ register(plugin: Plugin, options?: PluginOptions): Promise; /** * Unregister a plugin * @param name - Plugin name to unregister */ unregister(name: string): Promise; /** * Get a registered plugin * @param name - Plugin name * @returns Plugin instance or undefined */ get(name: string): Plugin | undefined; /** * Get all registered plugin names * @returns Array of plugin names */ getNames(): string[]; /** * Check if a plugin is registered * @param name - Plugin name * @returns True if registered */ has(name: string): boolean; /** * Execute a hook across all plugins * @param hookName - Name of the hook to execute * @param args - Arguments to pass to the hook * @returns Result from hooks (last non-void result) */ executeHook(hookName: K, ...args: Parameters>): Promise; /** * Execute beforeConnect hooks */ beforeConnect(deviceId: string): Promise; /** * Execute afterConnect hooks */ afterConnect(deviceId: string): Promise; /** * Execute beforeDisconnect hooks */ beforeDisconnect(deviceId: string): Promise; /** * Execute afterDisconnect hooks */ afterDisconnect(deviceId: string): Promise; /** * Execute beforePrint hooks */ beforePrint(buffer: Uint8Array): Promise; /** * Execute afterPrint hooks */ afterPrint(bytesSent: number): Promise; /** * Execute onError hooks * @returns True if error should be suppressed */ onError(error: BluetoothPrintError): Promise; /** * Execute onStateChange hooks */ onStateChange(state: PrinterState, previousState: PrinterState): Promise; /** * Execute onProgress hooks */ onProgress(sent: number, total: number): Promise; /** * Clear all plugins */ clear(): Promise; }