import { EmissionMethodTier } from '@hestia-earth/schema';
import * as data from '../model-links.json';

export interface IModel {
  /**
   * Path to the implementation (code) of the model.
   */
  path: string;
  /**
   * Path to the documentation of the model.
   */
  docPath: string;
  /**
   * Path to the documentation of the model on the guide.
   */
  guidePath: string;
  /**
   * The name of the model used as `methodModel`.
   */
  model: string;
  /**
   * The term the model is associated with.
   */
  term?: string;
  /**
   * The methodTier of the Emission (if applicable).
   */
  methodTier?: EmissionMethodTier;
  /**
   * A key in the model if term does not exist.
   */
  modelKey?: string;
  /**
   * List of other models this model needs to run.
   */
  dependencies?: string[];
}

export type modelLookup = Record<
  string,
  Pick<IModel, 'model' | 'term' | 'modelKey'>[]
>;

export interface IModelLinks {
  links: IModel[];
  lookups: Record<string, modelLookup>;
}

export const models = data as IModelLinks;
