1
0

Add types for built-in functions

This commit is contained in:
Jeff 2023-12-01 23:50:26 -05:00
parent 9fd02a2118
commit 62959be020

View File

@ -1,4 +1,4 @@
use crate::{BuiltInFunction, Error, Map, Result, Value};
use crate::{BuiltInFunction, Error, Map, Result, Type, TypeDefinition, Value};
pub struct FromJson;
@ -17,7 +17,10 @@ impl BuiltInFunction for FromJson {
}
fn type_definition(&self) -> crate::TypeDefinition {
todo!()
TypeDefinition::new(Type::Function {
parameter_types: vec![Type::String],
return_type: Box::new(Type::Any),
})
}
}
@ -38,6 +41,9 @@ impl BuiltInFunction for ToJson {
}
fn type_definition(&self) -> crate::TypeDefinition {
todo!()
TypeDefinition::new(Type::Function {
parameter_types: vec![Type::Any],
return_type: Box::new(Type::String),
})
}
}