kibo: part 2 (broken)

This commit is contained in:
nym21
2025-03-25 20:55:47 +01:00
parent 7a8896864f
commit 50bf670931
126 changed files with 7131 additions and 2758 deletions

View File

@@ -30,14 +30,25 @@ impl DTS for Query<'static> {
let path = path.join(Path::new("vecid-to-indexes.d.ts"));
let mut contents = Index::all()
.into_iter()
let indexes = Index::all();
let mut contents = indexes
.iter()
.enumerate()
.map(|(i_of_i, i)| format!("type {} = {};", i, i_of_i))
.collect::<Vec<_>>()
.join("\n");
contents += "\n\ninterface VecIdToIndexes {\n";
contents += &format!(
"\n\nexport type Index = {};",
indexes
.iter()
.map(|i| i.to_string())
.collect::<Vec<_>>()
.join(" | ")
);
contents += "\n\nexport interface VecIdToIndexes {\n";
self.vecid_to_index_to_vec
.iter()
@@ -60,6 +71,8 @@ impl DTS for Query<'static> {
contents.push('}');
contents += "\n\nexport type VecId = keyof VecIdToIndexes;";
fs::write(path, contents)
}
}