"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getElementAttrs = getElementAttrs;
const language_core_1 = require("@vue/language-core");
const utils_1 = require("./utils");
function getElementAttrs(ts, program, fileName, tag) {
    const sourceFile = program.getSourceFile(fileName);
    if (!sourceFile) {
        return [];
    }
    const checker = program.getTypeChecker();
    const elements = (0, utils_1.getVariableType)(ts, checker, sourceFile, language_core_1.names.intrinsics);
    if (!elements) {
        return [];
    }
    const elementType = elements.type.getProperty(tag);
    if (!elementType) {
        return [];
    }
    return checker.getTypeOfSymbol(elementType).getProperties().map(prop => {
        const info = {
            name: prop.name,
        };
        if (!utils_1.booleanExceptionProps.has(prop.name) && (0, utils_1.hasBooleanType)(ts, checker.getTypeOfSymbol(prop))) {
            info.boolean = true;
        }
        return info;
    });
}
//# sourceMappingURL=getElementAttrs.js.map