fn generate_class_helper(&self,class_type: &MyTypePath) -> TokenStream {

        let type_name = class_type.type_name().unwrap();

        let helper_module_name = Ident::new(
            &format!("{}_helper",type_name).to_lowercase(),
            Span::call_site());

        let class_type_lit = LitStr::new(&format!("{}",type_name),Span::call_site());

        let ty = class_type.inner();

        let (properties,constructor ) = self.generate_properties();

        let ( constructor_token,fn_arg) = self.class_constructor(constructor);

        let constructor_arg = self.generate_class_arg(&type_name,fn_arg);

        let construct_name = Ident::new(&format!("{}Constructor",type_name),Span::call_site());

        quote!{

            use #helper_module_name::#construct_name;

            mod #helper_module_name {

                use std::ptr;
                use node_bindgen::core::JSClass;

                use super::#ty;

                static mut CLASS_CONSTRUCTOR: node_bindgen::sys::napi_ref = ptr::null_mut();

                impl node_bindgen::core::JSClass for #ty {
                    const CLASS_NAME: &'static str = #class_type_lit;
                  

                    fn set_constructor(constructor: node_bindgen::sys::napi_ref) {
                        unsafe {
                            CLASS_CONSTRUCTOR = constructor;
                        }
                    }
            
                    fn get_constructor() -> node_bindgen::sys::napi_ref {
                        unsafe { CLASS_CONSTRUCTOR }
                    }

                    fn properties() -> node_bindgen::core::PropertiesBuilder {
            
                        vec![
                            #(#properties)*
                        ].into()
                    }

                    #constructor_token
            
                }

                #constructor_arg

                use node_bindgen::core::submit_register_callback;


                #[node_bindgen::core::ctor]
                fn register_class() {
                    submit_register_callback(#ty::js_init);
                }
            }


        }
    }
// generate internal module that contains Js class helper
generate internal module that contains Js class helper
generate internal module that contains Js class helper
fn generate_class_helper(&self,class_type: &MyTypePath) -> TokenStream {
        let type_name = class_type.type_name().unwrap();
        let helper_module_name = Ident::new(
            &format!("{}_helper",type_name).to_lowercase(),
            Span::call_site());
        let class_type_lit = LitStr::new(&format!("{}",type_name),Span::call_site());
        let ty = class_type.inner();
        let (properties,constructor ) = self.generate_properties();
        let ( constructor_token,fn_arg) = self.class_constructor(constructor);
        let constructor_arg = self.generate_class_arg(&type_name,fn_arg);
        let construct_name = Ident::new(&format!("{}Constructor",type_name),Span::call_site());
        quote!{
            use #helper_module_name::#construct_name;
            mod #helper_module_name {
                use std::ptr;
                use node_bindgen::core::JSClass;
                use super::#ty;
                static mut CLASS_CONSTRUCTOR: node_bindgen::sys::napi_ref = ptr::null_mut();
                impl node_bindgen::core::JSClass for #ty {
                    const CLASS_NAME: &'static str = #class_type_lit;
                    fn set_constructor(constructor: node_bindgen::sys::napi_ref) {
                        unsafe {
                            CLASS_CONSTRUCTOR = constructor;
                        }
                    }
                    fn get_constructor() -> node_bindgen::sys::napi_ref {
                        unsafe { CLASS_CONSTRUCTOR }
                    }
                    fn properties() -> node_bindgen::core::PropertiesBuilder {
                        vec![
                            #(#properties)*
                        ].into()
                    }
                    #constructor_token
                }
                #constructor_arg
                use node_bindgen::core::submit_register_callback;
                #[node_bindgen::core::ctor]
                fn register_class() {
                    submit_register_callback(#ty::js_init);
                }
            }
        }
    }
fn generate_class_helper ( & self , class_type : & MyTypePath ) -> TokenStream { let type_name = class_type . type_name ( ) . unwrap ( ) ; let helper_module_name = Ident :: new ( & format ! ( " " type_name ) . to_lowercase ( ) , Span :: call_site ( ) ) ; let class_type_lit = LitStr :: new ( & format ! ( " " type_name ) , Span :: call_site ( ) ) ; let ty = class_type . inner ( ) ; let ( properties , constructor ) = self . generate_properties ( ) ; let ( constructor_token , fn_arg ) = self . class_constructor ( constructor ) ; let constructor_arg = self . generate_class_arg ( & type_name , fn_arg ) ; let construct_name = Ident :: new ( & format ! ( " " type_name ) , Span :: call_site ( ) ) ; quote ! { use helper_module_name construct_name mod helper_module_name { use std ptr use node_bindgen core JSClass use super ty static mut CLASS_CONSTRUCTOR node_bindgen sys napi_ref ptr null_mut ( ) impl node_bindgen core JSClass for ty { const CLASS_NAME ' static str class_type_lit fn set_constructor ( constructor node_bindgen sys napi_ref ) { unsafe { CLASS_CONSTRUCTOR constructor } } fn get_constructor ( ) node_bindgen sys napi_ref { unsafe { CLASS_CONSTRUCTOR } } fn properties ( ) node_bindgen core PropertiesBuilder { vec [ ( properties ) ] into ( ) } constructor_token } constructor_arg use node_bindgen core submit_register_callback [ node_bindgen core ctor ] fn register_class ( ) { submit_register_callback ( ty js_init ) } } } }
generate internal module that contains Js class helper
generate internal module that contains Js class helper
&self
class_type
&MyTypePath