Skip to content
This plugin is new and currently in beta. For the stable version, please use the previous version of the plugin.

ModulesPanelTabApi

Version Availability

This interface is available starting from v3.7.0

API interface for Modules Panel Tab implementations.

typescript
interface ModulesPanelTabApi extends BaseApi, BaseModifierApi

Description

The ModulesPanelTabApi provides access to editor functionalities specifically for ModulesPanelTab instances. It extends BaseApi and BaseModifierApi to support UI element management, translation, and document modifications.

Import

typescript
import { ModulesPanelTabApi } from '@stripoinc/ui-editor-extensions';

Inheritance

Methods

setVisibility()

Sets the visibility of a specific UI element within the tab's scope.

typescript
setVisibility(uiElementName: string, isVisible: boolean): void

Parameters

NameTypeDescription
uiElementNamestringID of the UI element to show/hide
isVisiblebooleanTrue to show the element, false to hide it

setUIEAttribute()

Sets a specific attribute on a target UI element within the tab's scope.

typescript
setUIEAttribute(uiElementName: string, attribute: string, value: unknown): void

Parameters

NameTypeDescription
uiElementNamestringID of the target UI element
attributestringAttribute name (use values from UEAttr)
valueunknownAttribute value

updateValues()

Updates the values of multiple UI elements within the tab's scope at once.

typescript
updateValues(valuesMap: Record<string, unknown>): void

Parameters

NameTypeDescription
valuesMapRecord<string, unknown>UI element IDs mapped to their new values

getValues()

Returns the current values of all UI elements managed by this tab.

typescript
getValues(): Record<string, unknown>

Returns

Record<string, unknown> - Current values keyed by UI element ID


onValueChanged()

Registers a callback function to be invoked when the value of a specific UI element changes.

typescript
onValueChanged(
  uiElementName: string,
  callback: (newValue: unknown, oldValue: unknown) => void
): void

Parameters

NameTypeDescription
uiElementNamestringID of the UI element to listen to
callback(newValue: unknown, oldValue: unknown) => voidCallback for value changes