Skip to main content

Globals & Utilities

Script globals and helpers: console, timers, text encoding, tasks, signals and connections, and shared utility modules.

Commonly used

Guides

All APIs in this topic

Import modules with import * as Ui from 'LensStudio:Ui'.

Components, assets, and modules

Objects and data

APIDescription
Base64Utility class for encoding and decoding data in base64 format.
clearIntervalRemove the interval calls.
clearTimeoutCancels the timeout.
consoleOutput logging utilities for plugin scripts.
createFunctionObjectDynamically creates a function object from a string of JavaScript code.
Editor.ScopedConnectionStores event listener connections, automatically cleaned up on scope exit.
Editor.ShapeRepresents a 2D or 3D shape object.
Editor.VersionVersion information for the editor or plugin.
global
ScriptObjectBase class for all script-accessible Lens Studio objects.
setIntervalRepeatedly call callback every delayMs milliseconds.
setTimeoutCall callback after delayMs milliseconds.
signal0An interface that allows you to bind a callback on connect.
signal1An interface that allows you to bind a callback on connect.
signal2An interface that allows you to bind a callback on connect.
signal3An interface that allows you to bind a callback on connect.
signal4An interface that allows you to bind a callback on connect.
signal5An interface that allows you to bind a callback on connect.
TaskNamespace providing task management utilities for tracking and coordinating asynchronous operations.
TextDecoderDecodes binary data from a Uint8Array into a string using a specified character encoding.
TextEncoderEncodes strings into UTF-8 byte arrays.
TimeoutA handle for a timer.

Enums

APIDescription
Editor.AxisEnum of spatial axes.