EditorAPI provides methods for editor state management
Implements#
IEditorAPI
Constructors#
Role & Scope Management#
getRole()#
Get the current user role.
Returns#
RoleStringThe current role of the user.
Implementation of#
IEditorAPI.getRoleSignature#
getRole(): RoleStringsetRole()#
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
Implementation of#
IEditorAPI.setRoleSignature#
setRole(role: RoleString): voidfindAllScopes()#
Get all available global scope names.
Returns#
Scope$1[]
The names of all available global scopes.
Signature#
findAllScopes(): Scope$1[]getGlobalScope()#
Get a global scope’s permission level.
Parameters#
| Parameter | Type | Description |
|---|---|---|
scope |
string |
The scope to query. |
Returns#
"Allow" | "Deny" | "Defer"
Allow, Deny, or Defer indicating the scope’s permission level.
Signature#
getGlobalScope(scope: string): "Allow" | "Deny" | "Defer"setGlobalScope()#
Set a global scope permission level.
Parameters#
| Parameter | Type | Description |
|---|---|---|
scope |
string |
The scope to configure. |
value |
"Allow" |
"Deny" |
Returns#
void
Signature#
setGlobalScope(scope: string, value: "Allow" | "Deny" | "Defer"): voidEdit Mode Management#
getEditMode()#
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#
string
“Transform”, “Crop”, “Text”, “Playback”, “Trim”, “Vector” or a custom value.
Implementation of#
IEditorAPI.getEditModeSignature#
getEditMode(): stringsetEditMode()#
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 |
string |
“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
Implementation of#
IEditorAPI.setEditModeSignature#
setEditMode(mode: string, baseMode?: string): voidgetCursorType()#
Get the cursor type that should be displayed.
Returns#
| "Rotate"
| "Text"
| "Arrow"
| "Move"
| "MoveNotPermitted"
| "Resize"
| "Cell"
The cursor type.
Signature#
getCursorType(): "Rotate" | "Text" | "Arrow" | "Move" | "MoveNotPermitted" | "Resize" | "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.
Implementation of#
IEditorAPI.createHistorySignature#
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.
Implementation of#
IEditorAPI.destroyHistorySignature#
destroyHistory(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.
Implementation of#
IEditorAPI.getActiveHistorySignature#
getActiveHistory(): numbercanUndo()#
Check if an undo step is available.
if (engine.editor.canUndo()) { engine.editor.undo();}Returns#
boolean
True if an undo step is available.
Implementation of#
IEditorAPI.canUndoSignature#
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.
Implementation of#
IEditorAPI.canRedoSignature#
canRedo(): booleanaddUndoStep()#
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
Implementation of#
IEditorAPI.addUndoStepSignature#
addUndoStep(): voidremoveUndoStep()#
Remove the last history state from the undo stack.
Removes the most recent undo step if available.
engine.editor.removeUndoStep();Returns#
void
Implementation of#
IEditorAPI.removeUndoStepSignature#
removeUndoStep(): voidColor Management#
supportsP3()#
Returns whether the engine supports displaying and working in the P3 color space on the current device.
Returns#
boolean
True when the P3 color space is supported.
Implementation of#
IEditorAPI.supportsP3Signature#
supportsP3(): booleangetSpotColorForCutoutType()#
Get the name of the spot color assigned to a cutout type.
Parameters#
| Parameter | Type | Description |
|---|---|---|
type |
CutoutType |
The cutout type. |
Returns#
string
The color spot name.
Signature#
getSpotColorForCutoutType(type: CutoutType): stringsetSpotColorForCutoutType()#
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 |
CutoutType |
The cutout type. |
color |
string |
The spot color name to assign. |
Returns#
void
Signature#
setSpotColorForCutoutType(type: CutoutType, color: string): voidfindAllSpotColors()#
Get all spot color names currently defined.
Returns#
string[]
The names of all defined spot colors.
Implementation of#
IEditorAPI.findAllSpotColorsSignature#
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.
Implementation of#
IEditorAPI.getSpotColorRGBASignature#
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.
Implementation of#
IEditorAPI.getSpotColorCMYKSignature#
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
Implementation of#
IEditorAPI.setSpotColorRGBSignature#
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
Implementation of#
IEditorAPI.setSpotColorCMYKSignature#
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.
Implementation of#
IEditorAPI.removeSpotColorSignature#
removeSpotColor(name: string): voidsetSoftProofEnabled()#
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 editor state subscribers.
Parameters#
| Parameter | Type | Description |
|---|---|---|
enabled |
boolean |
Whether to proof the live canvas. Defaults to false. |
Returns#
void
Implementation of#
IEditorAPI.setSoftProofEnabledSignature#
setSoftProofEnabled(enabled: boolean): voidisSoftProofEnabled()#
Check whether soft proofing of the live canvas is on.
Returns#
boolean
True when the live canvas is proofed.
Implementation of#
IEditorAPI.isSoftProofEnabledSignature#
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 editor state 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.
Implementation of#
IEditorAPI.setSoftProofColorSpaceSignature#
setSoftProofColorSpace(colorSpace: SoftProofColorSpace): voidgetSoftProofColorSpace()#
Get the color space that soft proofing simulates.
Returns#
SoftProofColorSpace'RGB' or 'CMYK'.
Implementation of#
IEditorAPI.getSoftProofColorSpaceSignature#
getSoftProofColorSpace(): SoftProofColorSpaceResource Management#
getFileFormats()#
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.
Implementation of#
IEditorAPI.getFileFormatsSignature#
getFileFormats(): 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.
Implementation of#
IEditorAPI.getMimeTypeSignature#
getMimeType(uri: string, options?: AbortOptions): Promise<string>relocateResource()#
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 |
|---|---|---|
currentUri |
string |
The current URL of the resource. |
newUri |
string |
The new URL of the resource. |
Returns#
void
Implementation of#
IEditorAPI.relocateResourceSignature#
relocateResource(currentUri: string, newUri: string): voidfindAllMediaURIs()#
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.
Implementation of#
IEditorAPI.findAllMediaURIsSignature#
findAllMediaURIs(): string[]findAllTransientResources()#
List all transient (in-engine) resources — typically buffer:// URIs
created by importers (psd, pdf, idml) before they’re uploaded to a
permanent location. Each entry is { URL, size }, as on the WASM engine.
buffer:// URIs
created by importers (psd, pdf, idml) before they’re uploaded to a
permanent location. Each entry is { URL, size }, as on the WASM engine.Returns#
The URLs and sizes of transient resources.
Implementation of#
IEditorAPI.findAllTransientResourcesSignature#
findAllTransientResources(): TransientResource[]getResourceData()#
Reads a resource’s bytes in chunks. onData is called per chunk with a
Uint8Array; return false to stop early. Returns once fully streamed.
onData is called per chunk with a
Uint8Array; return false to stop early. Returns once fully streamed.Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URL of the resource. |
chunkSize |
number |
Size in bytes of each chunk passed to onData. |
onData |
(result) => boolean |
Called with each chunk; return false to stop. |
Returns#
void
Implementation of#
IEditorAPI.getResourceDataSignature#
getResourceData(uri: string, chunkSize: number, onData: (result: Uint8Array) => boolean): voidEditor Settings#
getSettingBool()#
Get a boolean setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. doubleClickToCropEnabled. |
Returns#
boolean
The boolean value of the setting.
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.getSettingBoolCall 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.
Implementation of#
IEditorAPI.getSettingBoolCall 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.
Implementation of#
IEditorAPI.getSettingBoolSignatures#
getSettingBool(keypath: string): booleangetSettingBool(keypath: `ubq://${string}`): booleangetSettingBool(keypath: SettingBoolPropertyName): booleansetSettingBool()#
Set a boolean setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. doubleClickToCropEnabled. |
value |
boolean |
The boolean value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.setSettingBoolCall 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.
Implementation of#
IEditorAPI.setSettingBoolSignatures#
setSettingBool(keypath: string, value: boolean): voidsetSettingBool(keypath: `ubq://${string}`, value: boolean): voidgetSettingInt()#
Get an integer setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath. |
Returns#
number
The integer value of the setting.
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.getSettingIntCall 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.
Implementation of#
IEditorAPI.getSettingIntSignatures#
getSettingInt(keypath: string): numbergetSettingInt(keypath: SettingIntPropertyName): numbersetSettingInt()#
Set an integer setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath. |
value |
number |
The integer value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.setSettingIntCall 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.
Implementation of#
IEditorAPI.setSettingIntSignatures#
setSettingInt(keypath: string, value: number): voidsetSettingInt(keypath: SettingIntPropertyName, value: number): voidgetSettingFloat()#
Get a float setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. positionSnappingThreshold. |
Returns#
number
The float value of the setting.
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.getSettingFloatCall 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.
Implementation of#
IEditorAPI.getSettingFloatCall 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.
Implementation of#
IEditorAPI.getSettingFloatSignatures#
getSettingFloat(keypath: string): numbergetSettingFloat(keypath: `ubq://${string}`): numbergetSettingFloat(keypath: SettingFloatPropertyName): numbersetSettingFloat()#
Set a float setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. positionSnappingThreshold. |
value |
number |
The float value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.setSettingFloatCall 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.
Implementation of#
IEditorAPI.setSettingFloatCall 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.
Implementation of#
IEditorAPI.setSettingFloatSignatures#
setSettingFloat(keypath: string, value: number): voidsetSettingFloat(keypath: `ubq://${string}`, value: number): voidsetSettingFloat(keypath: SettingFloatPropertyName, value: number): voidgetSettingString()#
Get a string setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. license. |
Returns#
string
The string value of the setting.
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.getSettingStringCall 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.
Implementation of#
IEditorAPI.getSettingStringCall 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.
Implementation of#
IEditorAPI.getSettingStringSignatures#
getSettingString(keypath: string): stringgetSettingString(keypath: `ubq://${string}`): stringgetSettingString(keypath: SettingStringPropertyName): stringsetSettingString()#
Set a string setting value.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. license. |
value |
string |
The string value to set. |
Returns#
void
Throws#
Error if the keypath is invalid.
Implementation of#
IEditorAPI.setSettingStringCall 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.
Implementation of#
IEditorAPI.setSettingStringCall 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.
Implementation of#
IEditorAPI.setSettingStringSignatures#
setSettingString(keypath: string, value: string): voidsetSettingString(keypath: `ubq://${string}`, value: string): voidsetSettingString(keypath: SettingStringPropertyName, value: string): voidgetSettingColor()#
Get a color setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. highlightColor. |
Returns#
ColorThrows#
An error, if the keypath is invalid.
Implementation of#
IEditorAPI.getSettingColorCall Signature#
getSettingColor(keypath): Color;Parameters#
| Parameter | Type |
|---|---|
keypath |
`ubq://${string}` |
Returns#
ColorDeprecated#
Support for ubq:// prefixed keypaths will be removed in a future release.
Implementation of#
IEditorAPI.getSettingColorCall 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.
Implementation of#
IEditorAPI.getSettingColorSignatures#
getSettingColor(keypath: string): ColorgetSettingColor(keypath: `ubq://${string}`): ColorgetSettingColor(keypath: SettingColorPropertyName): ColorsetSettingColor()#
Set a color setting.
Parameters#
| Parameter | Type | Description |
|---|---|---|
keypath |
string |
The settings keypath, e.g. highlightColor. |
value |
Color |
The The value to set. |
Returns#
void
Implementation of#
IEditorAPI.setSettingColorCall 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.
Implementation of#
IEditorAPI.setSettingColorCall 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
Implementation of#
IEditorAPI.setSettingColorSignatures#
setSettingColor(keypath: string, value: Color): voidsetSettingColor(keypath: `ubq://${string}`, value: Color): voidsetSettingColor(keypath: SettingColorPropertyName, value: Color): 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.
Implementation of#
IEditorAPI.getSettingEnumCall 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.
Implementation of#
IEditorAPI.getSettingEnumSignatures#
getSettingEnum(keypath: T): SettingEnumType[T]getSettingEnum(keypath: string): stringsetSettingEnum()#
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
Implementation of#
IEditorAPI.setSettingEnumCall 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
Implementation of#
IEditorAPI.setSettingEnumSignatures#
setSettingEnum(keypath: T, value: SettingEnumType[T]): voidsetSettingEnum(keypath: string, value: string): voidfindAllSettings()#
Returns a list of all the settings available.
Returns#
string[]
A list of settings keypaths.
Implementation of#
IEditorAPI.findAllSettingsSignature#
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.
Implementation of#
IEditorAPI.getSettingTypeSignature#
getSettingType(keypath: string): SettingTypegetSettingEnumOptions()#
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.
Implementation of#
IEditorAPI.getSettingEnumOptionsCall 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.
Implementation of#
IEditorAPI.getSettingEnumOptionsSignatures#
getSettingEnumOptions(keypath: T): SettingEnumType[T][]getSettingEnumOptions(keypath: string): string[]getAbsoluteURI()#
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 |
|---|---|---|
relativeUri |
string |
A relative path string |
Returns#
Promise<string>
Promise resolving to the resolved absolute uri or rejecting if an invalid path was given.
Implementation of#
IEditorAPI.getAbsoluteURISignature#
getAbsoluteURI(relativeUri: string): Promise<string>defaultURIResolver()#
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.
Implementation of#
IEditorAPI.defaultURIResolverSignature#
defaultURIResolver(relativePath: string): stringSystem Information#
getUsedMemory()#
Get the engine’s current memory usage.
Returns#
number
The current memory usage in bytes.
Signature#
getUsedMemory(): numbergetAvailableMemory()#
Get the currently available memory.
Returns#
number
The available memory in bytes.
Signature#
getAvailableMemory(): numbergetMaxExportSize()#
Get the maximum export size limit for the current device.
Exports are only possible when both width and height are below this limit. Note that exports may still fail due to other constraints like memory. A PDF export checks the limit against each image, gradient and effect that it draws as pixels at the scene DPI, not against the page. The limit is at most 23170 px, the side of the largest square export whose pixels fit in 2 GiB. A wider export with fewer pixels, such as 262144 x 2047, still works on a device without a GPU.
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#
unlockWithLicense()#
Activate (or re-activate) the engine with a license key. Pass an empty
string to drop into Evaluation mode. Mirrors
@cesdk/engine’s engine.editor.unlockWithLicense().
@cesdk/engine’s engine.editor.unlockWithLicense().Most callers should pass license via CreativeEngine.init({ license })
— init calls this internally. Use this method only to switch licenses
at runtime (e.g. trial → paid upgrade in place).
Parameters#
| Parameter | Type |
|---|---|
license |
string |
Returns#
void
Implementation of#
IEditorAPI.unlockWithLicenseSignature#
unlockWithLicense(license: string): voidgetCapabilityState()#
Reports the current backend capability evidence. Native AAC and MP3 decoding can stay
‘unchecked’ until an existing media operation initializes a licensed backend and a later
checkCapabilities() refreshes the evidence. Mirrors
@cesdk/engine’s engine.editor.getCapabilityState().
‘unchecked’ until an existing media operation initializes a licensed backend and a later
checkCapabilities() refreshes the evidence. Mirrors
@cesdk/engine’s engine.editor.getCapabilityState().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()#
Refreshes native backend capability evidence and resolves immediately afterward.
This starts no media or license initialization. AAC and MP3 decoding can remain
‘unchecked’ until an existing media operation initializes a licensed backend; call again
afterward to refresh those answers. Mirrors @cesdk/engine’s engine.editor.checkCapabilities().
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.
‘unchecked’ until an existing media operation initializes a licensed backend; call again
afterward to refresh those answers. Mirrors @cesdk/engine’s engine.editor.checkCapabilities().
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 after the native evidence has been refreshed. Codecs can remain 'unchecked'.
Signature#
checkCapabilities(): Promise<void>getSettingDouble()#
Get a double setting, such as clip/defaultDurationValue in seconds.
clip/defaultDurationValue in seconds.Parameters#
| Parameter | Type |
|---|---|
keypath |
string |
Returns#
number
Implementation of#
IEditorAPI.getSettingDoubleSignature#
getSettingDouble(keypath: string): numbersetSettingDouble()#
Set a finite double setting without reducing its precision.
Parameters#
| Parameter | Type |
|---|---|
keypath |
string |
value |
number |
Returns#
void
Implementation of#
IEditorAPI.setSettingDoubleSignature#
setSettingDouble(keypath: string, value: number): voidgetSetting()#
Generic setting getter that dispatches to the typed getter based on
getSettingType.
getSettingType.Type Parameters#
| Type Parameter |
|---|
K extends keyof Settings |
Parameters#
| Parameter | Type |
|---|---|
keypath |
OptionalPrefix<K> |
Returns#
Signature#
getSetting(keypath: OptionalPrefix<K>): SettingValueType<K>setSetting()#
Generic setting setter — dispatches to the typed setter via
getSettingType.
getSettingType.Type Parameters#
| Type Parameter |
|---|
K extends keyof Settings |
Parameters#
| Parameter | Type |
|---|---|
keypath |
OptionalPrefix<K> |
value |
SettingValueType<K> |
Returns#
void
Signature#
setSetting(keypath: OptionalPrefix<K>, value: SettingValueType<K>): voidgetFontMetrics()#
Get the font metrics for a font URI. An abortSignal stops the download of the font.
Missing or zero underline metrics use the defaults documented in FontMetrics.
abortSignal stops the download of the font.
Missing or zero underline metrics use the defaults documented in FontMetrics.Parameters#
| Parameter | Type |
|---|---|
fontFileUri |
string |
options? |
AbortOptions |
Returns#
Promise<FontMetrics>
Signature#
getFontMetrics(fontFileUri: string, options?: AbortOptions): Promise<FontMetrics>getFontInfo()#
Get the names, weight, style, variation axes and OpenType features of a font file. The result describes the default
instance of a variable font, and the call ignores a fragment that names axis values, such as #wght=700. An abortSignal
stops the download of the font. 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.
#wght=700. An abortSignal
stops the download of the font. 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.Parameters#
| Parameter | Type |
|---|---|
fontFileUri |
string |
options? |
AbortOptions |
Returns#
Promise<FontInfo>
Signature#
getFontInfo(fontFileUri: string, options?: AbortOptions): Promise<FontInfo>setMovementConstraint()#
Set one or more rules limiting how far blocks may be moved outside their
parent page during user interactions.
A rule on a page slice 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.
Parameters#
| Parameter | Type |
|---|---|
rules |
Returns#
void
Signature#
setMovementConstraint(rules: MovementConstraintRule | MovementConstraintRule[]): voidgetMovementConstraint()#
Get the effective movement constraint for a block (most specific rule
wins: block > page slice > parent page > blockType > scene-wide). Returns null
when unconstrained.
null
when unconstrained.Parameters#
| Parameter | Type |
|---|---|
id |
number |
Returns#
object
| 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 movement constraints. No argument removes the scene-wide default.
{ block } / { blockType } (or array) removes the matching scope(s).
{ block } / { blockType } (or array) removes the matching scope(s).Parameters#
| Parameter | Type |
|---|---|
scopes? |
Returns#
void
Signature#
removeMovementConstraint(scopes?: MovementConstraintScope | MovementConstraintScope[]): voidreleaseMemory()#
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.
Returns#
void
Signature#
releaseMemory(): voidconvertColorToColorSpace()#
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 |
|---|---|
color |
Color |
colorSpace |
"sRGB" |
Returns#
RGBAColorImplementation of#
IEditorAPI.convertColorToColorSpaceCall Signature#
convertColorToColorSpace(color, colorSpace): CMYKColor;Parameters#
| Parameter | Type |
|---|---|
color |
Color |
colorSpace |
"CMYK" |
Returns#
CMYKColorImplementation of#
IEditorAPI.convertColorToColorSpaceCall Signature#
convertColorToColorSpace(color, colorSpace): never;Parameters#
| Parameter | Type |
|---|---|
color |
Color |
colorSpace |
ColorSpace |
Returns#
never
Implementation of#
IEditorAPI.convertColorToColorSpaceSignatures#
convertColorToColorSpace(color: Color, colorSpace: "sRGB"): RGBAColorconvertColorToColorSpace(color: Color, colorSpace: "CMYK"): CMYKColorconvertColorToColorSpace(color: Color, colorSpace: ColorSpace): neverloadColorProfiles()#
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 this wait; the profile keeps loading for color conversion.
Parameters#
| Parameter | Type | Description |
|---|---|---|
options? |
AbortOptions |
Abort options. |
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.
Implementation of#
IEditorAPI.loadColorProfilesSignature#
loadColorProfiles(options?: AbortOptions): Promise<void>loadCMYKProfile()#
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.
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.
Deprecated#
Use loadColorProfiles instead.
Implementation of#
IEditorAPI.loadCMYKProfilecheckFileSupport()#
Inspect a resource and report its image, audio and video support. An abortSignal stops the
download and the inspection. Disposing the engine rejects a call that still waits.
abortSignal stops the
download and the inspection. Disposing the engine rejects a call that still waits.Parameters#
| Parameter | Type |
|---|---|
uri |
string |
options? |
AbortOptions |
Returns#
Promise<FileSupport>
Implementation of#
IEditorAPI.checkFileSupportSignature#
checkFileSupport(uri: string, options?: AbortOptions): Promise<FileSupport>setTypefaceResolver()#
Sets a font provider; null or undefined restores registered-source lookup.
The provider runs asynchronously on the JavaScript thread and may dispose the engine.
Invalid providers throw before replacing the current provider.
When the provider returns undefined, throws or rejects, the engine uses the default font,
and the request reports substituted. The engine ignores stale completions after provider
replacement, edits or disposal.
substituted. The engine ignores stale completions after provider
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
Implementation of#
IEditorAPI.setTypefaceResolverSignature#
setTypefaceResolver(resolver?: TypefaceResolver): voidsetURIResolver()#
Register a synchronous URI resolver. Matches @cesdk/engine’s
(uri, defaultResolver) => string signature
(bindings/wasm/js_web/src/EditorAPI.ts). The
defaultResolver argument is the engine’s built-in resolver — call
it to delegate the lookup chain.
@cesdk/engine’s
(uri, defaultResolver) => string signature
(bindings/wasm/js_web/src/EditorAPI.ts). The
defaultResolver argument is the engine’s built-in resolver — call
it to delegate the lookup chain.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.
Parameters#
| Parameter | Type |
|---|---|
resolver? |
SyncURIResolver |
Returns#
void
Implementation of#
IEditorAPI.setURIResolverSignature#
setURIResolver(resolver?: SyncURIResolver): voidsetURIResolverAsync()#
Register an asynchronous URI resolver. Matches @cesdk/engine’s
(uri, defaultResolver) => Promise<string> | string signature
(bindings/wasm/js_web/src/EditorAPI.ts). Bridges to the
native callback-style binding by adapting the returned Promise.
@cesdk/engine’s
(uri, defaultResolver) => Promise<string> | string signature
(bindings/wasm/js_web/src/EditorAPI.ts). Bridges to the
native callback-style binding by adapting the returned Promise.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.
Parameters#
| Parameter | Type |
|---|---|
resolver? |
AsyncURIResolver |
Returns#
void
Implementation of#
IEditorAPI.setURIResolverAsyncSignature#
setURIResolverAsync(resolver?: AsyncURIResolver): voidisHighlightingEnabled()#
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): voidstartTracking()#
Start the engine’s analytics tracking pipeline. Mirrors
@cesdk/engine’s editor.startTracking(license, userId); invoked
automatically from CreativeEngine.init when license and/or
userId are passed in the Configuration. Safe to call multiple times.
@cesdk/engine’s editor.startTracking(license, userId); invoked
automatically from CreativeEngine.init when license and/or
userId are passed in the Configuration. Safe to call multiple times.The C++ binding accepts a third deviceId argument that the engine
itself uses for tracking-pipeline disambiguation; WASM always passes
'' (see bindings/wasm/js_web/src/EditorAPI.ts) — we
mirror that here so the no-args / “engine picks a default device id”
path is honored.
Parameters#
| Parameter | Type |
|---|---|
license |
string |
userId |
string |
deviceId? |
string |
Returns#
void
Signature#
startTracking(license: string, userId: string, deviceId?: string): 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.
Parameters#
| Parameter | Type |
|---|---|
history |
number |
Returns#
void
Implementation of#
IEditorAPI.setActiveHistorySignature#
setActiveHistory(history: number): 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.
Use canUndo beforehand to determine whether a step is available.
Returns#
void
Implementation of#
IEditorAPI.undoSignature#
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.
Use canRedo beforehand to determine whether a step is available.
Returns#
void
Implementation of#
IEditorAPI.redoSignature#
redo(): voidonStateChanged#
Subscribe to editor-state changes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
() => void |
Called whenever the editor state changes. |
Returns#
A function that unsubscribes when called.
() => void
onSettingsChanged#
Subscribe to editor settings changes. Matches WASM’s
engine.editor.onSettingsChanged(callback). The native C++ side
implements this via subscribeToSettings; this wrapper exposes it on
the editor API so portable consumers (settings-reactive UI) work on
both bindings.
engine.editor.onSettingsChanged(callback). The native C++ side
implements this via subscribeToSettings; this wrapper exposes it on
the editor API so portable consumers (settings-reactive UI) work on
both bindings.Parameters#
| Parameter | Type |
|---|---|
callback |
() => void |
Returns#
A function that unsubscribes when called.
() => void
Implementation of#
IEditorAPI.onSettingsChangedonHistoryUpdatedWithKind#
Subscribe to history updates. The callback receives a HistoryUpdate
describing what kind of update happened (matches the node wasm
binding’s EditorAPI surface) so consumers can distinguish a
snapshot mutation from an Activated event triggered by
setActiveHistory — important for save-button logic that should NOT
fire on activation alone.
HistoryUpdate
describing what kind of update happened (matches the node wasm
binding’s EditorAPI surface) so consumers can distinguish a
snapshot mutation from an Activated event triggered by
setActiveHistory — important for save-button logic that should NOT
fire on activation alone.Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
(kind) => void |
Called with the kind of update. |
Returns#
A function that unsubscribes when called.
() => void
Implementation of#
IEditorAPI.onHistoryUpdatedWithKindonRoleChanged#
Subscribe to role changes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
callback |
(role) => void |
Called with the new role when it changes. |
Returns#
A function that unsubscribes when called.
() => void
createBuffer()#
Create a new buffer and return its URI.
Returns#
string
A URI to identify the created buffer (buffer://N format).
Implementation of#
IEditorAPI.createBufferSignature#
createBuffer(): stringdestroyBuffer()#
Destroy a buffer and free its resources.
Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to destroy. |
Returns#
void
Implementation of#
IEditorAPI.destroyBufferSignature#
destroyBuffer(uri: string): voidsetBufferData()#
Set the data of a buffer at a given offset.
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
Implementation of#
IEditorAPI.setBufferDataSignature#
setBufferData(uri: string, offset: number, data: Uint8Array): voidgetBufferData()#
Get the data of a buffer at a given offset.
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.
Implementation of#
IEditorAPI.getBufferDataSignature#
getBufferData(uri: string, offset: number, length: number): Uint8ArraygetBufferLength()#
Get the length of a buffer.
Parameters#
| Parameter | Type | Description |
|---|---|---|
uri |
string |
The URI of the buffer to query. |
Returns#
number
The length of the buffer in bytes.
Implementation of#
IEditorAPI.getBufferLengthSignature#
getBufferLength(uri: string): numbersetBufferLength()#
Resize a buffer. Truncates if length is smaller than the current
size; zero-extends if larger. Matches the WASM editor.setBufferLength
shape used by psd/pdf/idml importers to pre-allocate a buffer before
writing data with setBufferData.
length is smaller than the current
size; zero-extends if larger. Matches the WASM editor.setBufferLength
shape used by psd/pdf/idml importers to pre-allocate a buffer before
writing data with setBufferData.Parameters#
| Parameter | Type |
|---|---|
uri |
string |
length |
number |
Returns#
void
Implementation of#
IEditorAPI.setBufferLengthSignature#
setBufferLength(uri: string, length: number): voidVector Edit#
addVectorNode()#
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(): voiddeleteSelectedVectorControlPoints()#
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(): 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(): numbersetSelectedVectorNodeMirrorMode()#
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): voidgetVectorEditAddMode()#
Check whether vector edit add mode is currently active.
Returns#
boolean
true if add mode is active.
Signature#
getVectorEditAddMode(): 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): voidgetVectorEditBendMode()#
Check whether vector edit bend mode is currently active.
Returns#
boolean
true if bend mode is active.
Signature#
getVectorEditBendMode(): booleansetVectorEditBendMode()#
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): voidgetVectorEditDeleteMode()#
Check whether vector edit delete mode is currently active.
Returns#
boolean
true if delete mode is active.
Signature#
getVectorEditDeleteMode(): 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): voidhasSelectedVectorNode()#
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(): booleanhasSelectedVectorControlPoint()#
Check whether a vector control point handle is currently selected.
Returns#
boolean
Signature#
hasSelectedVectorControlPoint(): booleantoggleSelectedVectorNodeSmooth()#
Toggle the currently selected vector node between smooth (bezier handles)
and corner (no handles).
Returns#
void
Signature#
toggleSelectedVectorNodeSmooth(): voidViewport#
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
Implementation of#
IEditorAPI.setSafeAreaInsetsSignature#
setSafeAreaInsets(insets: object): void