import { TracedEventEmitter } from "@superblocksteam/shared";
import { type ErrorEventMap } from "./errors/error-handler.js";
import type { Tracer } from "@opentelemetry/api";
import type { FSWatcher } from "vite";
type EventMap = {
    registeredComponentAdded: [name: string];
    registeredComponentRemoved: [name: string];
    registeredComponentChanged: [name: string, oldName?: string];
} & ErrorEventMap;
/**
 * This class is responsible for managing the components in the project.
 * It is used to get the name of the component in the file, and to listen to changes in the components.
 */
export declare class ComponentsManager extends TracedEventEmitter<EventMap> {
    private registeredComponentNames;
    private fileContents;
    private static instance;
    static setInstance(tracer: Tracer): ComponentsManager;
    static getInstance(): ComponentsManager;
    private constructor();
    initialize(rootPath: string, watcher: FSWatcher): Promise<void>;
    private onAddComponent;
    private onRemoveComponent;
    isCustomComponentFile(path: string): boolean;
    isCustomComponent(componentName: string): boolean;
    getComponentName(path: string): string | undefined;
    getComponentNames(path: string): string[];
    getComponentImportPath(componentName: string, rootPath: string): string | undefined;
    /**
     * Extracts all component names from a file containing registerComponent() calls.
     * Returns an array of component names, or undefined if none found.
     */
    protected getComponentNameFromFile(fileContents: string): Promise<string[] | undefined>;
    get componentFilePaths(): string[];
    isInComponentDirectory(filePath: string): boolean;
}
export declare function getComponentSourceCode(fileContents: string, componentName: string): string;
/**
 * Transforms source code for sibling files in a component directory.
 * Injects data-no-select into all component functions in the file.
 */
export declare function getComponentSiblingSourceCode(fileContents: string, fileName: string): string;
export {};
//# sourceMappingURL=components-manager.d.ts.map