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
new RedDokia(container, options): RedDokia;Parameters
| Parameter | Type |
|---|---|
container | HTMLElement |
options | RedDokiaProps |
Returns
RedDokia
Inherited from
RedDokiaController.constructor
Properties
closeAllViews
closeAllViews: (groupId?) => void;Closes all closable unpinned tabs in groupId (defaults to the active group).
Parameters
| Parameter | Type |
|---|---|
groupId? | string |
Returns
void
Implementation of
RedDokiaInstance.closeAllViews
Inherited from
RedDokiaController.closeAllViews
closeOtherViews
closeOtherViews: (groupId, keepViewId) => void;Closes all closable unpinned tabs in groupId except keepViewId.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
keepViewId | string |
Returns
void
Implementation of
RedDokiaInstance.closeOtherViews
Inherited from
RedDokiaController.closeOtherViews
closeSavedViews
closeSavedViews: (groupId?) => void;Closes all closable tabs in groupId (defaults to the active group) that are not marked dirty.
Parameters
| Parameter | Type |
|---|---|
groupId? | string |
Returns
void
Implementation of
RedDokiaInstance.closeSavedViews
Inherited from
RedDokiaController.closeSavedViews
closeView
closeView: (viewId) => void;Closes a view tab (respecting onBeforeCloseView guards if configured).
Parameters
| Parameter | Type |
|---|---|
viewId | string |
Returns
void
Implementation of
Inherited from
closeViewsToRight
closeViewsToRight: (groupId, pivotViewId) => void;Closes all closable unpinned tabs positioned to the right of pivotViewId in groupId.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
pivotViewId | string |
Returns
void
Implementation of
RedDokiaInstance.closeViewsToRight
Inherited from
RedDokiaController.closeViewsToRight
dockViewToGroup
dockViewToGroup: (viewId, targetGroupId, zone) => void;Moves and docks viewId into targetGroupId at the specified directional zone.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
targetGroupId | string |
zone | RedDokiaDockZone |
Returns
void
Implementation of
RedDokiaInstance.dockViewToGroup
Inherited from
RedDokiaController.dockViewToGroup
exportLayoutJson
exportLayoutJson: () => string;Serializes the current layout state into a versioned JSON snapshot string.
Returns
string
Implementation of
RedDokiaInstance.exportLayoutJson
Inherited from
RedDokiaController.exportLayoutJson
floatGroup
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
| Parameter | Type |
|---|---|
groupId? | string |
rect? | Partial<RedDokiaRect> |
Returns
void
Implementation of
Inherited from
floatView
floatView: (viewId, rect?) => void;Detaches a single view tab into a Zero-Unmount floating window at optional rect coordinates.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
rect? | Partial<RedDokiaRect> |
Returns
void
Implementation of
Inherited from
getLayoutState
getLayoutState: () => RedDokiaLayoutState;Returns a read-only snapshot of the current RedDokiaLayoutState.
Returns
Implementation of
RedDokiaInstance.getLayoutState
Inherited from
RedDokiaController.getLayoutState
getLocale
getLocale: () => RedDokiaLocale;Returns the currently active UI locale code.
Returns
Implementation of
Inherited from
getPopoutViewIds
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
getTheme: () => RedDokiaThemeId;Returns the currently active workbench theme ID ('dark', 'light', or a custom theme ID).
Returns
Implementation of
Inherited from
importLayoutJson
importLayoutJson: (json) => boolean;Restores the workbench layout from a serialized JSON snapshot string; returns true if valid and applied.
Parameters
| Parameter | Type |
|---|---|
json | string |
Returns
boolean
Implementation of
RedDokiaInstance.importLayoutJson
Inherited from
RedDokiaController.importLayoutJson
moveViewToEdgeSlot
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
| Parameter | Type |
|---|---|
viewId | string |
slot | RedDokiaEdgeSlot |
Returns
void
Implementation of
RedDokiaInstance.moveViewToEdgeSlot
Inherited from
RedDokiaController.moveViewToEdgeSlot
openView
openView: (viewId, targetGroupOrOptions?) => void;Opens an existing registered view or spawns a dynamic view in the target group (activates it if already open).
Parameters
| Parameter | Type |
|---|---|
viewId | string |
targetGroupOrOptions? | | string | RedDokiaOpenViewOptions<Record<string, any>> |
Returns
void
Implementation of
Inherited from
popoutGroup
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
| Parameter | Type |
|---|---|
groupId? | string |
rect? | Partial<RedDokiaRect> |
Returns
void
Implementation of
Inherited from
RedDokiaController.popoutGroup
popoutView
popoutView: (viewId, rect?) => void;Detaches a view into a native OS browser pop-out window via window.open.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
rect? | Partial<RedDokiaRect> |
Returns
void
Implementation of
Inherited from
redockFloatingGroup
redockFloatingGroup: (floatingGroupId, targetGroupId?) => void;Re-docks all views of a floating window back into targetGroupId or an appropriate grid group.
Parameters
| Parameter | Type |
|---|---|
floatingGroupId | string |
targetGroupId? | string |
Returns
void
Implementation of
RedDokiaInstance.redockFloatingGroup
Inherited from
RedDokiaController.redockFloatingGroup
redockFloatingView
redockFloatingView: (viewId, targetGroupId?) => void;Re-docks a single view from a floating window back into the main grid.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
targetGroupId? | string |
Returns
void
Implementation of
RedDokiaInstance.redockFloatingView
Inherited from
RedDokiaController.redockFloatingView
redockPopoutGroup
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
| Parameter | Type |
|---|---|
popoutIdOrViewId | string |
targetGroupId? | string |
Returns
void
Implementation of
RedDokiaInstance.redockPopoutGroup
Inherited from
RedDokiaController.redockPopoutGroup
redockPopoutView
redockPopoutView: (viewId, targetGroupId?) => void;Re-docks a single view from a native pop-out window back into the main workbench grid.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
targetGroupId? | string |
Returns
void
Implementation of
RedDokiaInstance.redockPopoutView
Inherited from
RedDokiaController.redockPopoutView
registerView
registerView: <TParams>(schema, options?) => void;Dynamically registers a new RedDokiaViewSchema at runtime and optionally opens it immediately.
Type Parameters
| Type Parameter | Default type |
|---|---|
TParams | Record<string, any> |
Parameters
| Parameter | Type |
|---|---|
schema | RedDokiaViewSchema<TParams> |
options? | { open?: boolean; targetGroupId?: string; } |
options.open? | boolean |
options.targetGroupId? | string |
Returns
void
Implementation of
Inherited from
RedDokiaController.registerView
resetLayout
resetLayout: () => void;Resets the workbench layout back to layout and clears persisted snapshot overrides.
Returns
void
Implementation of
Inherited from
RedDokiaController.resetLayout
setEdgeBarLabelsVisible
setEdgeBarLabelsVisible: (visible) => void;Shows or hides tool window name labels on the peripheral EdgeBar icon rails.
Parameters
| Parameter | Type |
|---|---|
visible | boolean |
Returns
void
Implementation of
RedDokiaInstance.setEdgeBarLabelsVisible
Inherited from
RedDokiaController.setEdgeBarLabelsVisible
setGroupOptions
setGroupOptions: (groupId, options) => void;Updates per-group chromeless header visibility (showHeader) or drop/close lock (locked) flags.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
options | { locked?: boolean; showHeader?: boolean; } |
options.locked? | boolean |
options.showHeader? | boolean |
Returns
void
Implementation of
RedDokiaInstance.setGroupOptions
Inherited from
RedDokiaController.setGroupOptions
setLayout
setLayout: (layout) => void;Switches the active workbench layout to the given declarative layout schema.
Parameters
| Parameter | Type |
|---|---|
layout | RedDokiaLayoutSchema |
Returns
void
Implementation of
Inherited from
setLocale
setLocale: (locale) => void;Changes the active UI locale ('en', 'ko', or 'ja') at runtime.
Parameters
| Parameter | Type |
|---|---|
locale | RedDokiaLocale |
Returns
void
Implementation of
Inherited from
setTheme
setTheme: (themeId) => void;Switches the active workbench theme ('dark', 'light', or any custom theme ID registered in themes).
Parameters
| Parameter | Type |
|---|---|
themeId | RedDokiaThemeId |
Returns
void
Implementation of
Inherited from
splitGroup
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
| Parameter | Type |
|---|---|
groupId | string |
direction | RedDokiaLayoutOrientation |
newViewId? | string |
Returns
void
Implementation of
Inherited from
startExternalDrag
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
| Parameter | Type |
|---|---|
event | { altKey?: boolean; button?: number; clientX: number; clientY: number; } |
event.altKey? | boolean |
event.button? | number |
event.clientX | number |
event.clientY | number |
options | RedDokiaExternalDragOptions |
Returns
void
Example
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
toggleCollapseGroup: (groupId) => void;Toggles the collapsed/expanded state of a docked group.
Parameters
| Parameter | Type |
|---|---|
groupId | string |
Returns
void
Implementation of
RedDokiaInstance.toggleCollapseGroup
Inherited from
RedDokiaController.toggleCollapseGroup
toggleEdgeBar
toggleEdgeBar: (edge) => void;Toggles collapse/expand of the specified peripheral edge bar ('left', 'right', or 'bottom').
Parameters
| Parameter | Type |
|---|---|
edge | "bottom" | "left" | "right" |
Returns
void
Implementation of
RedDokiaInstance.toggleEdgeBar
Inherited from
RedDokiaController.toggleEdgeBar
toggleEdgeSlot
toggleEdgeSlot: (slot) => void;Toggles visibility of the tool panel bound to the specified peripheral RedDokiaEdgeSlot.
Parameters
| Parameter | Type |
|---|---|
slot | RedDokiaEdgeSlot |
Returns
void
Implementation of
RedDokiaInstance.toggleEdgeSlot
Inherited from
RedDokiaController.toggleEdgeSlot
toggleLockGroup
toggleLockGroup: (groupId?) => void;Toggles the drop/close lock flag on groupId (defaults to the active group).
Parameters
| Parameter | Type |
|---|---|
groupId? | string |
Returns
void
Implementation of
RedDokiaInstance.toggleLockGroup
Inherited from
RedDokiaController.toggleLockGroup
toggleMaximizeGroup
toggleMaximizeGroup: (groupId?) => void;Toggles Zen Mode maximization on groupId (defaults to the currently active group).
Parameters
| Parameter | Type |
|---|---|
groupId? | string |
Returns
void
Implementation of
RedDokiaInstance.toggleMaximizeGroup
Inherited from
RedDokiaController.toggleMaximizeGroup
togglePinView
togglePinView: (viewId) => void;Toggles the pinned state of a tab within its host group.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
Returns
void
Implementation of
RedDokiaInstance.togglePinView
Inherited from
RedDokiaController.togglePinView
updateView
updateView: (viewId, patch) => void;Patches mutable runtime metadata (title, badge, dirty, params, constraints, etc.) of a view.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
patch | RedDokiaViewMetadataPatch |
Returns
void
Implementation of
Inherited from
Accessors
controller
Get Signature
get controller(): RedDokiaController;Imperative controller API for inspecting and mutating the workbench state.
Returns
Imperative controller API for inspecting and mutating the workbench state.
Implementation of
rootElement
Get Signature
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
Methods
destroy()
destroy(): void;Tears down all event listeners, ResizeObservers, pop-out windows, and DOM nodes created by this instance.
Returns
void
getViewHostElement()
getViewHostElement(viewId): HTMLElement;Returns the persistent HTMLElement host container for a mounted view ID, or null if not yet mounted.
Parameters
| Parameter | Type |
|---|---|
viewId | string |
Returns
HTMLElement
setOptions()
setOptions(nextOptions): void;Updates workbench props dynamically without destroying or remounting views.
Parameters
| Parameter | Type |
|---|---|
nextOptions | Partial<RedDokiaProps> |
Returns
void