import { List } from "../../../Data/List"
import { Maybe, Nothing } from "../../../Data/Maybe"
import { fromDefault, Record } from "../../../Data/Record"
import { Tuple } from "../../../Data/Tuple"
import { Erratum } from "./sub/Errata"
import { SourceLink } from "./sub/SourceLink"

export interface Condition {
  "@@name": "Condition"
  id: string
  name: string
  description: Maybe<string>
  levelColumnDescription: Maybe<string>
  levelDescriptions: Tuple<[string, string, string, string]>
  src: List<Record<SourceLink>>
  errata: List<Record<Erratum>>
}

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const Condition =
  fromDefault ("Condition")
              <Condition> ({
                id: "",
                name: "",
                description: Nothing,
                levelColumnDescription: Nothing,
                levelDescriptions: Tuple ("", "", "", ""),
                src: List (),
                errata: List (),
              })
