package bindings

import (
	"syscall/js"
)

type App struct{}

func (a App) Provide() (string, error) {
	val, err := Promise[String]{a.js().Call("Provide")}.Await()
	return string(val), err
}

func (a App) Ready() (bool, error) {
	val, err := Promise[Bool]{a.js().Call("Ready")}.Await()
	return bool(val), err
}

func (a App) js() js.Value {
	return js.Global().Get("go").Get("main").Get("App")
}