'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});


/**
 * An extension to parse the component docs and store the parsed docs in the model
 */
var logger = void 0;

var DocsParser = {
  // getDynamicConfig: (rawConfig) => {
  // },

  init: function init(_ref) {
    var rawConfig = _ref.rawConfig,
        dynamicConfig = _ref.dynamicConfig,
        api = _ref.api;

    api.registerActionToHook(api.HOOKS_NAMES['post-tag'], { name: 'parseDocs', run: parseDocs });
    api.registerActionToHook(api.HOOKS_NAMES['post-tag-all'], { name: 'parseDocs', run: parseDocs });
    logger = api.getLogger();
  }
};

var parseDocs = function parseDocs(args) {
  if (args && args.components && args.components.length) {
    var ids = args.components.map(function (comp) {
      return comp.id;
    });
    logger.debug(`parse docs for ${ids.join()}`);
    // TODO: implement
    // Load files conentes
    // Parse docs
    // Store in the models
    return;
  }
  logger.debug('parse docs for unknown components');
};

exports.default = DocsParser;