"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlatformProjectServiceBase = void 0;
const events_1 = require("events");
const _ = require("lodash");
class PlatformProjectServiceBase extends events_1.EventEmitter {
    constructor($fs, $projectDataService) {
        super();
        this.$fs = $fs;
        this.$projectDataService = $projectDataService;
    }
    getPluginPlatformsFolderPath(pluginData, platform) {
        return pluginData.pluginPlatformsFolderPath(platform);
    }
    getFrameworkVersion(projectData) {
        const frameworkData = this.$projectDataService.getRuntimePackage(projectData.projectDir, this.getPlatformData(projectData).platformNameLowerCase);
        return frameworkData && frameworkData.version;
    }
    getAllNativeLibrariesForPlugin(pluginData, platform, filter) {
        const pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, platform);
        let nativeLibraries = [];
        if (pluginPlatformsFolderPath &&
            this.$fs.exists(pluginPlatformsFolderPath)) {
            const platformsContents = this.$fs.readDirectory(pluginPlatformsFolderPath);
            nativeLibraries = _(platformsContents)
                .filter((platformItemName) => filter(platformItemName, pluginPlatformsFolderPath))
                .value();
        }
        return nativeLibraries;
    }
}
exports.PlatformProjectServiceBase = PlatformProjectServiceBase;
//# sourceMappingURL=platform-project-service-base.js.map