import { EventEmitter, captureRejectionSymbol } from 'node:events';
import type { EventName, EventCallbackResult } from './buses';
/**
 * Describes the events and their callbacks for a KyooWorker instance
 */
export interface KyooWorkerToApplicationEventEmitterEventCallbacks {
    /**
     * Called in case a promise rejection happens when emitting an event
     * @event
     * @param err The error that was thrown
     * @param event The event which caused the error
     * @param args The arguments that were passed to the event
     */
    [captureRejectionSymbol]: (err: Error, event: EventName, ...args: any[]) => EventCallbackResult;
    /**
     * Called when a promise to process a job is created
     * @event
     * @param promised The promise which was created
     */
    'promise': (promised: Promise<void>) => EventCallbackResult;
    /**
     * Called when a job is processed without throwing an error
     * @event
     */
    'resolve': (promised: Promise<void>) => EventCallbackResult;
    /**
     * Called when a job is processed and throws an error
     * @event
     * @param err The error which was thrown
     * @param promised The promise which was created
     */
    'reject': (err: unknown, promised: Promise<void>) => EventCallbackResult;
    /**
     * Called when a job is processed and the promise is settled
     * @event
     * @param promised The promise which was created
     */
    'settled': (promised: Promise<void>) => EventCallbackResult;
    /**
     * Called when a job is acknowledged (either `ack` or `nack` is called)
     * @event
     */
    'acknowledged': () => EventCallbackResult;
    /**
     * Called when a job is acknowledged (`ack` is called)
     * @event
     */
    'ack': () => EventCallbackResult;
    /**
     * Called when a job is rejected (`nack` is called)
     * @event
     */
    'nack': () => EventCallbackResult;
    /**
     * Called when the processor "ticks" (i.e. starts the processing loop)
     * @event
     */
    'tick': () => EventCallbackResult;
    /**
     * Called when the "tocks" (i.e. ends the processing loop)
     * @event
     */
    'tock': () => EventCallbackResult;
    /**
     * Called when the worker is terminated
     * @event
     */
    'terminated': () => EventCallbackResult;
    /**
     * Called when the worker is paused
     * @event
     */
    'paused': () => EventCallbackResult;
    /**
     * Called when the worker is resumed
     * @event
     */
    'resumed': () => EventCallbackResult;
    /**
     * Called when an "emerg" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.emerg': (...args: any[]) => EventCallbackResult;
    /**
     * Called when an "alert" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.alert': (...args: any[]) => EventCallbackResult;
    /**
     * Called when a "crit" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.crit': (...args: any[]) => EventCallbackResult;
    /**
     * Called when an "error" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.error': (...args: any[]) => EventCallbackResult;
    /**
     * Called when a "warning" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.warning': (...args: any[]) => EventCallbackResult;
    /**
     * Called when a "notice" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.notice': (...args: any[]) => EventCallbackResult;
    /**
     * Called when an "info" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.info': (...args: any[]) => EventCallbackResult;
    /**
     * Called when a "debug" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.debug': (...args: any[]) => EventCallbackResult;
    /**
     * Called when a "trace" level log is emitted
     * @event
     * @param args The arguments which were passed to the event
     */
    'log.trace': (...args: any[]) => EventCallbackResult;
}
/**
 * @private
 */
export type KyooWorkerToApplicationEventEmitterEvent = keyof KyooWorkerToApplicationEventEmitterEventCallbacks;
/**
 * @private
 */
export type KyooWorkerToApplicationEventEmitterEventEmitterEventMap = {
    [K in KyooWorkerToApplicationEventEmitterEvent]: Parameters<KyooWorkerToApplicationEventEmitterEventCallbacks[K]>;
};
/**
 * @private
 */
export type KyooWorkerToApplicationEventEmitterKey = keyof KyooWorkerToApplicationEventEmitterEventCallbacks;
/**
 * @private
 */
export type KyooWorkerToApplicationEventEmitterListener<K extends KyooWorkerToApplicationEventEmitterKey> = K extends keyof KyooWorkerToApplicationEventEmitterEventCallbacks ? KyooWorkerToApplicationEventEmitterEventEmitterEventMap[K] extends unknown[] ? (...args: KyooWorkerToApplicationEventEmitterEventEmitterEventMap[K]) => EventCallbackResult : never : never;
/**
 * @private
 */
export declare class KyooWorkerToApplicationEventEmitter extends EventEmitter<KyooWorkerToApplicationEventEmitterEventEmitterEventMap> {
    constructor();
}
