Skip to content

RedDokia API Reference / RedDokia

Class: RedDokia ​

Complete Zero-Dependency Vanilla TypeScript DOM Engine for RedDokia. Manages the workbench shell, persistent view host DOM nodes, 120fps interactions, and lifecycle callbacks.

Extends ​

Implements ​

Constructors ​

Constructor ​

ts
new RedDokia(container, options): RedDokia;

Parameters ​

ParameterType
containerHTMLElement
optionsRedDokiaProps

Returns ​

RedDokia

Inherited from ​

RedDokiaController.constructor

Properties ​

closeAllViews ​

ts
closeAllViews: (groupId?) => void;

Closes all closable unpinned tabs in groupId (defaults to the active group).

Parameters ​

ParameterType
groupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.closeAllViews

Inherited from ​

RedDokiaController.closeAllViews


closeOtherViews ​

ts
closeOtherViews: (groupId, keepViewId) => void;

Closes all closable unpinned tabs in groupId except keepViewId.

Parameters ​

ParameterType
groupIdstring
keepViewIdstring

Returns ​

void

Implementation of ​

RedDokiaInstance.closeOtherViews

Inherited from ​

RedDokiaController.closeOtherViews


closeSavedViews ​

ts
closeSavedViews: (groupId?) => void;

Closes all closable tabs in groupId (defaults to the active group) that are not marked dirty.

Parameters ​

ParameterType
groupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.closeSavedViews

Inherited from ​

RedDokiaController.closeSavedViews


closeView ​

ts
closeView: (viewId) => void;

Closes a view tab (respecting onBeforeCloseView guards if configured).

Parameters ​

ParameterType
viewIdstring

Returns ​

void

Implementation of ​

RedDokiaInstance.closeView

Inherited from ​

RedDokiaController.closeView


closeViewsToRight ​

ts
closeViewsToRight: (groupId, pivotViewId) => void;

Closes all closable unpinned tabs positioned to the right of pivotViewId in groupId.

Parameters ​

ParameterType
groupIdstring
pivotViewIdstring

Returns ​

void

Implementation of ​

RedDokiaInstance.closeViewsToRight

Inherited from ​

RedDokiaController.closeViewsToRight


dockViewToGroup ​

ts
dockViewToGroup: (viewId, targetGroupId, zone) => void;

Moves and docks viewId into targetGroupId at the specified directional zone.

Parameters ​

ParameterType
viewIdstring
targetGroupIdstring
zoneRedDokiaDockZone

Returns ​

void

Implementation of ​

RedDokiaInstance.dockViewToGroup

Inherited from ​

RedDokiaController.dockViewToGroup


exportLayoutJson ​

ts
exportLayoutJson: () => string;

Serializes the current layout state into a versioned JSON snapshot string.

Returns ​

string

Implementation of ​

RedDokiaInstance.exportLayoutJson

Inherited from ​

RedDokiaController.exportLayoutJson


floatGroup ​

ts
floatGroup: (groupId?, rect?) => void;

Detaches all tabs of a docked groupId (defaults to the active group) together into a multi-tab Zero-Unmount floating window.

Parameters ​

ParameterType
groupId?string
rect?Partial<RedDokiaRect>

Returns ​

void

Implementation of ​

RedDokiaInstance.floatGroup

Inherited from ​

RedDokiaController.floatGroup


floatView ​

ts
floatView: (viewId, rect?) => void;

Detaches a single view tab into a Zero-Unmount floating window at optional rect coordinates.

Parameters ​

ParameterType
viewIdstring
rect?Partial<RedDokiaRect>

Returns ​

void

Implementation of ​

RedDokiaInstance.floatView

Inherited from ​

RedDokiaController.floatView


getLayoutState ​

ts
getLayoutState: () => RedDokiaLayoutState;

Returns a read-only snapshot of the current RedDokiaLayoutState.

Returns ​

RedDokiaLayoutState

Implementation of ​

RedDokiaInstance.getLayoutState

Inherited from ​

RedDokiaController.getLayoutState


getLocale ​

ts
getLocale: () => RedDokiaLocale;

Returns the currently active UI locale code.

Returns ​

RedDokiaLocale

Implementation of ​

RedDokiaInstance.getLocale

Inherited from ​

RedDokiaController.getLocale


getPopoutViewIds ​

ts
getPopoutViewIds: () => string[];

Returns all view IDs currently hosted inside open native pop-out windows.

Returns ​

string[]

Implementation of ​

RedDokiaInstance.getPopoutViewIds

Inherited from ​

RedDokiaController.getPopoutViewIds


getTheme ​

ts
getTheme: () => RedDokiaThemeId;

Returns the currently active workbench theme ID ('dark', 'light', or a custom theme ID).

Returns ​

RedDokiaThemeId

Implementation of ​

RedDokiaInstance.getTheme

Inherited from ​

RedDokiaController.getTheme


importLayoutJson ​

ts
importLayoutJson: (json) => boolean;

Restores the workbench layout from a serialized JSON snapshot string; returns true if valid and applied.

Parameters ​

ParameterType
jsonstring

Returns ​

boolean

Implementation of ​

RedDokiaInstance.importLayoutJson

Inherited from ​

RedDokiaController.importLayoutJson


moveViewToEdgeSlot ​

ts
moveViewToEdgeSlot: (viewId, slot) => void;

Moves a tool window view to one of the 6 peripheral EdgeBar slots ('left-top', 'left-bottom', 'bottom-left', 'bottom-right', 'right-bottom', 'right-top').

Parameters ​

ParameterType
viewIdstring
slotRedDokiaEdgeSlot

Returns ​

void

Implementation of ​

RedDokiaInstance.moveViewToEdgeSlot

Inherited from ​

RedDokiaController.moveViewToEdgeSlot


openView ​

ts
openView: (viewId, targetGroupOrOptions?) => void;

Opens an existing registered view or spawns a dynamic view in the target group (activates it if already open).

Parameters ​

ParameterType
viewIdstring
targetGroupOrOptions?| string | RedDokiaOpenViewOptions<Record<string, any>>

Returns ​

void

Implementation of ​

RedDokiaInstance.openView

Inherited from ​

RedDokiaController.openView


popoutGroup ​

ts
popoutGroup: (groupId?, rect?) => void;

Detaches an entire group's tabs (defaults to the active group) into a multi-tab native OS browser pop-out window.

Parameters ​

ParameterType
groupId?string
rect?Partial<RedDokiaRect>

Returns ​

void

Implementation of ​

RedDokiaInstance.popoutGroup

Inherited from ​

RedDokiaController.popoutGroup


popoutView ​

ts
popoutView: (viewId, rect?) => void;

Detaches a view into a native OS browser pop-out window via window.open.

Parameters ​

ParameterType
viewIdstring
rect?Partial<RedDokiaRect>

Returns ​

void

Implementation of ​

RedDokiaInstance.popoutView

Inherited from ​

RedDokiaController.popoutView


redockFloatingGroup ​

ts
redockFloatingGroup: (floatingGroupId, targetGroupId?) => void;

Re-docks all views of a floating window back into targetGroupId or an appropriate grid group.

Parameters ​

ParameterType
floatingGroupIdstring
targetGroupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.redockFloatingGroup

Inherited from ​

RedDokiaController.redockFloatingGroup


redockFloatingView ​

ts
redockFloatingView: (viewId, targetGroupId?) => void;

Re-docks a single view from a floating window back into the main grid.

Parameters ​

ParameterType
viewIdstring
targetGroupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.redockFloatingView

Inherited from ​

RedDokiaController.redockFloatingView


redockPopoutGroup ​

ts
redockPopoutGroup: (popoutIdOrViewId, targetGroupId?) => void;

Re-docks all views of a native pop-out window back into the main workbench grid. Accepts either a pop-out window ID or any view ID hosted inside that pop-out window.

Parameters ​

ParameterType
popoutIdOrViewIdstring
targetGroupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.redockPopoutGroup

Inherited from ​

RedDokiaController.redockPopoutGroup


redockPopoutView ​

ts
redockPopoutView: (viewId, targetGroupId?) => void;

Re-docks a single view from a native pop-out window back into the main workbench grid.

Parameters ​

ParameterType
viewIdstring
targetGroupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.redockPopoutView

Inherited from ​

RedDokiaController.redockPopoutView


registerView ​

ts
registerView: <TParams>(schema, options?) => void;

Dynamically registers a new RedDokiaViewSchema at runtime and optionally opens it immediately.

Type Parameters ​

Type ParameterDefault type
TParamsRecord<string, any>

Parameters ​

ParameterType
schemaRedDokiaViewSchema<TParams>
options?{ open?: boolean; targetGroupId?: string; }
options.open?boolean
options.targetGroupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.registerView

Inherited from ​

RedDokiaController.registerView


resetLayout ​

ts
resetLayout: () => void;

Resets the workbench layout back to layout and clears persisted snapshot overrides.

Returns ​

void

Implementation of ​

RedDokiaInstance.resetLayout

Inherited from ​

RedDokiaController.resetLayout


setEdgeBarLabelsVisible ​

ts
setEdgeBarLabelsVisible: (visible) => void;

Shows or hides tool window name labels on the peripheral EdgeBar icon rails.

Parameters ​

ParameterType
visibleboolean

Returns ​

void

Implementation of ​

RedDokiaInstance.setEdgeBarLabelsVisible

Inherited from ​

RedDokiaController.setEdgeBarLabelsVisible


setGroupOptions ​

ts
setGroupOptions: (groupId, options) => void;

Updates per-group chromeless header visibility (showHeader) or drop/close lock (locked) flags.

Parameters ​

ParameterType
groupIdstring
options{ locked?: boolean; showHeader?: boolean; }
options.locked?boolean
options.showHeader?boolean

Returns ​

void

Implementation of ​

RedDokiaInstance.setGroupOptions

Inherited from ​

RedDokiaController.setGroupOptions


setLayout ​

ts
setLayout: (layout) => void;

Switches the active workbench layout to the given declarative layout schema.

Parameters ​

ParameterType
layoutRedDokiaLayoutSchema

Returns ​

void

Implementation of ​

RedDokiaInstance.setLayout

Inherited from ​

RedDokiaController.setLayout


setLocale ​

ts
setLocale: (locale) => void;

Changes the active UI locale ('en', 'ko', or 'ja') at runtime.

Parameters ​

ParameterType
localeRedDokiaLocale

Returns ​

void

Implementation of ​

RedDokiaInstance.setLocale

Inherited from ​

RedDokiaController.setLocale


setTheme ​

ts
setTheme: (themeId) => void;

Switches the active workbench theme ('dark', 'light', or any custom theme ID registered in themes).

Parameters ​

ParameterType
themeIdRedDokiaThemeId

Returns ​

void

Implementation of ​

RedDokiaInstance.setTheme

Inherited from ​

RedDokiaController.setTheme


splitGroup ​

ts
splitGroup: (groupId, direction, newViewId?) => void;

Splits groupId (defaults to the active group when omitted) along direction ('horizontal' = right, 'vertical' = down), moving its active tab (or newViewId) when splittable.

Parameters ​

ParameterType
groupIdstring
directionRedDokiaLayoutOrientation
newViewId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.splitGroup

Inherited from ​

RedDokiaController.splitGroup


startExternalDrag ​

ts
startExternalDrag: (event, options) => void;

Starts a PointerEvent drag-and-dock session from an external host DOM element (such as a widget palette or file list) using the native 5-zone dock overlay and hit-tester.

Parameters ​

ParameterType
event{ altKey?: boolean; button?: number; clientX: number; clientY: number; }
event.altKey?boolean
event.button?number
event.clientXnumber
event.clientYnumber
optionsRedDokiaExternalDragOptions

Returns ​

void

Example ​

ts
chip.addEventListener('pointerdown', (e) => {
  controller.startExternalDrag(e, {
    viewId: 'widget-1',
    templateId: 'widget-template',
    title: 'Metrics Widget',
    params: { metric: 'fps' },
  });
});

Implementation of ​

RedDokiaInstance.startExternalDrag

Inherited from ​

RedDokiaController.startExternalDrag


toggleCollapseGroup ​

ts
toggleCollapseGroup: (groupId) => void;

Toggles the collapsed/expanded state of a docked group.

Parameters ​

ParameterType
groupIdstring

Returns ​

void

Implementation of ​

RedDokiaInstance.toggleCollapseGroup

Inherited from ​

RedDokiaController.toggleCollapseGroup


toggleEdgeBar ​

ts
toggleEdgeBar: (edge) => void;

Toggles collapse/expand of the specified peripheral edge bar ('left', 'right', or 'bottom').

Parameters ​

ParameterType
edge"bottom" | "left" | "right"

Returns ​

void

Implementation of ​

RedDokiaInstance.toggleEdgeBar

Inherited from ​

RedDokiaController.toggleEdgeBar


toggleEdgeSlot ​

ts
toggleEdgeSlot: (slot) => void;

Toggles visibility of the tool panel bound to the specified peripheral RedDokiaEdgeSlot.

Parameters ​

ParameterType
slotRedDokiaEdgeSlot

Returns ​

void

Implementation of ​

RedDokiaInstance.toggleEdgeSlot

Inherited from ​

RedDokiaController.toggleEdgeSlot


toggleLockGroup ​

ts
toggleLockGroup: (groupId?) => void;

Toggles the drop/close lock flag on groupId (defaults to the active group).

Parameters ​

ParameterType
groupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.toggleLockGroup

Inherited from ​

RedDokiaController.toggleLockGroup


toggleMaximizeGroup ​

ts
toggleMaximizeGroup: (groupId?) => void;

Toggles Zen Mode maximization on groupId (defaults to the currently active group).

Parameters ​

ParameterType
groupId?string

Returns ​

void

Implementation of ​

RedDokiaInstance.toggleMaximizeGroup

Inherited from ​

RedDokiaController.toggleMaximizeGroup


togglePinView ​

ts
togglePinView: (viewId) => void;

Toggles the pinned state of a tab within its host group.

Parameters ​

ParameterType
viewIdstring

Returns ​

void

Implementation of ​

RedDokiaInstance.togglePinView

Inherited from ​

RedDokiaController.togglePinView


updateView ​

ts
updateView: (viewId, patch) => void;

Patches mutable runtime metadata (title, badge, dirty, params, constraints, etc.) of a view.

Parameters ​

ParameterType
viewIdstring
patchRedDokiaViewMetadataPatch

Returns ​

void

Implementation of ​

RedDokiaInstance.updateView

Inherited from ​

RedDokiaController.updateView

Accessors ​

controller ​

Get Signature ​

ts
get controller(): RedDokiaController;

Imperative controller API for inspecting and mutating the workbench state.

Returns ​

RedDokiaController

Imperative controller API for inspecting and mutating the workbench state.

Implementation of ​

RedDokiaInstance.controller


rootElement ​

Get Signature ​

ts
get rootElement(): HTMLDivElement;

Root .reddokia-root DOM element created inside the host container.

Returns ​

HTMLDivElement

Root .reddokia-root DOM element created inside the host container.

Implementation of ​

RedDokiaInstance.rootElement

Methods ​

destroy() ​

ts
destroy(): void;

Tears down all event listeners, ResizeObservers, pop-out windows, and DOM nodes created by this instance.

Returns ​

void


getViewHostElement() ​

ts
getViewHostElement(viewId): HTMLElement;

Returns the persistent HTMLElement host container for a mounted view ID, or null if not yet mounted.

Parameters ​

ParameterType
viewIdstring

Returns ​

HTMLElement


setOptions() ​

ts
setOptions(nextOptions): void;

Updates workbench props dynamically without destroying or remounting views.

Parameters ​

ParameterType
nextOptionsPartial<RedDokiaProps>

Returns ​

void