cli: Generate ts idl in addition to type (#860)

This commit is contained in:
Armani Ferrante 2021-10-09 20:19:33 -05:00 committed by GitHub
parent 24d07aa41b
commit 635a18c7ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,12 @@ pub fn idl_ts(idl: &Idl) -> Result<String> {
.collect();
let idl_json = serde_json::to_string_pretty(&idl)?;
Ok(format!(
"export type {} = {}",
r#"export type {} = {};
export const IDL: {} = {};
"#,
idl.name.to_camel_case(),
idl_json,
idl.name.to_camel_case(),
idl_json
))