Facilities for querying installed JavaScript applications.
More...
#include "js_app.h"
#include <furi/core/string.h>
Go to the source code of this file.
|
|
typedef enum JsAppRegistryAppUninstallResult | JsAppRegistryAppUninstallResult |
| |
| typedef void(* | JsAppRegistryListCallback) (const JsAppInfo *info, void *context) |
| | Type for a callback to be invoked for each JavaScript application found.
|
| |
|
| enum | JsAppRegistryAppUninstallResult { JsAppRegistryAppUninstallResultOk
, JsAppRegistryAppUninstallResultNotFound
, JsAppRegistryAppUninstallResultStorageError
} |
| |
Facilities for querying installed JavaScript applications.
- See also
- js_app.h for more info on JavaScript apps.
◆ JsAppRegistryListCallback
| typedef void(* JsAppRegistryListCallback) (const JsAppInfo *info, void *context) |
Type for a callback to be invoked for each JavaScript application found.
- Warning
- The
info parameter is valid ONLY inside the callback function. If the calling code needs it for further processing, it must make a deep copy of the data.
- Parameters
-
| [in] | info | pointer to an application info structure associated with an app found |
| [in,out] | context | pointer to a user-specific object |
◆ js_app_registry_get_app()
| JsApp * js_app_registry_get_app |
( |
const char * | app_id | ) |
|
Get a JavaScript application by its ID.
- Note
- If the call succeeds, the user code is responsible for deleting the return value via
js_app_free() when done with it.
- Parameters
-
| [in] | app_id | zero-terminated string containing the desired application's ID |
- Returns
- pointer to a JsApp instance associated with the found app, or
NULL on failure
◆ js_app_registry_get_app_path()
| FuriString * js_app_registry_get_app_path |
( |
const char * | app_id | ) |
|
Validate app ID and get installation path for a JavaScript application by its ID.
Valid app IDs correspond to the following regular expression: [a-zA-Z0-9_-][a-zA-Z0-9_-.]*
- Parameters
-
| [in] | app_id | zero-terminated string containing the desired application's ID |
- Returns
- path in filesystem or
NULL if app_id is invalid
◆ js_app_registry_list_apps()
List all installed JavaScript applications.
- Parameters
-
| [in] | callback | pointer to the function to be called for each application found |
| [in,out] | context | pointer to a user-specific object (will be passed to the callback) |
◆ js_app_registry_uninstall_app()
| JsAppRegistryAppUninstallResult js_app_registry_uninstall_app |
( |
const char * | app_id | ) |
|
Delete an installed JavaScript application.
- Parameters
-
| [in] | app_id | zero-terminated string containing the desired application's ID |
- Returns
- operation result