File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -560,16 +560,22 @@ async fn generate_ts_bindings(
560560 } ,
561561 ) ?;
562562
563+ let mut reference_types = Vec :: new ( ) ;
564+
563565 for ( name, contents) in files. iter ( ) {
564566 let output_path = package_dir. join ( "types" ) . join ( name) ;
565567 // Create parent directories if they don't exist
566568 if let Some ( parent) = output_path. parent ( ) {
567569 fs:: create_dir_all ( parent) . await ?;
568570 }
571+
572+ reference_types. push ( format ! ( "/// <reference path=\" ./types/{name}\" />\n " , ) ) ;
573+ println ! ( "Writing {name} to {output_path:?}" ) ;
569574 fs:: write ( output_path, contents) . await ?;
570575 }
571576 // for all interface names in interfaces, import and re-export them in a index.js file
572577 let mut re_exports: Vec < String > = Vec :: new ( ) ;
578+ re_exports. push ( reference_types. join ( "\n " ) ) ;
573579 let mut name_counts: HashMap < String , usize > = HashMap :: new ( ) ;
574580 for ( _, item) in resolve. worlds [ out_world_id] . imports . iter ( ) {
575581 match item {
You can’t perform that action at this time.
0 commit comments