/**
 * Component Discovery
 *
 * Automatically discovers Hypen components from the filesystem.
 *
 * Supports multiple conventions:
 *   1. Single-file: ComponentName.ts with .ui(hypen`...`) inline template
 *   2. Folder-based: ComponentName/component.ts + ComponentName/component.hypen
 *   3. Sibling files: ComponentName.ts + ComponentName.hypen
 *   4. Index-based: ComponentName/index.ts + ComponentName/index.hypen
 */
import type { HypenModuleDefinition } from "./app.js";
export interface DiscoveredComponent {
    name: string;
    /** Path to .hypen file (null for single-file components with inline templates) */
    hypenPath: string | null;
    /** Path to .ts module file */
    modulePath: string | null;
    /** The UI template (from .hypen file or inline) */
    template: string;
    /** Whether this component has a module (state/actions) */
    hasModule: boolean;
    /** Whether this is a single-file component with inline template */
    isSingleFile: boolean;
}
export interface DiscoveryOptions {
    /**
     * Which naming patterns to look for
     * Default: ["single-file", "folder", "sibling", "index"]
     *
     * - single-file: ComponentName.ts with .ui(hypen`...`) inline template
     * - folder: ComponentName/component.ts + ComponentName/component.hypen
     * - sibling: ComponentName.ts + ComponentName.hypen
     * - index: ComponentName/index.ts + ComponentName/index.hypen
     */
    patterns?: ("single-file" | "folder" | "sibling" | "index")[];
    /**
     * Recursively scan subdirectories
     * Default: true
     */
    recursive?: boolean;
    /**
     * Enable debug logging
     * Default: false
     */
    debug?: boolean;
}
export interface WatchOptions extends DiscoveryOptions {
    /**
     * Callback when components change
     */
    onChange?: (components: DiscoveredComponent[]) => void;
    /**
     * Callback when a component is added
     */
    onAdd?: (component: DiscoveredComponent) => void;
    /**
     * Callback when a component is removed
     */
    onRemove?: (name: string) => void;
    /**
     * Callback when a component is updated
     */
    onUpdate?: (component: DiscoveredComponent) => void;
}
/**
 * Discover all Hypen components in a directory
 */
export declare function discoverComponents(baseDir: string, options?: DiscoveryOptions): Promise<DiscoveredComponent[]>;
/**
 * Load discovered components into a map for use with Hypen
 */
export declare function loadDiscoveredComponents(components: DiscoveredComponent[]): Promise<Map<string, {
    name: string;
    module: HypenModuleDefinition<any>;
    template: string;
}>>;
/**
 * Watch a directory for component changes
 */
export declare function watchComponents(baseDir: string, options?: WatchOptions): {
    stop: () => void;
};
/**
 * Generate a components object from discovered components
 * Useful for static imports / code generation
 */
export declare function generateComponentsCode(baseDir: string, options?: DiscoveryOptions & {
    outputDir?: string;
}): Promise<string>;
