"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, { fileName, sfc }) {
    const sourceFile = program.getSourceFile(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('_'))
        ?? [];
    componentNames.push((0, utils_1.getSelfComponentName)(fileName));
    componentNames.push(...language_core_1.tsCodegen.get(sfc)?.getImportedComponents() ?? []);
    return [...new Set(componentNames)];
}
//# sourceMappingURL=getComponentNames.js.map