Skip to content

EditorState

Version Availability

This interface is available starting from v3.8.0

Typed object returned by BaseApi.getEditorState().

typescript
interface EditorState {
  previewDeviceMode: PreviewDeviceMode;
  panelPosition: PanelPosition;
}

Description

The EditorState interface groups the observable editor UI state into a single typed object. It lets extensions inspect the current preview mode and panel layout.

Import

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

Properties

PropertyTypeDescription
previewDeviceModePreviewDeviceModeCurrent device preview mode
panelPositionPanelPositionCurrent panel arrangement

Example

typescript
const state = this.api.getEditorState();

if (state.previewDeviceMode === PreviewDeviceMode.MOBILE) {
  this.useMobileLayout();
}