Appearance
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
| Property | Type | Description |
|---|---|---|
previewDeviceMode | PreviewDeviceMode | Current device preview mode |
panelPosition | PanelPosition | Current panel arrangement |
Example
typescript
const state = this.api.getEditorState();
if (state.previewDeviceMode === PreviewDeviceMode.MOBILE) {
this.useMobileLayout();
}