import { type Logger } from '../utility/logging/logger.ts';
import type { Stats } from 'node:fs';
import { EventEmitter } from 'node:events';
import { FileAndURLPathConfig } from './Component.js';
import { FilesOption } from './deriveGlobOptions.js';
export interface BaseEntry {
    stats?: Stats;
    urlPath: string;
    absolutePath: string;
}
export interface FileEntry extends BaseEntry {
    contents: Buffer;
}
export interface EntryEvent extends BaseEntry {
    eventType: string;
    entryType: string;
}
export interface AddFileEvent extends EntryEvent, FileEntry {
    eventType: 'add';
    entryType: 'file';
}
export interface ChangeFileEvent extends EntryEvent, FileEntry {
    eventType: 'change';
    entryType: 'file';
}
export interface UnlinkFileEvent extends EntryEvent {
    eventType: 'unlink';
    entryType: 'file';
}
export type FileEntryEvent = AddFileEvent | ChangeFileEvent | UnlinkFileEvent;
export interface AddDirectoryEvent extends EntryEvent {
    eventType: 'addDir';
    entryType: 'directory';
}
export interface UnlinkDirectoryEvent extends EntryEvent {
    eventType: 'unlinkDir';
    entryType: 'directory';
}
export type DirectoryEntryEvent = AddDirectoryEvent | UnlinkDirectoryEvent;
export type onEntryEventHandler = (entry: FileEntryEvent | DirectoryEntryEvent) => void | Promise<void>;
export type EntryHandlerEventMap = {
    all: [entry: FileEntryEvent | DirectoryEntryEvent];
    close: [];
    error: [error: unknown];
    ready: [];
    initialLoadComplete: [];
    add: [entry: AddFileEvent];
    change: [entry: ChangeFileEvent];
    unlink: [entry: UnlinkFileEvent];
    addDir: [entry: AddDirectoryEvent];
    unlinkDir: [entry: UnlinkDirectoryEvent];
};
export declare class EntryHandler extends EventEmitter<EntryHandlerEventMap> {
    #private;
    ready: Promise<any[]>;
    constructor(name: string, directory: string, config: FilesOption | FileAndURLPathConfig, logger?: Logger);
    get name(): string;
    get directory(): string;
    close(): this;
    update(config: FilesOption | FileAndURLPathConfig): Promise<any[]>;
}
