Singleton class for managing Tool related actions within the app.

Native

  • Used by the native part to send a font size change request to webviews

    Parameters

    • data: TFontSize

      font size in pixel to be set (default: 16)

    Returns void

    window.Web2Native2Web.Native2Web.Tool.setFontSize({font_size: 18});
    

Other

  • Method to hijack console logging to native

    Returns void

    Native2Web.Tool.enableNativeLogging()
    
  • Method to handle hijack console logging to native

    Parameters

    Returns void

     // hijacking console handled automatically
    // all console.log|warn|debug|error messages will be send to native part
  • Method to handle font size change requests from native

    Parameters

    Returns void

    Native2Web.Tool.handleSetFontSize((data) => {
    console.log('Font size change request received', data);
    });
  • Returns the singleton instance of the Tool class.

    Returns Tool

    The singleton instance of Tool.