@@ -594,32 +594,103 @@ pub mod exports {
594594 _ => _rt:: invalid_enum_discriminant ( ) ,
595595 } ) ;
596596 }
597+ #[ doc( hidden) ]
598+ #[ allow( non_snake_case) ]
599+ pub unsafe fn _export_customize_cabi < T : Guest > (
600+ arg0 : * mut u8 ,
601+ arg1 : usize ,
602+ ) -> * mut u8 {
603+ #[ cfg( target_arch = "wasm32" ) ]
604+ _rt:: run_ctors_once ( ) ;
605+ let base6 = arg0;
606+ let len6 = arg1;
607+ let mut result6 = _rt:: Vec :: with_capacity ( len6) ;
608+ for i in 0 ..len6 {
609+ let base = base6. add ( i * 16 ) ;
610+ let e6 = {
611+ let l0 = * base. add ( 0 ) . cast :: < * mut u8 > ( ) ;
612+ let l1 = * base. add ( 4 ) . cast :: < usize > ( ) ;
613+ let len2 = l1;
614+ let bytes2 = _rt:: Vec :: from_raw_parts ( l0. cast ( ) , len2, len2) ;
615+ let l3 = * base. add ( 8 ) . cast :: < * mut u8 > ( ) ;
616+ let l4 = * base. add ( 12 ) . cast :: < usize > ( ) ;
617+ let len5 = l4;
618+ let bytes5 = _rt:: Vec :: from_raw_parts ( l3. cast ( ) , len5, len5) ;
619+
620+ ( _rt:: string_lift ( bytes2) , _rt:: string_lift ( bytes5) )
621+ } ;
622+ result6. push ( e6) ;
623+ }
624+ _rt:: cabi_dealloc ( base6, len6 * 16 , 4 ) ;
625+ let result7 = T :: customize ( result6) ;
626+ let ptr8 = _RET_AREA. 0 . as_mut_ptr ( ) . cast :: < u8 > ( ) ;
627+ match result7 {
628+ Ok ( _) => {
629+ * ptr8. add ( 0 ) . cast :: < u8 > ( ) = ( 0i32 ) as u8 ;
630+ }
631+ Err ( e) => {
632+ * ptr8. add ( 0 ) . cast :: < u8 > ( ) = ( 1i32 ) as u8 ;
633+ let vec9 = ( e. into_bytes ( ) ) . into_boxed_slice ( ) ;
634+ let ptr9 = vec9. as_ptr ( ) . cast :: < u8 > ( ) ;
635+ let len9 = vec9. len ( ) ;
636+ :: core:: mem:: forget ( vec9) ;
637+ * ptr8. add ( 8 ) . cast :: < usize > ( ) = len9;
638+ * ptr8. add ( 4 ) . cast :: < * mut u8 > ( ) = ptr9. cast_mut ( ) ;
639+ }
640+ } ;
641+ ptr8
642+ }
643+ #[ doc( hidden) ]
644+ #[ allow( non_snake_case) ]
645+ pub unsafe fn __post_return_customize < T : Guest > ( arg0 : * mut u8 ) {
646+ let l0 = i32:: from ( * arg0. add ( 0 ) . cast :: < u8 > ( ) ) ;
647+ match l0 {
648+ 0 => ( ) ,
649+ _ => {
650+ let l1 = * arg0. add ( 4 ) . cast :: < * mut u8 > ( ) ;
651+ let l2 = * arg0. add ( 8 ) . cast :: < usize > ( ) ;
652+ _rt:: cabi_dealloc ( l1, l2, 1 ) ;
653+ }
654+ }
655+ }
597656 pub trait Guest {
598657 /// renders the initial Web component with the given data
599658 /// and the target template to use as top level entry point
600659 fn render ( ctx : Context ) -> Result < _rt:: String , _rt:: String > ;
601660 /// listen on all or given selectors
602661 fn activate ( selectors : Option < _rt:: Vec < _rt:: String > > ) ;
662+ /// Optionally customize the configuration of the templates used to render the component
663+ fn customize (
664+ templates : _rt:: Vec < ( _rt:: String , _rt:: String ) > ,
665+ ) -> Result < ( ) , _rt:: String > ;
603666 }
604667 #[ doc( hidden) ]
605668
606669 macro_rules! __export_seed_keeper_wit_ui_wurbo_out_0_1_0_cabi{
607- ( $ty: ident with_types_in $( $path_to_types: tt) * ) => ( const _: ( ) = {
670+ ( $ty: ident with_types_in $( $path_to_types: tt) * ) => ( const _: ( ) = {
608671
609- #
[ export_name =
"seed-keeper:wit-ui/[email protected] #render" ] 610- unsafe extern "C" fn export_render( arg0: i32 , arg1: * mut u8 , arg2: * mut u8 , arg3: usize , arg4: i32 , arg5: * mut u8 , arg6: usize , arg7: i32 , arg8: * mut u8 , arg9: usize , arg10: i32 , arg11: * mut u8 , arg12: usize , ) -> * mut u8 {
611- $( $path_to_types) * :: _export_render_cabi:: <$ty>( arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)
612- }
613- #
[ export_name =
"cabi_post_seed-keeper:wit-ui/[email protected] #render" ] 614- unsafe extern "C" fn _post_return_render( arg0: * mut u8 , ) {
615- $( $path_to_types) * :: __post_return_render:: <$ty>( arg0)
616- }
617- #
[ export_name =
"seed-keeper:wit-ui/[email protected] #activate" ] 618- unsafe extern "C" fn export_activate( arg0: i32 , arg1: * mut u8 , arg2: usize , ) {
619- $( $path_to_types) * :: _export_activate_cabi:: <$ty>( arg0, arg1, arg2)
620- }
621- } ; ) ;
622- }
672+ #
[ export_name =
"seed-keeper:wit-ui/[email protected] #render" ] 673+ unsafe extern "C" fn export_render( arg0: i32 , arg1: * mut u8 , arg2: * mut u8 , arg3: usize , arg4: i32 , arg5: * mut u8 , arg6: usize , arg7: i32 , arg8: * mut u8 , arg9: usize , arg10: i32 , arg11: * mut u8 , arg12: usize , ) -> * mut u8 {
674+ $( $path_to_types) * :: _export_render_cabi:: <$ty>( arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)
675+ }
676+ #
[ export_name =
"cabi_post_seed-keeper:wit-ui/[email protected] #render" ] 677+ unsafe extern "C" fn _post_return_render( arg0: * mut u8 , ) {
678+ $( $path_to_types) * :: __post_return_render:: <$ty>( arg0)
679+ }
680+ #
[ export_name =
"seed-keeper:wit-ui/[email protected] #activate" ] 681+ unsafe extern "C" fn export_activate( arg0: i32 , arg1: * mut u8 , arg2: usize , ) {
682+ $( $path_to_types) * :: _export_activate_cabi:: <$ty>( arg0, arg1, arg2)
683+ }
684+ #
[ export_name =
"seed-keeper:wit-ui/[email protected] #customize" ] 685+ unsafe extern "C" fn export_customize( arg0: * mut u8 , arg1: usize , ) -> * mut u8 {
686+ $( $path_to_types) * :: _export_customize_cabi:: <$ty>( arg0, arg1)
687+ }
688+ #
[ export_name =
"cabi_post_seed-keeper:wit-ui/[email protected] #customize" ] 689+ unsafe extern "C" fn _post_return_customize( arg0: * mut u8 , ) {
690+ $( $path_to_types) * :: __post_return_customize:: <$ty>( arg0)
691+ }
692+ } ; ) ;
693+ }
623694 #[ doc( hidden) ]
624695 pub ( crate ) use __export_seed_keeper_wit_ui_wurbo_out_0_1_0_cabi;
625696 #[ repr( align( 4 ) ) ]
@@ -693,8 +764,8 @@ pub(crate) use __export_seedworld_impl as export;
693764#[ cfg( target_arch = "wasm32" ) ]
694765#[ link_section = "component-type:wit-bindgen:0.25.0:seedworld:encoded world" ]
695766#[ doc( hidden) ]
696- pub static __WIT_BINDGEN_COMPONENT_TYPE: [ u8 ; 982 ] = * b"\
697- \0 asm\x0d \0 \x01 \0 \0 \x19 \x16 wit-component-encoding\x04 \0 \x07 \xd6 \x06 \x01 A\x02 \x01 \
767+ pub static __WIT_BINDGEN_COMPONENT_TYPE: [ u8 ; 1025 ] = * b"\
768+ \0 asm\x0d \0 \x01 \0 \0 \x19 \x16 wit-component-encoding\x04 \0 \x07 \x81 \x07 \x01 A\x02 \x01 \
698769 A\x0d \x01 B\x04 \x01 p}\x01 k\0 \x01 r\x03 \x08 username\0 \x08 password\0 \x09 encrypted\x01 \
699770\x04 \0 \x0b credentials\x03 \0 \x02 \x03 \x01 \x1e seed-keeper:wallet/[email protected] \x05 \0 \x02 \ 700771\x03 \0 \0 \x0b credentials\x01 B\x0a \x02 \x03 \x02 \x01 \x01 \x04 \0 \x0b credentials\x03 \0 \0 \
@@ -710,12 +781,13 @@ nput\x0a\x04load\x06\x04\0\x07content\x03\0\x0b\x01q\x05\x0ball-content\x01\x0c\
710781\0 \x02 \x0e listen-details\x01 B\x06 \x02 \x03 \x02 \x01 \x04 \x04 \0 \x0e listen-details\x03 \
711782\0 \0 \x01 @\x01 \x07 details\x01 \x01 \0 \x04 \0 \x10 addeventlistener\x01 \x02 \x01 @\x01 \x07 \
712783 messages\x01 \0 \x04 \0 \x04 emit\x01 \x03 \x03 \x01 !seed-keeper:wit-ui/[email protected] \x05 \ 713- \x05 \x02 \x03 \0 \x02 \x07 context\x01 B\x09 \x02 \x03 \x02 \x01 \x06 \x04 \0 \x07 context\x03 \0 \
784+ \x05 \x02 \x03 \0 \x02 \x07 context\x01 B\x0e \x02 \x03 \x02 \x01 \x06 \x04 \0 \x07 context\x03 \0 \
714785\0 \x01 j\x01 s\x01 s\x01 @\x01 \x03 ctx\x01 \0 \x02 \x04 \0 \x06 render\x01 \x03 \x01 ps\x01 k\x04 \
715- \x01 @\x01 \x09 selectors\x05 \x01 \0 \x04 \0 \x08 activate\x01 \x06 \x04 \x01 \" seed-keeper:\
716- wit-ui/[email protected] \x05 \x07 \x04 \x01 \" seed-keeper:wit-ui/[email protected] \x04 \0 \ 717- \x0b \x0f \x01 \0 \x09 seedworld\x03 \0 \0 \0 G\x09 producers\x01 \x0c processed-by\x02 \x0d w\
718- it-component\x07 0.208.1\x10 wit-bindgen-rust\x06 0.25.0";
786+ \x01 @\x01 \x09 selectors\x05 \x01 \0 \x04 \0 \x08 activate\x01 \x06 \x01 o\x02 ss\x01 p\x07 \x01 \
787+ j\0 \x01 s\x01 @\x01 \x09 templates\x08 \0 \x09 \x04 \0 \x09 customize\x01 \x0a \x04 \x01 \" see\
788+ d-keeper:wit-ui/[email protected] \x05 \x07 \x04 \x01 \" seed-keeper:wit-ui/seedworld@0.\ 789+ 1.0\x04 \0 \x0b \x0f \x01 \0 \x09 seedworld\x03 \0 \0 \0 G\x09 producers\x01 \x0c processed-by\
790+ \x02 \x0d wit-component\x07 0.208.1\x10 wit-bindgen-rust\x06 0.25.0";
719791
720792#[ inline( never) ]
721793#[ doc( hidden) ]
0 commit comments