Skip to content

Commit

Permalink
remove unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
imalsogreg committed Oct 23, 2024
1 parent dfaad86 commit 6aac2cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions engine/language_client_codegen/src/typescript/generate_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ pub struct TypescriptClass<'ir> {
pub dynamic: bool,
}

// TODO: Use this.
// pub struct TypescriptChecksClass {
// pub name: String,
// pub fields: Vec<(String, bool, String)>,
// pub dynamic: bool,
// }

impl<'ir> TryFrom<(&'ir IntermediateRepr, &'ir GeneratorArgs)> for TypescriptTypes<'ir> {
type Error = anyhow::Error;

Expand Down Expand Up @@ -116,14 +109,6 @@ impl<'ir> From<&ClassWalker<'ir>> for TypescriptClass<'ir> {
}
}

pub fn type_def_for_checks(checks: &TypeCheckAttributes) -> TypescriptClass<'static> {
TypescriptClass {
name: Cow::Owned(type_name_for_checks(checks)),
dynamic: false,
fields: checks.0.iter().map(|check_name| (Cow::Owned(check_name.clone()), false, "Check".to_string())).collect(),
}
}

pub fn type_name_for_checks(checks: &TypeCheckAttributes) -> String {
checks.0.iter().map(|check| format!("\"{check}\"")).sorted().join(" | ")
}
2 changes: 1 addition & 1 deletion engine/language_client_codegen/src/typescript/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use internal_baml_core::{

use self::typescript_language_features::{ToTypescript, TypescriptLanguageFeatures};
use crate::{dir_writer::FileCollector, field_type_attributes, type_check_attributes};
use self::generate_types::{TypescriptClass, type_def_for_checks};
use self::generate_types::TypescriptClass;

#[derive(askama::Template)]
#[template(path = "async_client.ts.j2", escape = "none")]
Expand Down

0 comments on commit 6aac2cd

Please sign in to comment.