"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getComponentNames = getComponentNames;
const language_core_1 = require("@vue/language-core");
const utils_1 = require("./utils");
function getComponentNames(ts, program, virtualCode) {
    const sourceFile = program.getSourceFile(virtualCode.fileName);
    if (!sourceFile) {
        return [];
    }
    const checker = program.getTypeChecker();
    const componentNames = (0, utils_1.getVariableType)(ts, checker, sourceFile, language_core_1.names.components)
        ?.type
        .getProperties()
        .map(c => c.name)
        .filter(entry => !entry.includes('$') && !entry.startsWith('_'))
        ?? [];
    const codegen = language_core_1.tsCodegen.get(virtualCode.ir);
    componentNames.push((0, utils_1.getSelfComponentName)(virtualCode.fileName), ...codegen?.getImportedComponents() ?? [], ...codegen?.getSetupBindings() ?? []);
    return [...new Set(componentNames)];
}
//# sourceMappingURL=getComponentNames.js.map