/**
 * Type definitions for the virtual filesystem layer.
 *
 * The virtual filesystem provides an abstraction over physical files,
 * allowing certain file types (like APIs) to appear differently to
 * consumers than they are stored on disk.
 */
import type { TemplateRenderer } from "../../template-renderer.js";
/**
 * File metadata returned by listFiles when includeMetadata is true.
 */
export interface FileMetadata {
    /** Relative file path (virtual path for APIs) */
    path: string;
    /** File size in bytes */
    size: number;
    /** Last modification time */
    mtime: Date;
    /** Whether this is a directory */
    isDirectory: boolean;
    /** Whether this is a file */
    isFile: boolean;
}
/**
 * Options for reading virtual files.
 */
export interface VirtualReadOptions {
    appRootDirPath: string;
    templateRenderer?: TemplateRenderer;
    entityNames?: string[];
}
/**
 * Options for writing virtual files.
 */
export interface VirtualWriteOptions {
    appRootDirPath: string;
}
/**
 * Options for deleting virtual files.
 */
export interface VirtualDeleteOptions {
    appRootDirPath: string;
    createDraftDelete: (relativePath: string) => Promise<void>;
}
/**
 * Result of parsing a virtual path.
 */
export interface VirtualPathInfo {
    /** The type of virtual file (e.g., "api") */
    type: string;
    /** Extracted parameters from the path (e.g., { apiName: "MyAPI" }) */
    params: Record<string, string>;
}
/**
 * Handler for a specific type of virtual file.
 *
 * Each handler is responsible for a category of virtual files
 * (e.g., API files). The VirtualFileSystem uses handlers to
 * route operations to the appropriate implementation.
 */
export interface VirtualFileHandler {
    /** Unique identifier for this handler type */
    readonly type: string;
    /**
     * Check if this handler manages the given virtual path.
     *
     * @param virtualPath - The virtual path to check
     * @returns true if this handler should process the path
     */
    matches(virtualPath: string): boolean;
    /**
     * Check if a physical path belongs to this handler's domain.
     * Used for converting physical paths to virtual paths in listings.
     *
     * @param physicalPath - The physical path to check
     * @returns true if this handler should convert the path
     */
    matchesPhysical(physicalPath: string): boolean;
    /**
     * Parse a virtual path to extract metadata.
     *
     * @param virtualPath - The virtual path to parse
     * @returns Parsed info or undefined if not a valid path for this handler
     */
    parse(virtualPath: string): VirtualPathInfo | undefined;
    /**
     * Convert a physical path to its virtual representation.
     *
     * @param physicalPath - The physical path to convert
     * @returns The virtual path, or undefined if not convertible
     */
    toVirtualPath(physicalPath: string): string | undefined;
    /**
     * Read content from a virtual file.
     *
     * @param virtualPath - The virtual path to read
     * @param options - Read options including app root and dependencies
     * @returns The file content, or undefined if not found
     */
    read(virtualPath: string, options: VirtualReadOptions): Promise<string | undefined>;
    /**
     * Write content to a virtual file.
     *
     * @param virtualPath - The virtual path to write
     * @param content - The content to write
     * @param options - Write options including app root
     */
    write(virtualPath: string, content: string, options: VirtualWriteOptions): Promise<void>;
    /**
     * Delete a virtual file and its associated physical files.
     *
     * @param virtualPath - The virtual path to delete
     * @param options - Delete options including draft delete function
     * @returns List of physical paths that were deleted
     */
    delete(virtualPath: string, options: VirtualDeleteOptions): Promise<string[]>;
    /**
     * Get metadata for a virtual file.
     *
     * @param virtualPath - The virtual path to get metadata for
     * @param options - Read options including app root
     * @returns File metadata, or undefined if not found
     */
    getMetadata?(virtualPath: string, options: VirtualReadOptions): Promise<FileMetadata | undefined>;
}
//# sourceMappingURL=virtual-fs-types.d.ts.map