Browse Source

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

Armani Ferrante 4 years ago
parent
commit
635a18c7ff
1 changed files with 6 additions and 1 deletions
  1. 6 1
      cli/src/template.rs

+ 6 - 1
cli/src/template.rs

@@ -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
     ))