@ott-smarttv/util-native
TypeScript icon, indicating that this package has built-in type declarations

1.2.5 • Public • Published

Osiris SmartTV Native Util

Setup

NativeUtil.getInstance()?.loadScripts({
  scripts: undefined,
  onLoadSuccess: (data) => {
    ReactDOM.render(
      <App />
      ,
      document.getElementById('root')
    );
  },
})

Example

useEffect(() => {
    (async () => {
      const res = await UtilNative.getInstance()?.getBaseInfo()
      setRes(() => res)
      console.log("🚀 ~ res:", res)
    })()
    UtilNative.getInstance()?.onEvent(ListenerEvent.NETWORK_CHANGE, (res) => 
     {
      console.log("🚀 ~ network:", res)
      setNetwork(() => res)
    })
    UtilNative.getInstance()?.onEvent(ListenerEvent.MOUSE_ENABLE, (e) => {
      console.log('mouse', e)
      setMouse(() => e)
    })
    UtilNative.getInstance()?.onEvent(ListenerEvent.STATUS_KEYBOARD_CHANGE, 
     (e) => {
      console.log('keyboard', e)
      setKeyboard(() => e)
    })
  }, [])

Package Sidebar

Install

npm i @ott-smarttv/util-native

Weekly Downloads

0

Version

1.2.5

License

MIT

Unpacked Size

85.1 kB

Total Files

42

Last publish

Collaborators

  • zysd836