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;
  /**
   * 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;
}

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

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

export const models = data as IModelLinks;
