text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.TransformerContext = void 0;
  const datasource_1 = require("./datasource");
  const noop_feature_flag_1 = require("./noop-feature-flag");
  const output_1 = require("./output");
  const provider_registry_1 = require("./provider-registry");
  const resolver_1 = require("./resolver");
  const resource_helper_1 = require("./resource-helper");
  const stack_manager_1 = require("./stack-manager");
  class TransformerContext {
      constructor(app, inputDocument, stackMapping, featureFlags, resolverConfig) {
          this.inputDocument = inputDocument;
          this.getResolverConfig = () => {
              return this.resolverConfig;
          };
          this.output = new output_1.TransformerOutput(inputDocument);
          this.resolvers = new resolver_1.ResolverManager();
          this.dataSources = new datasource_1.TransformerDataSourceManager();
          this.providerRegistry = new provider_registry_1.TransformerContextProviderRegistry();
          const stackManager = new stack_manager_1.StackManager(app, stackMapping);
          this.stackManager = stackManager;
          this.resourceHelper = new resource_helper_1.TransformerResourceHelper(stackManager);
          this.featureFlags = featureFlags !== null && featureFlags !== void 0 ? featureFlags : new noop_feature_flag_1.NoopFeatureFlagProvider();
          this.resolverConfig = resolverConfig;
      }
      bind(api) {
          this._api = api;
          this.resourceHelper.bind(api);
      }
      get api() {
          if (!this._api) {
              throw new Error('API is not initialized till generateResolver step');
          }
          return this._api;
      }
      isProjectUsingDataStore() {
          var _a, _b;
          return !!((_a = this.resolverConfig) === null || _a === void 0 ? void 0 : _a.project) || !!((_b = this.resolverConfig) === null || _b === void 0 ? void 0 : _b.models);
      }
  }
  exports.TransformerContext = TransformerContext;
  //# sourceMappingURL=index.js.map