Global

Methods

clearInterval(timerID)

Parameters:
Name Type Description
timerID number

clearTimeout(timerID)

Parameters:
Name Type Description
timerID number

include(path, optionsopt)

Evaluates the script in file.
Similar to `eval(utils.ReadTextFile(path))`, but provides more features:
- Has `include guards` - script won't be evaluated a second time if it was evaluated before in the same panel.
- Has script caching - script file will be read only once from filesystem (even if it is included from different panels).
- Has better error reporting.

Note: when the relative `path` is used it will be searched in the following paths:
- `${current_package_path}/scripts/${path}`, if the panel uses a package script.
- `${current_script_path}/${path}`, if the script is not a top-level `in-memory` script.
- `${fb.ComponentPath}/${path}`, otherwise.
Parameters:
Name Type Attributes Description
path string Absolute or relative path to JavaScript file.
options object <optional>
Properties
Name Type Attributes Default Description
always_evaluate boolean <optional>
false If true, evaluates the script even if it was included before.
Example

Include sample from `foo_spider_monkey_panel`

include('samples/complete/properties.js')

setInterval(func, delay, …func_argsopt) → {number}

Parameters:
Name Type Attributes Description
func function
delay number
func_args * <optional>
<repeatable>
Returns:
number

setTimeout(func, delay, …func_argsopt) → {number}

Parameters:
Name Type Attributes Description
func function
delay number
func_args * <optional>
<repeatable>
Returns:
number
Example
// See `samples/basic/Timer.js`

Type Definitions

ArtPromiseResult

Properties:
Name Type Attributes Description
image GdiBitmap <nullable>
null on failure
path string path to image file (or track file if image is embedded)

float

JsMemoryStats

Return value of window.JsMemoryStats.
Properties:
Name Type Description
MemoryUsage number Memory usage of the current panel (in bytes)
TotalMemoryUsage number Total memory usage of all panels (in bytes)
TotalMemoryLimit number Maximum allowed memory usage for the component (in bytes).
If the total memory usage exceeds this value, all panels will fail with OOM error.

ScriptInfo

Return value of window.ScriptInfo.
Note: package_id is only present when the panel script is a package.
Properties:
Name Type Attributes Description
Name string
Author string <optional>
Version string <optional>
PackageId string <optional>