/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import type { MaybePromise } from "../util/Promises.js";
import { File } from "./File.js";
import { FilesystemNode } from "./FilesystemNode.js";
/**
 * Abstract handle to a directory.
 *
 * A Directory is a handle -- the underlying entry need not exist yet.
 */
export declare abstract class Directory extends FilesystemNode {
    readonly kind = "directory";
    /**
     * Return the native filesystem path for this directory, if available.  Throws by default; platform-specific
     * subclasses (e.g. NodeJsDirectory) override this.
     */
    get path(): string;
    abstract entries(): AsyncIterable<Directory.Entry>;
    abstract file(name: string): File;
    abstract directory(name: string): Directory;
    abstract mkdir(): Promise<void>;
    /**
     * Recursively copy a filesystem node into this directory.  String arguments are resolved relative to this directory.
     */
    abstract copy(source: string | FilesystemNode, target: string | FilesystemNode): Promise<void>;
    /**
     * Open an existing entry at a relative path.  Returns a {@link File} or {@link Directory} based on what exists,
     * or throws {@link FileNotFoundError} if the path does not exist.
     */
    open(path: string): Promise<Directory.Entry>;
    /**
     * Get a {@link File} handle at a relative path.  The file need not exist yet.
     */
    create(path: string): File;
    /**
     * List file names in this directory.
     */
    files(): Promise<string[]>;
    /**
     * List subdirectory names in this directory.
     */
    directories(): Promise<string[]>;
    /**
     * Acquire an exclusive lock on this directory.  Returns a release function.
     *
     * The default implementation is a no-op.  Platform-specific subclasses (e.g. NodeJsDirectory) override this to
     * provide real locking with stale-lock detection.
     */
    lock(): MaybePromise<() => MaybePromise<void>>;
}
export declare namespace Directory {
    type Entry = File | Directory;
}
//# sourceMappingURL=Directory.d.ts.map