docs: def link_types(self, base_dir: str, types: list, conf: Config) -> int:
          """Link all artifacts with types `types` under `base_dir` and return
             the number of linked artifacts."""
          num_linked = 0
          for kind in types:
              artifact_map = self._artifacts.get(kind)
              if not artifact_map:
                  continue
              num_linked += self._link(join(base_dir, self.type_to_dir[kind]),
                                       artifact_map, conf)
          return num_linked