BSB Developer Docs
Loading...
Searching...
No Matches
js_app_registry.h File Reference

Facilities for querying installed JavaScript applications. More...

#include "js_app.h"
#include <furi/core/string.h>

Go to the source code of this file.

Typedefs

typedef enum JsAppRegistryAppUninstallResult JsAppRegistryAppUninstallResult
 
typedef void(* JsAppRegistryListCallback) (const JsAppInfo *info, void *context)
 Type for a callback to be invoked for each JavaScript application found.
 

Enumerations

enum  JsAppRegistryAppUninstallResult { JsAppRegistryAppUninstallResultOk , JsAppRegistryAppUninstallResultNotFound , JsAppRegistryAppUninstallResultStorageError }
 

Functions

void js_app_registry_list_apps (JsAppRegistryListCallback callback, void *context)
 List all installed JavaScript applications.
 
JsApp * js_app_registry_get_app (const char *app_id)
 Get a JavaScript application by its ID.
 
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.
 
JsAppRegistryAppUninstallResult js_app_registry_uninstall_app (const char *app_id)
 Delete an installed JavaScript application.
 

Detailed Description

Facilities for querying installed JavaScript applications.

See also
js_app.h for more info on JavaScript apps.

Typedef Documentation

◆ 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]infopointer to an application info structure associated with an app found
[in,out]contextpointer to a user-specific object

Function Documentation

◆ 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_idzero-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_idzero-terminated string containing the desired application's ID
Returns
path in filesystem or NULL if app_id is invalid

◆ js_app_registry_list_apps()

void js_app_registry_list_apps ( JsAppRegistryListCallback callback,
void * context )

List all installed JavaScript applications.

Parameters
[in]callbackpointer to the function to be called for each application found
[in,out]contextpointer 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_idzero-terminated string containing the desired application's ID
Returns
operation result