"use strict";
class PlatformProjectServiceBase {
    constructor($fs, $projectData, $projectDataService) {
        this.$fs = $fs;
        this.$projectData = $projectData;
        this.$projectDataService = $projectDataService;
    }
    getPluginPlatformsFolderPath(pluginData, platform) {
        return pluginData.pluginPlatformsFolderPath(platform);
    }
    getAllNativeLibrariesForPlugin(pluginData, platform, filter) {
        return (() => {
            let pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, platform), nativeLibraries = [];
            if (pluginPlatformsFolderPath && this.$fs.exists(pluginPlatformsFolderPath).wait()) {
                let platformsContents = this.$fs.readDirectory(pluginPlatformsFolderPath).wait();
                nativeLibraries = _(platformsContents)
                    .filter(platformItemName => filter(platformItemName, pluginPlatformsFolderPath))
                    .value();
            }
            return nativeLibraries;
        }).future()();
    }
    getFrameworkVersion(runtimePackageName) {
        return (() => {
            this.$projectDataService.initialize(this.$projectData.projectDir);
            let frameworkVersion = this.$projectDataService.getValue(runtimePackageName).wait().version;
            return frameworkVersion;
        }).future()();
    }
}
exports.PlatformProjectServiceBase = PlatformProjectServiceBase;
