import { events } from "./util";
export declare type ProcessEvent = string | {
    type: string;
    [key: string]: any;
};
export declare type Process = IterableIterator<Promise<any> | ProcessEvent>;
export interface ProcessorOptions {
    logLevel: "error" | "warn" | "info" | "debug";
    pluginsUri: string | null;
}
export interface ProcessorEvents {
    'start': Record<string, never>;
    'end': Record<string, never>;
    'error': {
        error: Error;
    };
}
export declare abstract class Processor<Options extends ProcessorOptions = ProcessorOptions, Events extends ProcessorEvents = ProcessorEvents> extends events.EventEmitter<Events> {
    static defaultOptions: ProcessorOptions;
    options: Options;
    protected _process: Process;
    protected _pluginsToLoad: Promise<void>[];
    protected constructor(options?: Partial<Options>);
    protected _ended: Promise<void>;
    get ended(): Promise<void>;
    use(pluginName: string, useOptions?: Record<string, unknown>): this;
    start(): this;
    emitError(error: Error): void;
    protected _start<KE extends keyof Events>(): Promise<void>;
}
export interface Plugin<Options> {
    (processor: Processor, options: Options, ...args: any[]): any;
}
export declare type PluginEntry<Options> = {
    initializer: Plugin<Options>;
    defaultOptions: Options;
    scriptOptions: Options;
    script?: HTMLScriptElement;
};
export declare type PluginRegistry = {
    [pluginName: string]: PluginEntry<any>;
};
export declare const pluginRegistry: PluginRegistry;
