selene-cui-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

JavaScript Bindings for Selene CUI

This JavaScript library is part of the Selene project. It provides utility methods for interacting with Selene CUI, allowing the embedded browser to interact with the game and vice-versa.

Installation

npm install selene-cui-js

Usage

import { quit, openUrl, rpc, onEvent } from 'selene-cui-js';

// Quit the game
quit();

// Open a URL in the system's default browser (as opposed to the embedded browser)
openUrl('https://example.com');

// Call a custom RPC method you've defined in a bundle
rpc('myCustomMethod', { foo: 'bar' });

// Listen for a custom event you fire in a bundle
onEvent('myCustomEvent', (data) => {
  console.log('Received custom event:', data);
});

For more information on CUI, read the guide in the Selene Developer documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i selene-cui-js

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

7.49 kB

Total Files

6

Last publish

Collaborators

  • blaytheninth