https://github.com/holepunchto/libfx bindings for JavaScript.
npm install fx-native
See example/.
const app = App.shared()app.isMainapp.isWorkerapp.isRunningapp.isSuspendedapp.run():warning: Only has an effect on the main thread.
app.broadcast(buffer)app.destroy()app.on('launch')app.on('terminate')app.on('message', buffer):warning: Only available on the main thread.
const screen = Screen.main()screen.getBounds():warning: Only available on the main thread.
const window = new Window(x, y, width, height[, options])Options include:
options = {
frame: true
}
window.isVisiblewindow.isClosedwindow.appendChild(child)window.removeChild(child)window.getBounds()window.show()window.hide()window.activate()window.destroy()window.on('resize', width, height)window.on('move', x, y)window.on('minimize')window.on('deminimize')window.on('close')window.on('show')window.on('hide')node.isAttachednode.isDestroyednode.appendChild(child)node.removeChild(child)node.destroy()node.on('attach')node.on('detach')node.on('destroy')Extends Node.
:warning: Only available on the main thread.
const view = new View(x, y, width, height)view.getBounds()view.setBounds(x, y, width, height)Extends Node.
:warning: Only available on the main thread.
const text = new Text(x, y, width, height)text.getBounds()text.getBoundsUsed()text.setBounds(x, y, width, height)Extends Node.
:warning: Only available on the main thread.
const image = new Image(x, y, width, height)image.getBounds()image.setBounds(x, y, width, height)image.loadFile(path)image.loadPixels(pixels, width, height[, stride])Extends Node.
:warning: Only available on the main thread.
const webView = new WebView(x, y, width, height)webView.getBounds()webView.setBounds(x, y, width, height)webView.postMessage(json)webView.loadURL(url)webView.loadHTML(html)webView.on('message', json)Apache-2.0