Page 1 of 2

Infinity Store - publication

Prerequisites and documentation

Technical Guide: Developing for Infinity OS


1. Working with system dialogs and await

In Infinity OS, standard user interaction methods are rewritten for asynchronous execution. This allows you to avoid blocking the main thread and write clean, linear code.

Asynchrony: The confirm and prompt methods require the use of await. The system stops the application script execution until a response is received from the user.


Syntax:


// Example of receiving confirmation const isConfirmed = await parent.confirm("Really?"); // Data input const userName = await parent.prompt("What's your name?");
2. Specifics of HTML applications and the parent object

If your application is HTML (loaded in an iframe), it is isolated from the global context system. To access system functions, variables, and APIs, you must always use the parent prefix.

Console and dialogs: parent.console, parent.alert, parent.prompt, parent.confirm.

System variables: parent.fs (файлова система), parent.apps (список додатків).

Віконний менеджер: parent.wm.

Ex. 1 - reading additional files: Для пошуку внутрішніх ресурсів додатка у віртуальній ФС використовуйте:

const f = parent.fs.find(f => f.name.endsWith("folder/file.txt")); if (f) { parent.console.log("Файл знайдено: " + f.name); }
3. Creating windows in JS applications (Window Manager)

If your application's executable is JS, you control the interface through the wm constructor. This allows you to create flexible windows with custom size and content parameters.

Creating window:

new wm("Title", { class: wbtheme + " no-full", html: 'H', // Use "url" attribute if you need to open address not window with content maxwidth: 100, width: 50, minwidth: 20, maxheight: 100, height: 50, minheight: 20 });

Note: When using the url attribute in the iframe tag in the html field, the system automatically integrates the specified address into the window context.