Constructors#
Constructor#
EditorAPI
EditorAPIRole & Scope Management#
setRole()#
Set the user role and apply role-dependent defaults.
Automatically configures scopes and settings based on the specified role.
Parameters#
| Parameter | Type | Description |
|---|---|---|
role |
RoleString |
The role to assign to the user. |
Returns#
void
Signature#
setRole(role: RoleString): voidgetRole()#
Get the current user role.
Returns#
RoleStringThe current role of the user.
Signature#
getRole(): RoleStringfindAllScopes()#
Get all available global scope names.
Returns#
Scope[]
The names of all available global scopes.
Signature#
findAllScopes(): Scope[]setGlobalScope()#
Set a global scope permission level.
Parameters#
| Parameter | Type | Description |
|---|---|---|
key |
Scope |
The scope to configure. |
value |
"Allow" |
"Deny" |
Returns#
void
Signature#
setGlobalScope(key: Scope, value: "Allow" | "Deny" | "Defer"): voidgetGlobalScope()#
Get a global scope’s permission level.
Parameters#
| Parameter | Type | Description |
|---|---|---|
key |
Scope |
The scope to query. |
Returns#
"Allow" | "Deny" | "Defer"
Allow, Deny, or Defer indicating the scope’s permission level.
Signature#
getGlobalScope(key: Scope): "Allow" | "Deny" | "Defer"Event Subscriptions#
onStateChanged#
Subscribe to editor state changes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
() => void |
Function called when the editor state changes. |
Returns#
A method to unsubscribe from the event.
() => void
onHistoryUpdatedWithKind#
Subscribe to undo/redo history changes.
The callback receives a HistoryUpdate describing what kind of update happened so consumers can
distinguish a real change to the active history’s snapshots (e.g. an edit, undo, or redo) from a pure activation
via setActiveHistory.
const unsubscribe = engine.editor.onHistoryUpdatedWithKind((kind) => { if (kind === 'Activated') { // The active history was switched; no scene change happened on this event. return; } const canUndo = engine.editor.canUndo(); const canRedo = engine.editor.canRedo(); console.log('History updated', { canUndo, canRedo });});Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
(kind) => void |
Function called when the undo/redo history changes. The argument describes the kind of update. |
Returns#
A method to unsubscribe from the event.
() => void
onSettingsChanged#
Subscribe to editor settings changes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
() => void |
Function called when editor settings change. |
Returns#
A method to unsubscribe from the event.
() => void
onRoleChanged#
Subscribe to editor role changes.
Allows reacting to role changes and updating engine settings accordingly. The callback is triggered immediately after role changes and default settings are applied.
Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
(role) => void |
Function called when the user role changes. |
Returns#
A method to unsubscribe from the event.
() => void
Edit Mode Management#
setEditMode()#
Set the editor’s current edit mode.
Edit modes represent different tools or interaction states within the editor. Common ones, are “Crop” while the crop tool is shown or “Text” when inline-editing text.
engine.editor.setEditMode('Crop');// With a base modeengine.editor.setEditMode('CustomMode', 'Crop');Parameters#
| Parameter | Type | Description |
|---|---|---|
mode |
EditMode |
“Transform”, “Crop”, “Text”, “Playback”, “Trim”, “Vector” or a custom value. |
baseMode? |
string |
Optional base mode from which the custom mode will inherit the settings. |
Returns#
void
Signature#
setEditMode(mode: EditMode, baseMode?: string): voidgetEditMode()#
Get the editor’s current edit mode.
Edit modes represent different tools or interaction states within the editor. Common ones, are “Crop” while the crop tool is shown or “Text” when inline-editing text.
Returns#
EditMode“Transform”, “Crop”, “Text”, “Playback”, “Trim”, “Vector” or a custom value.
Signature#
getEditMode(): EditModegetCursorType()#
Get the cursor type that should be displayed.
Returns#
| "Text"
| "Arrow"
| "Move"
| "MoveNotPermitted"
| "Resize"
| "Rotate"
| "Cell"
The cursor type.
Signature#
getCursorType(): "Text" | "Arrow" | "Move" | "MoveNotPermitted" | "Resize" | "Rotate" | "Cell"getCursorRotation()#
Get the cursor rotation angle.
Returns#
number
The angle in radians.
Signature#
getCursorRotation(): numbergetTextCursorPositionInScreenSpaceX()#
Get the text cursor’s x position in screen space.
Returns#
number
The text cursor’s x position in screen space.
Signature#
getTextCursorPositionInScreenSpaceX(): numbergetTextCursorPositionInScreenSpaceY()#
Get the text cursor’s y position in screen space.
Returns#
number
The text cursor’s y position in screen space.
Signature#
getTextCursorPositionInScreenSpaceY(): numberHistory Management#
createHistory()#
Create a new undo/redo history stack.
Multiple histories can exist, but only one can be active at a time.
const newHistory = engine.editor.createHistory();Returns#
number
The handle of the created history.
Signature#
createHistory(): numberdestroyHistory()#
Destroy a history stack and free its resources.
engine.editor.destroyHistory(oldHistory);Parameters#
| Parameter | Type | Description |
|---|---|---|
history |
number |
The history handle to destroy. |
Returns#
void
Throws#
Error if the handle doesn’t refer to a valid history.
Signature#
destroyHistory(history: number): voidsetActiveHistory()#
Set a history as the active undo/redo stack.
All other histories lose their active state. Undo/redo operations only apply to the active history. A new history starts from the current scene, including edits without an undo step and the selection; returning to a history restores its last undo step. Setting a history that is not new as active, also the active one, discards edits without an undo step. Edits with an undo step stay in the history they were made in.
engine.editor.setActiveHistory(newHistory);Parameters#
| Parameter | Type | Description |
|---|---|---|
history |
number |
The history handle to make active. |
Returns#
void
Throws#
Error if the handle doesn’t refer to a valid history.
Signature#
setActiveHistory(history: number): voidgetActiveHistory()#
Get the currently active history handle.
Creates a new history if none exists.
const oldHistory = engine.editor.getActiveHistory();Returns#
number
The handle of the active history.
Signature#
getActiveHistory(): numberaddUndoStep()#
Add a new history state to the undo stack.
Only adds a state if undoable changes were made since the last undo step.
engine.editor.addUndoStep();Returns#
void
Signature#
addUndoStep(): voidremoveUndoStep()#
Remove the last history state from the undo stack.
Removes the most recent undo step if available.
engine.editor.removeUndoStep();Returns#
void
Signature#
removeUndoStep(): voidundo()#
Undo one step in the active history if an undo step is available.
Scene edits made since the last undo step are discarded. Call addUndoStep first, so that
redo can restore them.
engine.editor.undo();Returns#
void
Signature#
undo(): voidredo()#
Redo one step in the active history if a redo step is available.
Scene edits made since the last undo step are discarded. Call addUndoStep first
to keep them, which clears the redo steps.
engine.editor.redo();Returns#
void
Signature#
redo(): voidcanUndo()#
Check if an undo step is available.
if (engine.editor.canUndo()) { engine.editor.undo();}Returns#
boolean
True if an undo step is available.
Signature#
canUndo(): booleancanRedo()#
Check if a redo step is available.
if (engine.editor.canRedo()) { engine.editor.redo();}Returns#
boolean
True if a redo step is available.
Signature#
canRedo(): booleanColor Management#
findAllSpotColors()#
Get all spot color names currently defined.
Returns#
string[]
The names of all defined spot colors.
Signature#
findAllSpotColors(): string[]getSpotColorRGBA()#
Queries the RGB representation set for a spot color.
If the value of the queried spot color has not been set yet, returns the default RGB representation (of magenta). The alpha value is always 1.0.
Parameters#
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of a spot color. |
Returns#
RGBAA result holding a float array of the four color components.
Signature#
getSpotColorRGBA(name: string): RGBAgetSpotColorCMYK()#
Queries the CMYK representation set for a spot color.
If the value of the queried spot color has not been set yet, returns the default CMYK representation (of magenta).
Parameters#
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of a spot color. |
Returns#
CMYKA result holding a float array of the four color components.
Signature#
getSpotColorCMYK(name: string): CMYKsetSpotColorRGB()#
Sets the RGB representation of a spot color.
Use this function to both create a new spot color or update an existing spot color.
Parameters#
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of a spot color. |
r |
number |
The red color component in the range of 0 to 1. |
g |
number |
The green color component in the range of 0 to 1. |
b |
number |
The blue color component in the range of 0 to 1. |
Returns#
void
Signature#
setSpotColorRGB(name: string, r: number, g: number, b: number): voidsetSpotColorCMYK()#
Sets the CMYK representation of a spot color.
Use this function to both create a new spot color or update an existing spot color.
Parameters#
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of a spot color. |
c |
number |
The cyan color component in the range of 0 to 1. |
m |
number |
The magenta color component in the range of 0 to 1. |
y |
number |
The yellow color component in the range of 0 to 1. |
k |
number |
The key color component in the range of 0 to 1. |
Returns#
void
Signature#
setSpotColorCMYK(name: string, c: number, m: number, y: number, k: number): voidremoveSpotColor()#
Removes a spot color from the list of set spot colors.
Parameters#
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of a spot color. |
Returns#
void
An empty result on success, an error otherwise.
Signature#
removeSpotColor(name: string): voidsetSpotColorForCutoutType()#
Set the spot color assign to a cutout type.
All cutout blocks of the given type will be immediately assigned that spot color.
Parameters#
| Parameter | Type | Description |
|---|---|---|
type |
"Dashed" |
"Solid" |
color |
string |
The spot color name to assign. |
Returns#
void
Signature#
setSpotColorForCutoutType(type: "Dashed" | "Solid", color: string): voidgetSpotColorForCutoutType()#
Get the name of the spot color assigned to a cutout type.
Parameters#
| Parameter | Type | Description |
|---|---|---|
type |
"Dashed" |
"Solid" |
Returns#
string
The color spot name.
Signature#
getSpotColorForCutoutType(type: "Dashed" | "Solid"): stringsetSoftProofEnabled()#
Turn soft proofing of the live canvas on or off.
With proofing on, the artwork inside the visible page trims shows the colors of the output profile of getSoftProofColorSpace. Exports, thumbnails, bleed and editor decorations stay unproofed. The state is not saved with the scene, and undo does not change it. Creating or loading a scene, or applying a template, turns proofing off and sets the color space to CMYK. A setActiveHistory call that switches to another scene does the same by the next update. A change notifies the onStateChanged subscribers.
engine.editor.setSoftProofColorSpace('CMYK');engine.editor.setSoftProofEnabled(true);Parameters#
| Parameter | Type | Description |
|---|---|---|
enabled |
boolean |
Whether to proof the live canvas. Defaults to false. |
Returns#
void
Signature#
setSoftProofEnabled(enabled: boolean): voidisSoftProofEnabled()#
Check whether soft proofing of the live canvas is on.
Returns#
boolean
True when the live canvas is proofed.
Signature#
isSoftProofEnabled(): booleansetSoftProofColorSpace()#
Set the color space that soft proofing simulates.
The proof uses the Output profile of that space, then its Default profile, then the fallback profile. Creating or loading a scene, or applying a template, sets the color space to CMYK. A setActiveHistory call that switches to another scene does the same by the next update. A change notifies the onStateChanged subscribers.
Parameters#
| Parameter | Type | Description |
|---|---|---|
colorSpace |
SoftProofColorSpace |
'RGB' or 'CMYK'. Defaults to 'CMYK'. |
Returns#
void
Throws#
COLOR.SOFT_PROOF_SPACE_UNSUPPORTED for another color space. The previous color space
stays in use.
Signature#
setSoftProofColorSpace(colorSpace: SoftProofColorSpace): voidgetSoftProofColorSpace()#
Get the color space that soft proofing simulates.
Returns#
SoftProofColorSpace'RGB' or 'CMYK'.
Signature#
getSoftProofColorSpace(): SoftProofColorSpaceconvertColorToColorSpace()#
Converts a color to the given color space.
In Managed scenes, converting sRGB colors or RGB-only spot approximations to CMYK
uses the document or fallback CMYK profile.
While the required profile loads from a URI, this conversion throws COLOR.PROFILE_NOT_LOADED.
Await loadColorProfiles first. RGB-to-CMYK conversion uses a simple formula
if the profile only converts CMYK to RGB or cannot load.
COLOR.PROFILE_NOT_LOADED.
Await loadColorProfiles first. RGB-to-CMYK conversion uses a simple formula
if the profile only converts CMYK to RGB or cannot load.Parameters#
| Parameter | Type | Description |
|---|---|---|
color |
Color |
The color to convert. |
colorSpace |
"sRGB" |
The color space to convert to. |
Returns#
RGBAColorThe converted color.
Call Signature#
convertColorToColorSpace(color, colorSpace): CMYKColor;Parameters#
| Parameter | Type |
|---|---|
color |
Color |
colorSpace |
"CMYK" |
Returns#
CMYKColorCall Signature#
convertColorToColorSpace(color, colorSpace): never;Parameters#
| Parameter | Type |
|---|---|
color |
Color |
colorSpace |
ColorSpace |
Returns#
never
Signatures#
convertColorToColorSpace(color: Color, colorSpace: "sRGB"): RGBAColorconvertColorToColorSpace(color: Color, colorSpace: "CMYK"): CMYKColorconvertColorToColorSpace(color: Color, colorSpace: ColorSpace): neverloadCMYKProfile()#
Loads the CMYK profile used for managed color conversion and preview.
The profile is a resource, and a resource takes several update cycles to arrive, so a
conversion that needs it can fail right after the engine starts. Await this once and every later convertColorToColorSpace answers without handling COLOR.PROFILE_NOT_LOADED.
Loads the profile the document names, otherwise the one the fallbackCMYKProfileUri setting
names, which is the bundled default profile while that setting is unset. Call it again after
changing either, so the new profile is loaded before the next conversion.
await engine.editor.loadColorProfiles();const rgb = engine.editor.convertColorToColorSpace(cmyk, 'sRGB');Parameters#
| Parameter | Type | Description |
|---|---|---|
options? |
AbortOptions |
An abortSignal that ends the wait. The download of the profile goes on, because the document keeps its profile loaded for its color conversions. |
Returns#
Promise<void>
A promise that resolves once the profile is loaded, and rejects with
COLOR.PROFILE_MISSING when it cannot be read.
Deprecated#
Use loadColorProfiles instead.
Resource Management#
createBuffer()#
Create a resizable buffer for arbitrary data.
const buffer = engine.editor.createBuffer();
// Reference the buffer resource from the audio blockengine.block.setString(audioBlock, 'audio/fileURI', buffer);Returns#
string
A URI to identify the created buffer.
Signature#
createBuffer(): stringdestroyBuffer()#
Destroy a buffer and free its resources.
engine.editor.destroyBuffer(buffer);Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to destroy. |
Returns#
void
Signature#
destroyBuffer(uri: string): voidsetBufferData()#
Set the data of a buffer at a given offset.
// Generate 10 seconds of stereo 48 kHz audio dataconst samples = new Float32Array(10 * 2 * 48000);for (let i = 0; i < samples.length; i += 2) { samples[i] = samples[i + 1] = Math.sin((440 * i * Math.PI) / 48000);}// Assign the audio data to the bufferengine.editor.setBufferData(buffer, 0, new Uint8Array(samples.buffer));Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to update. |
offset |
number |
The offset in bytes at which to start writing. |
data |
Uint8Array |
The data to write. |
Returns#
void
Signature#
setBufferData(uri: string, offset: number, data: Uint8Array): voidgetBufferData()#
Get the data of a buffer at a given offset.
engine.editor.findAllTransientResources().forEach((resource) => { const bufferURI = resource.URL; const length = engine.editor.getBufferLength(buffer); const data = engine.editor.getBufferData(buffer, 0, length); const blob = new Blob([data]);})Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to query. |
offset |
number |
The offset in bytes at which to start reading. |
length |
number |
The number of bytes to read. |
Returns#
Uint8Array
The data at the given offset.
Signature#
getBufferData(uri: string, offset: number, length: number): Uint8ArraysetBufferLength()#
Set the length of a buffer.
// Reduce the buffer to half its lengthconst currentLength = engine.editor.getBufferLength(buffer);engine.editor.setBufferLength(buffer, currentLength / 2);Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to update. |
length |
number |
The new length of the buffer in bytes. |
Returns#
void
Signature#
setBufferLength(uri: string, length: number): voidgetBufferLength()#
Get the length of a buffer.
const length = engine.editor.getBufferLength(buffer);Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to query. |
Returns#
number
The length of the buffer in bytes.
Signature#
getBufferLength(uri: string): numbergetFileFormats()#
Lists native image, audio and video formats available in this runtime.
Reflects current features, license and measured codec families. Starts no
downloads or codec probes. Use checkFileSupport to inspect a concrete file.
Host-provided editable document importers and fonts are outside this catalog.
Returns#
Native format support at the format inspection level.
Signature#
getFileFormats(): FileSupport[]checkFileSupport()#
Inspects a resource’s header/container and reports its native media uses.
Downloads through the resource registry when needed; buffer URIs accept
caller-provided bytes. Does not create blocks or fully decode media. A
supported result confirms known format/codec-family support, not every
profile or a later import. Starts no codec probes; unmeasured families
remain unchecked. Host-provided editable document importers are separate.
Engine updates drive pending work. A call that still waits when the engine
is disposed settles only when its abortSignal aborts.
Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
Resource URI, including an existing engine buffer URI. |
options? |
AbortOptions |
An abortSignal that stops the download and the inspection of the resource. |
Returns#
Promise<FileSupport>
Support at the metadata inspection level, including unsupported formats.
Throws#
A structured error for invalid URIs, failed downloads or corrupt recognized metadata.
Signature#
checkFileSupport(uri: string, options?: AbortOptions): Promise<FileSupport>getMimeType()#
Get the MIME type of a resource.
Downloads the resource if not already cached.
Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the resource. |
options? |
AbortOptions |
An abortSignal that stops the download of the resource. |
Returns#
Promise<string>
Promise resolving to the resource’s MIME type.
Throws#
Error if the resource cannot be downloaded or MIME type determined.
Signature#
getMimeType(uri: string, options?: AbortOptions): Promise<string>getFontMetrics()#
Gets the font metrics for a given font file URI.
If the font is not yet loaded, it will be fetched asynchronously. The returned metrics are in the font’s design units coordinate space. Missing or zero underline metrics use the defaults documented in FontMetrics.
const metrics = await engine.editor.getFontMetrics('/extensions/ly.img.cesdk.fonts/fonts/Roboto/Roboto-Regular.ttf');console.log(metrics.ascender, metrics.descender, metrics.unitsPerEm);console.log(metrics.lineGap);console.log(metrics.capHeight, metrics.xHeight);console.log(metrics.underlineOffset, metrics.underlineSize, metrics.strikeoutOffset, metrics.strikeoutSize);Parameters#
| Parameter | Type | Description |
|---|---|---|
fontFileUri |
string |
The URI of the font file to get metrics from. |
options? |
AbortOptions |
An abortSignal that stops the download of the font. |
Returns#
Promise<FontMetrics>
A promise resolving to the font metrics.
Signature#
getFontMetrics(fontFileUri: string, options?: AbortOptions): Promise<FontMetrics>getFontInfo()#
Gets the names, weight, style, variation axes and OpenType features of a font file.
The call loads the font when it is not loaded yet. The result describes the default instance of a variable font,
and the call ignores a fragment that names axis values, such as #wght=700. Use the result to register an
uploaded font on a typeface asset source.
const info = await engine.editor.getFontInfo('https://example.com/fonts/Inter-SemiBold.otf');console.log(info.family, info.subFamily); // "Inter", "Semi Bold"console.log(info.weight, info.fontWeight, info.style); // 600, "semiBold", "normal"console.log(info.isVariable, info.variationAxes);console.log(info.openTypeFeatures); // e.g. ['kern', 'ss01', 'tnum']Parameters#
| Parameter | Type | Description |
|---|---|---|
fontFileUri |
string |
The URI of a TTF, OTF, WOFF or WOFF2 file. |
options? |
AbortOptions |
An abortSignal that stops the download of the font. |
Returns#
Promise<FontInfo>
A promise resolving to the font info. It rejects with EDITOR.FONT_LOAD_FAILED when the file does not
load, and with EDITOR.FONT_INFO_EXTRACT_FAILED when the file is not a font.
Signature#
getFontInfo(fontFileUri: string, options?: AbortOptions): Promise<FontInfo>findAllTransientResources()#
Get all transient resources that would be lost during export.
Useful for identifying resources that need relocation (e.g., to a CDN) before export, as these resources are not included in the exported scene.
Returns#
The URLs and sizes of transient resources.
Signature#
findAllTransientResources(): TransientResource[]findAllMediaURIs()#
Get all media URIs referenced by blocks in the scene.
Returns URIs from image fills, video fills, and audio blocks, including their source sets. Only returns valid media URIs (http://, https://, file://), excluding transient resources like buffer URIs. Useful for determining which media files are referenced by a scene (e.g., for cleanup operations, CDN management, or file system tracking).
Returns#
string[]
The URLs of all media resources referenced in the scene, deduplicated.
Signature#
findAllMediaURIs(): string[]getResourceData()#
Provides the data of a resource at the given URL.
Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URL of the resource. |
chunkSize |
number |
The size of the chunks in which the resource data is provided. |
onData |
(result) => boolean |
The callback function that is called with the resource data or an error if an error occurred. The callback will be called as long as there is data left to provide and the callback returns true. |
Returns#
void
Signature#
getResourceData(uri: string, chunkSize: number, onData: (result: Uint8Array) => boolean): voidrelocateResource()#
Changes the URL associated with a resource.
This function can be used change the URL of a resource that has been relocated (e.g., to a CDN).
Relocating the URL of a document color profile also repoints the profile. A
setDocumentColorProfile request for that URL that is still loading commits the new URL once
it loads.
Parameters#
| Parameter | Type | Description |
|---|---|---|
currentUrl |
string |
The current URL of the resource. |
relocatedUrl |
string |
The new URL of the resource. |
Returns#
void
Signature#
relocateResource(currentUrl: string, relocatedUrl: string): voidEditor Settings#
setSetting()#
Set a setting value using the unified API.
The value type is automatically validated based on the key.
Type Parameters#
| Type Parameter |
|---|
K extends keyof Settings |
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
OptionalPrefix<K> |
The setting key from Settings |
value |
SettingValueType<K> |
The value to set (type-safe based on key) |
Returns#
void
Throws#
Error if the keypath is invalid or value type doesn’t match
Example#
// Boolean settingengine.editor.setSetting('doubleClickToCropEnabled', false);
// Color settingengine.editor.setSetting('highlightColor', { r: 1, g: 0, b: 1, a: 1 });
// Enum settingengine.editor.setSetting('doubleClickSelectionMode', 'Direct');Signature#
setSetting(keypath: OptionalPrefix<K>, value: SettingValueType<K>): voidgetSetting()#
Get a setting value using the unified API.
The return type is automatically inferred from the key.
Type Parameters#
| Type Parameter |
|---|
K extends keyof Settings |
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
OptionalPrefix<K> |
The setting key from Settings |
Returns#
The value of the setting (type-safe based on key)
Throws#
Error if the keypath is invalid
Example#
// Boolean settingconst cropEnabled = engine.editor.getSetting('doubleClickToCropEnabled');
// Color settingconst highlight = engine.editor.getSetting('highlightColor');
// Enum settingconst selectionMode = engine.editor.getSetting('doubleClickSelectionMode');Signature#
getSetting(keypath: OptionalPrefix<K>): SettingValueType<K>setSettingBool()#
Set a boolean setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingBoolPropertyName |
The settings keypath, e.g. doubleClickToCropEnabled. |
value |
boolean |
The boolean value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Call Signature#
setSettingBool(keypath, value): void;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
value |
boolean |
Returns#
void
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Signatures#
setSettingBool(keypath: SettingBoolPropertyName, value: boolean): voidsetSettingBool(keypath: `ubq://${string & {}}`, value: boolean): voidgetSettingBool()#
Get a boolean setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingBoolPropertyName |
The settings keypath, e.g. doubleClickToCropEnabled. |
Returns#
boolean
The boolean value of the setting.
Throws#
Error if the keypath is invalid.
Call Signature#
getSettingBool(keypath): boolean;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
Returns#
boolean
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
getSettingBool(keypath): boolean;Get a boolean setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingBoolPropertyName |
The settings keypath, e.g. doubleClickToCropEnabled. |
Returns#
boolean
The boolean value of the setting.
Throws#
Error if the keypath is invalid.
Signatures#
getSettingBool(keypath: SettingBoolPropertyName): booleangetSettingBool(keypath: `ubq://${string & {}}`): booleangetSettingBool(keypath: SettingBoolPropertyName): booleansetSettingInt()#
Set an integer setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingIntPropertyName |
The settings keypath. |
value |
number |
The integer value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Call Signature#
setSettingInt(keypath, value): void;Set an integer setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingIntPropertyName |
The settings keypath. |
value |
number |
The integer value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Signatures#
setSettingInt(keypath: SettingIntPropertyName, value: number): voidsetSettingInt(keypath: SettingIntPropertyName, value: number): voidgetSettingInt()#
Get an integer setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingIntPropertyName |
The settings keypath. |
Returns#
number
The integer value of the setting.
Throws#
Error if the keypath is invalid.
Call Signature#
getSettingInt(keypath): number;Get an integer setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingIntPropertyName |
The settings keypath. |
Returns#
number
The integer value of the setting.
Throws#
Error if the keypath is invalid.
Signatures#
getSettingInt(keypath: SettingIntPropertyName): numbergetSettingInt(keypath: SettingIntPropertyName): numbersetSettingFloat()#
Set a float setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingFloatPropertyName |
The settings keypath, e.g. positionSnappingThreshold. |
value |
number |
The float value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Call Signature#
setSettingFloat(keypath, value): void;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
value |
number |
Returns#
void
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
setSettingFloat(keypath, value): void;Set a float setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingFloatPropertyName |
The settings keypath, e.g. positionSnappingThreshold. |
value |
number |
The float value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Signatures#
setSettingFloat(keypath: SettingFloatPropertyName, value: number): voidsetSettingFloat(keypath: `ubq://${string & {}}`, value: number): voidsetSettingFloat(keypath: SettingFloatPropertyName, value: number): voidgetSettingFloat()#
Get a float setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingFloatPropertyName |
The settings keypath, e.g. positionSnappingThreshold. |
Returns#
number
The float value of the setting.
Throws#
Error if the keypath is invalid.
Call Signature#
getSettingFloat(keypath): number;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
Returns#
number
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
getSettingFloat(keypath): number;Get a float setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingFloatPropertyName |
The settings keypath, e.g. positionSnappingThreshold. |
Returns#
number
The float value of the setting.
Throws#
Error if the keypath is invalid.
Signatures#
getSettingFloat(keypath: SettingFloatPropertyName): numbergetSettingFloat(keypath: `ubq://${string & {}}`): numbergetSettingFloat(keypath: SettingFloatPropertyName): numbersetSettingDouble()#
Set a double setting value without reducing its precision.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
OptionalPrefix<SettingDoublePropertyName> |
The setting key, such as clip/defaultDurationValue (seconds). |
value |
number |
The finite double value to set. |
Returns#
void
Signature#
setSettingDouble(keypath: OptionalPrefix<SettingDoublePropertyName>, value: number): voidgetSettingDouble()#
Get a double setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
OptionalPrefix<SettingDoublePropertyName> |
The setting key, such as clip/defaultDurationValue (seconds). |
Returns#
number
The setting value with double precision.
Signature#
getSettingDouble(keypath: OptionalPrefix<SettingDoublePropertyName>): numbersetSettingString()#
Set a string setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingStringPropertyName |
The settings keypath, e.g. license. |
value |
string |
The string value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Call Signature#
setSettingString(keypath, value): void;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
value |
string |
Returns#
void
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
setSettingString(keypath, value): void;Set a string setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingStringPropertyName |
The settings keypath, e.g. license. |
value |
string |
The string value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Signatures#
setSettingString(keypath: SettingStringPropertyName, value: string): voidsetSettingString(keypath: `ubq://${string & {}}`, value: string): voidsetSettingString(keypath: SettingStringPropertyName, value: string): voidgetSettingString()#
Get a string setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingStringPropertyName |
The settings keypath, e.g. license. |
Returns#
string
The string value of the setting.
Throws#
Error if the keypath is invalid.
Call Signature#
getSettingString(keypath): string;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
Returns#
string
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
getSettingString(keypath): string;Get a string setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingStringPropertyName |
The settings keypath, e.g. license. |
Returns#
string
The string value of the setting.
Throws#
Error if the keypath is invalid.
Signatures#
getSettingString(keypath: SettingStringPropertyName): stringgetSettingString(keypath: `ubq://${string & {}}`): stringgetSettingString(keypath: SettingStringPropertyName): stringsetSettingColor()#
Set a color setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingColorPropertyName |
The settings keypath, e.g. highlightColor. |
value |
Color |
The The value to set. |
Returns#
void
Call Signature#
setSettingColor(keypath, value): void;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
value |
Color |
Returns#
void
Deprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
setSettingColor(keypath, value): void;Set a color setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingColorPropertyName |
The settings keypath, e.g. highlightColor. |
value |
Color |
The The value to set. |
Returns#
void
Signatures#
setSettingColor(keypath: SettingColorPropertyName, value: Color): voidsetSettingColor(keypath: `ubq://${string & {}}`, value: Color): voidsetSettingColor(keypath: SettingColorPropertyName, value: Color): voidgetSettingColor()#
Get a color setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingColorPropertyName |
The settings keypath, e.g. highlightColor. |
Returns#
ColorThrows#
An error, if the keypath is invalid.
Call Signature#
getSettingColor(keypath): Color;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string & {}}` |
Returns#
ColorDeprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Call Signature#
getSettingColor(keypath): Color;Get a color setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
SettingColorPropertyName |
The settings keypath, e.g. highlightColor. |
Returns#
ColorThrows#
An error, if the keypath is invalid.
Signatures#
getSettingColor(keypath: SettingColorPropertyName): ColorgetSettingColor(keypath: `ubq://${string & {}}`): ColorgetSettingColor(keypath: SettingColorPropertyName): ColorsetSettingEnum()#
Set an enum setting.
Type Parameters#
| Type Parameter |
|---|
T extends keyof SettingEnumType |
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
T |
The settings keypath, e.g. doubleClickSelectionMode. |
value |
SettingEnumType[T] |
The enum value as string. |
Returns#
void
Call Signature#
setSettingEnum(keypath, value): void;Set an enum setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. doubleClickSelectionMode. |
value |
string |
The enum value as string. |
Returns#
void
Signatures#
setSettingEnum(keypath: T, value: SettingEnumType[T]): voidsetSettingEnum(keypath: string, value: string): voidgetSettingEnum()#
Get an enum setting.
Type Parameters#
| Type Parameter |
|---|
T extends keyof SettingEnumType |
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
T |
The settings keypath, e.g. doubleClickSelectionMode. |
Returns#
The value as string.
Call Signature#
getSettingEnum(keypath): string;Get an enum setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. doubleClickSelectionMode. |
Returns#
string
The value as string.
Signatures#
getSettingEnum(keypath: T): SettingEnumType[T]getSettingEnum(keypath: string): stringgetSettingEnumOptions()#
Get the possible enum options for a given enum setting.
Type Parameters#
| Type Parameter |
|---|
T extends keyof SettingEnumType |
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
T |
The settings keypath, e.g. doubleClickSelectionMode. |
Returns#
SettingEnumType[T][]
The possible enum options as strings.
Call Signature#
getSettingEnumOptions(keypath): string[];Get the possible enum options for a given enum setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. doubleClickSelectionMode. |
Returns#
string[]
The possible enum options as strings.
Signatures#
getSettingEnumOptions(keypath: T): SettingEnumType[T][]getSettingEnumOptions(keypath: string): string[]findAllSettings()#
Returns a list of all the settings available.
Returns#
string[]
A list of settings keypaths.
Signature#
findAllSettings(): string[]getSettingType()#
Returns the type of a setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. doubleClickSelectionMode. |
Returns#
SettingTypeThe setting type.
Signature#
getSettingType(keypath: string): SettingTypesetTypefaceResolver()#
Sets a font provider. A later provider replaces the previous one; null or undefined
restores registered-source lookup. When the provider returns undefined or a result that
the engine cannot read, throws or rejects, the engine uses the default font, and the
request reports substituted.
The engine ignores stale completions after replacement, edits or disposal.
substituted.
The engine ignores stale completions after replacement, edits or disposal.Without a resolver, the engine searches registered local asset sources. Identical requests share pending
lookups. Each source is limited to 100 pages. Set assetSourceId to query an external source explicitly.
Call setTypefaceResolver again to retry unresolved requests after registering a source.
Parameters#
| Parameter | Type |
|---|---|
resolver? |
TypefaceResolver |
Returns#
void
Signature#
setTypefaceResolver(resolver?: TypefaceResolver): voidsetURIResolver()#
Sets a custom URI resolver.
This function can be called more than once. Subsequent calls will overwrite previous calls.
To remove a previously set resolver, pass null or undefined.
setURIResolver and setURIResolverAsync share one resolver slot, so a
call to either one replaces the resolver set by the other.
The given function must return an absolute path with a scheme and cannot be asynchronous. The input is allowed to be an invalid URI, e.g., due to placeholders.
// Replace all .jpg files with the IMG.LY logoengine.editor.setURIResolver((uri) => { if (uri.endsWith('.jpg')) { return 'https://img.ly/static/ubq_samples/imgly_logo.jpg'; } // Make use of the default URI resolution behavior. return engine.editor.defaultURIResolver(uri);});Parameters#
| Parameter | Type | Description |
|---|---|---|
resolver? |
SyncURIResolver |
Custom resolution function. The resolution function should not reference variables outside of its scope. It receives the default URI resolver as its second argument |
Returns#
void
Signature#
setURIResolver(resolver?: SyncURIResolver): voidsetURIResolverAsync()#
Sets a custom async URI resolver.
This function can be called more than once. Subsequent calls will overwrite previous calls.
To remove a previously set resolver, pass null or undefined.
setURIResolver and setURIResolverAsync share one resolver slot, so a
call to either one replaces the resolver set by the other.
The given function must return an absolute path with a scheme. The input is allowed to be invalid URI, e.g., due
to placeholders.
Parameters#
| Parameter | Type | Description |
|---|---|---|
resolver? |
AsyncURIResolver |
Custom async resolution function. |
Returns#
void
Signature#
setURIResolverAsync(resolver?: AsyncURIResolver): voiddefaultURIResolver()#
This is the default implementation for the URI resolver.
It resolves the given path relative to the basePath setting.
engine.editor.defaultURIResolver(uri);Parameters#
| Parameter | Type | Description |
|---|---|---|
relativePath |
string |
The relative path that should be resolved. |
Returns#
string
The resolved absolute URI.
Signature#
defaultURIResolver(relativePath: string): stringgetAbsoluteURI()#
Resolves the given path asynchronously.
If a custom resolver has been set with setURIResolverAsync (or setURIResolver), it invokes it with the given
path. Else, it resolves it as relative to the basePath setting.
This performs NO validation of whether a file exists at the specified location.
Breaking change: This method now returns a Promise<string> instead
of a plain string. Callers must await the result.
Parameters#
| Parameter | Type | Description |
|---|---|---|
relativePath |
string |
A relative path string |
Returns#
Promise<string>
Promise resolving to the resolved absolute uri or rejecting if an invalid path was given.
Signature#
getAbsoluteURI(relativePath: string): Promise<string>System Information#
getAvailableMemory()#
Get the currently available memory.
Returns#
number
The available memory in bytes.
Signature#
getAvailableMemory(): numbergetUsedMemory()#
Get the engine’s current memory usage.
Returns#
number
The current memory usage in bytes.
Signature#
getUsedMemory(): numberreleaseMemory()#
Free the memory that the engine can build again without a download.
The engine frees the decoded images that the canvas did not draw last, and the video thumbnails. It also frees the files that no block uses, and the unused GPU textures. The files that blocks use stay, so no file downloads again. The next frames decode the freed images again when they need them.
engine.editor.releaseMemory();Returns#
void
Signature#
releaseMemory(): voidgetMaxExportSize()#
Get the export size limit in pixels on the current device. It bounds a color mask export. It also bounds
each image, gradient and effect that a PDF export draws as pixels at the scene DPI, not the page. Both sides must be below or equal to it.
An export might still fail for other reasons, such as memory. The limit is at most 23170 px, the side of the largest
square export whose pixels fit in 2 GiB. A PNG, JPEG, WebP, TGA or raw export renders in strips, so this limit does
not bound it. Only the side limit of its format does: JPEG 65500, WebP 16383 and TGA 65535 px. A buffered export must
also give a file under 4 GiB. A PNG, JPEG or WebP export with outputProfileMode or embedProfiles renders in one
surface, so this limit bounds it.
outputProfileMode or embedProfiles renders in one
surface, so this limit bounds it.Returns#
number
The upper export size limit in pixels.
Signature#
getMaxExportSize(): numberExperimental#
unstable_isInteractionHappening()#
Check if a user interaction is currently happening.
Detects active interactions like resize edits with drag handles, touch gestures, and content dragged over the canvas.
Returns#
boolean
True if an interaction is happening. This API is experimental and may change or be removed in future versions.
Other#
getCapabilityState()#
Where a capability stands: ‘unchecked’ until something asks for it to be measured,
‘pending’ while it is measured, then ‘supported’ or ‘unsupported’.
‘unchecked’ until something asks for it to be measured,
‘pending’ while it is measured, then ‘supported’ or ‘unsupported’.Only codecs can be 'unchecked' or 'pending'. Browser codecs are measured when
checkCapabilities() or a video check action asks. Native AAC and MP3 decoding can stay
'unchecked' until existing licensed media initialization and a later checkCapabilities() refresh.
The storage capabilities are measured before CreativeEngine.init() resolves.
In CE.SDK a component that renders from this updates by itself when the state changes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
capability |
EngineCapability |
The capability to query. |
Returns#
EngineCapabilityState'unchecked', 'pending', 'supported' or 'unsupported'.
Throws#
For unknown capability names.
Signature#
getCapabilityState(capability: EngineCapability): EngineCapabilityStatecheckCapabilities()#
Measures browser capabilities on request or refreshes native backend evidence. Browser codecs
cost a dry run each, so they wait for this method or a video check action.
Each browser capability is answered at most once per engine: a call while it is measured waits for the same measurement, and a later call resolves immediately. A measurement the browser cuts off, as a background tab can, is no answer, so the capabilities it did not reach are measured again.
Native engines refresh backend evidence immediately. AAC or MP3 decoding can remain 'unchecked'
until an existing media operation initializes a licensed backend; call again afterward to refresh
those answers. This method starts no native media or license initialization. Android checks
its AAC and MP3 decoders once, when the engine starts. A later call reports that result again
and does not check them a second time.
Returns#
Promise<void>
Resolves when browser detection finishes or the native evidence has been refreshed.
Native codecs can remain 'unchecked'.
Signature#
checkCapabilities(): Promise<void>loadColorProfiles()#
Loads the color profiles used for managed color conversion and preview.
Waits for every profile the document names, and for the effective Default/CMYK profile, including the configured or bundled fallback. Only the Default/CMYK result decides the outcome: a profile of another slot that fails to load is logged and does not fail the call. Configuration changes during loading are resolved before completion. Call again after later changes. Aborting ends only this wait; the document keeps loading the profile for conversions.
Parameters#
| Parameter | Type | Description |
|---|---|---|
options? |
AbortOptions |
Abort options for this wait. |
Returns#
Promise<void>
Resolves when the effective profile is ready, immediately if every named profile is already loaded.
Throws#
An error with COLOR.PROFILE_MISSING when no usable profile can be read.
Signature#
loadColorProfiles(options?: AbortOptions): Promise<void>isHighlightingEnabled()#
Checks wether the block has selection and hover highlighting enabled or disabled.
const highlightingIsEnabled = engine.editor.isHighlightingEnabled(block);Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
number |
The block to query. |
Returns#
boolean
True if highlighting is enabled, false otherwise.
Signature#
isHighlightingEnabled(id: number): booleansetHighlightingEnabled()#
Enable or disable selection and hover highlighting for a block.
engine.editor.setHighlightingEnabled(block, true);Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
number |
The block to update. |
enabled |
boolean |
Whether or not the block should show highlighting when selected or hovered. |
Returns#
void
Signature#
setHighlightingEnabled(id: number, enabled: boolean): voidisSelectionEnabled()#
Checks whether the block can currently be selected.
const selectionIsEnabled = engine.editor.isSelectionEnabled(block);Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
number |
The block to query. |
Returns#
boolean
True if selection is enabled, false otherwise.
Signature#
isSelectionEnabled(id: number): booleansetSelectionEnabled()#
Enable or disable selection for a block.
engine.editor.setSelectionEnabled(block, true);Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
number |
The block to update. |
enabled |
boolean |
Whether the block should be selectable. |
Returns#
void
Signature#
setSelectionEnabled(id: number, enabled: boolean): voidsetMovementConstraint()#
Set one or more rules that limit how far blocks can be positioned outside their
parent page during user interactions (drag, resize, touch gestures, crop, nudge).
Programmatic API calls are not affected.
overshoot is a non-negative fraction of the moved block’s own size: 0
pins blocks fully inside the page, 0.3 allows 30% to extend past the page
bounds. Each rule’s scope is determined by its keys:
{ overshoot }— scene-wide default for every page in the scene.{ overshoot, block }— applies to a specific block. Pages are blocks, so setting this on a page acts as the default for blocks inside that page. On a page slice, it is the default for the blocks whose center the page slice holds, and its edges to the other page slices act as page edges for them. A block wider than the page slice is held in the page on that axis. During a drag or a touch pan, the page slice where it started applies, until it takes the block fully onto another page slice.{ overshoot, blockType }— applies to every block of the given type (e.g."text"or"//ly.img.ubq/text").
Use removeMovementConstraint to clear a rule.
When multiple rules match a block, the most specific one wins: block \> page slice \> parent page \> blockType \> scene-wide.
Parameters#
| Parameter | Type | Description |
|---|---|---|
rules |
MovementConstraintRule |
MovementConstraintRule[] |
Returns#
void
Signature#
setMovementConstraint(rules: MovementConstraintRule | MovementConstraintRule[]): voidgetMovementConstraint()#
Get the effective movement constraint for a block, picking the most specific
matching rule: block > page slice > parent page > blockType > scene-wide.
The returned overshoot is a fraction of the block’s own size.
Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
number |
The block to query. |
Returns#
object
{ overshoot } with the effective value, or null if unconstrained.
| Name | Type |
|---|---|
overshoot |
number |
Remarks#
May perform an internal update to resolve pending layout. This update can run even when implicit updates are disabled if the required layout is missing or stale.
Signature#
getMovementConstraint(id: number): objectremoveMovementConstraint()#
Remove previously set movement constraints.
- No argument: removes the scene-wide default.
{ block }/{ blockType }(or an array): removes the matching scope(s).
Removing a scope falls through to the next tier on subsequent resolution.
Parameters#
| Parameter | Type | Description |
|---|---|---|
scopes? |
MovementConstraintScope |
MovementConstraintScope[] |
Returns#
void
Signature#
removeMovementConstraint(scopes?: MovementConstraintScope | MovementConstraintScope[]): voidVector Edit#
hasSelectedVectorNode()#
Check whether a vector anchor node is currently selected in vector edit mode.
Returns#
boolean
True if a vector anchor node is selected.
Signature#
hasSelectedVectorNode(): booleanaddVectorNode()#
Add a new vertex by splitting the segment after the currently selected vector node.
Returns#
void
Signature#
addVectorNode(): voiddeleteVectorNode()#
Delete the currently selected vector node from the path.
Returns#
void
Signature#
deleteVectorNode(): voidhasSelectedVectorControlPoint()#
Check whether a vector control point handle is currently selected.
Returns#
boolean
Signature#
hasSelectedVectorControlPoint(): booleandeleteSelectedVectorControlPoints()#
Delete (reset) the currently selected vector control point handles.
Removes the bezier handle from the node, converting that side to a straight line.
If the node has two handles, only the selected one is removed.
Returns#
void
Signature#
deleteSelectedVectorControlPoints(): voidtoggleSelectedVectorNodeSmooth()#
Toggle the currently selected vector node between smooth (bezier handles)
and corner (no handles).
Returns#
void
Signature#
toggleSelectedVectorNodeSmooth(): voidsetVectorEditBendMode()#
Enable or disable bend mode for vector editing.
When bend mode is active, clicking an anchor node automatically toggles it between smooth (bezier handles) and corner (no handles).
Parameters#
| Parameter | Type | Description |
|---|---|---|
active |
boolean |
true to enable bend mode, false to return to normal move mode. |
Returns#
void
Signature#
setVectorEditBendMode(active: boolean): voidgetVectorEditBendMode()#
Check whether vector edit bend mode is currently active.
Returns#
boolean
true if bend mode is active.
Signature#
getVectorEditBendMode(): booleansetVectorEditAddMode()#
Enable or disable add mode for vector editing.
When add mode is active, clicking on a path segment inserts a new anchor point at the click position. Mutually exclusive with bend and delete modes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
active |
boolean |
true to enable add mode, false to return to normal move mode. |
Returns#
void
Signature#
setVectorEditAddMode(active: boolean): voidgetVectorEditAddMode()#
Check whether vector edit add mode is currently active.
Returns#
boolean
true if add mode is active.
Signature#
getVectorEditAddMode(): booleansetVectorEditDeleteMode()#
Enable or disable delete mode for vector editing.
When delete mode is active, clicking an anchor node instantly deletes it from the path. Mutually exclusive with bend and add modes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
active |
boolean |
true to enable delete mode, false to return to normal move mode. |
Returns#
void
Signature#
setVectorEditDeleteMode(active: boolean): voidgetVectorEditDeleteMode()#
Check whether vector edit delete mode is currently active.
Returns#
boolean
true if delete mode is active.
Signature#
getVectorEditDeleteMode(): booleansetSelectedVectorNodeMirrorMode()#
Set the bezier handle mirror mode for the currently selected vector node.
Mirror modes control how the opposite handle behaves when one handle is dragged:
- 0 (None): handles move independently
- 1 (AngleAndLength): the opposite handle mirrors both angle and length
- 2 (AngleOnly): the opposite handle mirrors the angle but keeps its own length
Parameters#
| Parameter | Type | Description |
|---|---|---|
mode |
number |
The mirror mode (0, 1, or 2). |
Returns#
void
Signature#
setSelectedVectorNodeMirrorMode(mode: number): voidgetSelectedVectorNodeMirrorMode()#
Get the bezier handle mirror mode of the currently selected vector node.
Returns#
number
The mirror mode as a number (0 = None, 1 = AngleAndLength, 2 = AngleOnly).
Throws#
Error if no node is selected or no vector path is being edited.
Signature#
getSelectedVectorNodeMirrorMode(): numberViewport#
setSafeAreaInsets()#
Set global safe area insets for UI overlays.
Safe area insets define UI-safe regions by specifying padding from screen edges. These insets are automatically applied to all camera operations (zoom, pan, clamping) to ensure important content remains visible when UI elements overlap the viewport edges. Set to zero to disable (default state).
Parameters#
| Parameter | Type | Description |
|---|---|---|
insets |
{ left?: number; top?: number; right?: number; bottom?: number; } |
The inset values in CSS pixels (device-independent) |
insets.left? |
number |
- |
insets.top? |
number |
- |
insets.right? |
number |
- |
insets.bottom? |
number |
- |
Returns#
void
Signature#
setSafeAreaInsets(insets: object): void