plugin-exports#
PasswordField()#
Names the generated stubs re-export from this module.
A plugin's import { Plot } from '@tqt-llc/nuclei-stubs' is rewritten to a
property read off window.NucleiPluginAPI, so the import resolves only when
the name is both declared here (for the compiler) and a property of
PluginAPI (for the runtime). Every name below satisfies both — Hooks and
Utils are spread into PluginAPI, so their members count.
Parameters#
| Parameter | Type |
|---|---|
props |
TextFieldProps |
Returns#
Element
registerPluginTranslations()#
Register plugin translations
Call this to add plugin translations to i18next. Should be called once when plugin loads.
Parameters#
| Parameter | Type | Description |
|---|---|---|
pluginId |
string |
Plugin identifier |
translations |
Record<string, any> |
Translation resources { en: {...}, ru: {...} } |
Returns#
void
usePluginTranslation()#
Names the generated stubs re-export from this module.
A plugin's import { Plot } from '@tqt-llc/nuclei-stubs' is rewritten to a
property read off window.NucleiPluginAPI, so the import resolves only when
the name is both declared here (for the compiler) and a property of
PluginAPI (for the runtime). Every name below satisfies both — Hooks and
Utils are spread into PluginAPI, so their members count.
Returns#
any
useSharedPluginState()#
Hook for shared plugin state with automatic backend sync
This hook provides a cleaner interface where you can directly mutate state properties and they automatically sync to the backend.
State updates from backend are debounced to prevent excessive re-renders.
Type Parameters#
| Type Parameter | Description |
|---|---|
TState extends Record<string, any> |
State type (should match backend State class) |
Parameters#
| Parameter | Type | Description |
|---|---|---|
debounceDelay? |
number |
Delay in milliseconds before applying state updates (default: 100) |
Returns#
TState | undefined
Proxied state object that syncs changes to backend, or undefined if not loaded
Example#
interface State {
status: string
value: number
}
function MyPlugin() {
const state = useSharedPluginState<State>()
if (!state) return <div>Loading...</div>
return (
<div>
<p>Status: {state.status}</p>
<button onClick={() => { state.value += 1 }}>
Increment
</button>
</div>
)
}
Commands#
const Commands: {
execute: (id) => Promise<boolean>;
register: (def, pluginId?) => void;
unregister: (id) => void;
};
Command registry API for plugins.
Ids must be namespaced plugin:<shortId>.<verb>; the per-plugin proxy in
usePluginBundleLoader enforces that and injects the owner so the command
disappears with the plugin. execute lets commands call commands.
Type Declaration#
execute#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
Promise<boolean>
register#
Parameters#
| Parameter | Type |
|---|---|
def |
CommandDef |
pluginId? |
string |
Returns#
void
unregister#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
EntityBrowser#
const EntityBrowser: {
Dialog: typeof EntityBrowser;
registerEntityType: (entityType, handler) => void;
unregisterEntityType: (entityType) => void;
};
Type Declaration#
Dialog#
EntityBrowser dialog component Plugins can render this to show the entity browser
registerEntityType#
Register a custom entity type for the entity browser
Parameters#
| Parameter | Type | Description |
|---|---|---|
entityType |
string |
Unique identifier (e.g., 'plugin:custom-page') |
handler |
EntityTypeHandler |
Entity type handler with fetch/preview functions |
Returns#
void
unregisterEntityType#
Unregister an entity type
Parameters#
| Parameter | Type |
|---|---|
entityType |
string |
Returns#
void
Flow#
const Flow: {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
Type Declaration#
buildNodeFromParams#
Build a node definition from parameter metadata. Auto-generates the component with inline inputs.
CompactFormControl#
createFlowConfiguration#
Helper functions for creating Flow configurations and nodesets
createFlowNodeSet#
DragNumberInput#
UI components for inline node inputs
FlowCanvas#
FlowNodeWrapper#
Flow node wrapper component for building custom nodes
FlowProvider#
Flow editor components for building custom workflow editors
FlowSelect#
FlowSidebar#
getRegistry#
Get the flow registry instance
Returns#
registerNodes#
Register custom nodes to an existing node set (e.g., 'sequence') NOTE: This will be replaced per-plugin with a version that auto-injects pluginId
Parameters#
| Parameter | Type | Description |
|---|---|---|
nodeSetName |
string |
Name of the node set (e.g., 'sequence', 'processor') |
nodes |
Record<string, FlowNodeDefinition> |
Object mapping node types to their definitions |
category? |
string |
Optional category name for grouping |
categoryColor? |
string |
Optional hex color for the category |
categoryIcon? |
SvgIconComponent |
Optional Material-UI icon component |
pluginId? |
string |
- |
Returns#
void
useFlow#
useFlowContext#
Hook for accessing flow context (rerun, configuration, etc.)
useFlowNode#
Hook for accessing node state and utilities within a node component
Generator#
const Generator: {
NoiseConfig: typeof NoiseConfig;
PhaseShiftConfig: typeof PhaseShiftConfig;
PreviewPlots: typeof PreviewPlots;
};
Type Declaration#
NoiseConfig#
PhaseShiftConfig#
PreviewPlots#
GlobalComponents#
Type Declaration#
register#
Parameters#
| Parameter | Type |
|---|---|
def |
GlobalComponentDef |
Returns#
void
unregister#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
Hooks#
const Hooks: {
useCallback: typeof React.useCallback;
useContext: typeof React.useContext;
useDeviceCapabilities: typeof useDeviceCapabilities;
useEffect: typeof React.useEffect;
useEntityButtons: typeof useEntityButtons;
useFlowAPI: () => {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
useMemo: typeof React.useMemo;
usePlotColors: typeof usePlotColors;
usePluginAppBar: typeof usePluginAppBar;
usePluginContext: typeof usePluginContext;
useReducer: typeof React.useReducer;
useRef: typeof React.useRef;
useSaveLoad: typeof useSaveLoad;
useSaveLoadButtons: typeof useSaveLoadButtons;
useSharedPluginState: typeof useSharedPluginState;
useState: typeof React.useState;
};
Type Declaration#
useCallback#
useContext#
useDeviceCapabilities#
useEffect#
useEntityButtons#
useFlowAPI#
useFlowAPI: () => {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
Returns#
buildNodeFromParams#
Build a node definition from parameter metadata. Auto-generates the component with inline inputs.
CompactFormControl#
createFlowConfiguration#
Helper functions for creating Flow configurations and nodesets
createFlowNodeSet#
DragNumberInput#
UI components for inline node inputs
FlowCanvas#
FlowNodeWrapper#
Flow node wrapper component for building custom nodes
FlowProvider#
Flow editor components for building custom workflow editors
FlowSelect#
FlowSidebar#
getRegistry#
Get the flow registry instance
Returns#
registerNodes#
Register custom nodes to an existing node set (e.g., 'sequence') NOTE: This will be replaced per-plugin with a version that auto-injects pluginId
Parameters#
| Parameter | Type | Description |
|---|---|---|
nodeSetName |
string |
Name of the node set (e.g., 'sequence', 'processor') |
nodes |
Record<string, FlowNodeDefinition> |
Object mapping node types to their definitions |
category? |
string |
Optional category name for grouping |
categoryColor? |
string |
Optional hex color for the category |
categoryIcon? |
SvgIconComponent |
Optional Material-UI icon component |
pluginId? |
string |
- |
Returns#
void
useFlow#
useFlowContext#
Hook for accessing flow context (rerun, configuration, etc.)
useFlowNode#
Hook for accessing node state and utilities within a node component
useFlowContext#
useFlowNode#
useMemo#
usePlotColors#
usePluginAppBar#
usePluginContext#
useReducer#
useRef#
useSaveLoad#
useSaveLoadButtons#
useSharedPluginState#
useState#
Icons#
JsxRuntime#
const JsxRuntime: {
Fragment: React.ExoticComponent<{
children?: React.ReactNode;
}>;
jsx: typeof jsx;
jsxs: typeof jsxs;
};
Type Declaration#
Fragment#
jsx#
jsxs#
MUI#
Nodes#
const Nodes: {
register: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
registerProcessorNodes: (nodes, category?, categoryColor?, categoryIcon?) => void;
registerSequenceNodes: (nodes, category?, categoryColor?, categoryIcon?) => void;
};
Type Declaration#
register#
Generic node registration - for custom node sets
Parameters#
| Parameter | Type |
|---|---|
nodeSetName |
string |
nodes |
Record<string, FlowNodeDefinition> |
category? |
string |
categoryColor? |
string |
categoryIcon? |
SvgIconComponent |
pluginId? |
string |
Returns#
void
registerProcessorNodes#
Register postprocessing nodes - auto-injects pluginId when called via plugin bundle loader
Parameters#
| Parameter | Type |
|---|---|
nodes |
Record<string, FlowNodeDefinition> |
category? |
string |
categoryColor? |
string |
categoryIcon? |
SvgIconComponent |
Returns#
void
Example#
const { registerProcessorNodes } = window.Nuclei.Nodes
registerProcessorNodes({ custom_filter: {...} }, 'custom', '#9C27B0')
registerSequenceNodes#
Register sequence nodes - auto-injects pluginId when called via plugin bundle loader
Parameters#
| Parameter | Type |
|---|---|
nodes |
Record<string, FlowNodeDefinition> |
category? |
string |
categoryColor? |
string |
categoryIcon? |
SvgIconComponent |
Returns#
void
Example#
const { registerSequenceNodes } = window.Nuclei.Nodes
registerSequenceNodes({ dummy_delay: {...} }, 'custom', '#FF5722')
Notify#
const Notify: {
error: (message, details?) => void;
info: (message, details?) => void;
notify: (input) => void;
success: (message, details?) => void;
warning: (message, details?) => void;
};
Raise a notification: a toast, and a durable entry in the notification centre.
This is how a plugin reports a failure to the user. console.error reaches
nobody outside devtools. Errors get a longer toast window than the rest and
put their details (a stack trace, a backend message) behind the entry's
Details disclosure rather than in the toast copy.
Type Declaration#
error#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
info#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
notify#
Full form — severity, duration, details and an action button.
Parameters#
| Parameter | Type |
|---|---|
input |
NotificationInput |
Returns#
void
success#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
warning#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
NucleiJsCommon#
const NucleiJsCommon: {
api: {
auth: typeof NjcApiAuth;
index: typeof NjcApiIndex;
nmrdb: typeof NjcApiIndex.nmrdb;
pubchem: typeof NjcApiIndex.pubchem;
tqt_api: typeof NjcApiIndex.tqt_api;
types: typeof NjcApiIndex.types;
};
hooks: {
auth: typeof NjcHooksAuth;
index: typeof NjcHooksIndex;
plots: typeof NjcHooksIndex.plots;
smilesUtils: typeof NjcHooksIndex.smilesUtils;
useDatabaseViewer: typeof NjcHooksIndex.useDatabaseViewer;
useMobile: typeof NjcHooksUseMobile;
};
store: {
index: typeof NjcStoreIndex;
};
};
Type Declaration#
api#
api: {
auth: typeof NjcApiAuth;
index: typeof NjcApiIndex;
nmrdb: typeof NjcApiIndex.nmrdb;
pubchem: typeof NjcApiIndex.pubchem;
tqt_api: typeof NjcApiIndex.tqt_api;
types: typeof NjcApiIndex.types;
};
api.auth#
api.index#
api.nmrdb#
api.pubchem#
api.tqt_api#
api.types#
hooks#
hooks: {
auth: typeof NjcHooksAuth;
index: typeof NjcHooksIndex;
plots: typeof NjcHooksIndex.plots;
smilesUtils: typeof NjcHooksIndex.smilesUtils;
useDatabaseViewer: typeof NjcHooksIndex.useDatabaseViewer;
useMobile: typeof NjcHooksUseMobile;
};
hooks.auth#
hooks.index#
hooks.plots#
hooks.smilesUtils#
hooks.useDatabaseViewer#
hooks.useMobile#
store#
store.index#
Plot#
Names the generated stubs re-export from this module.
A plugin's import { Plot } from '@tqt-llc/nuclei-stubs' is rewritten to a
property read off window.NucleiPluginAPI, so the import resolves only when
the name is both declared here (for the compiler) and a property of
PluginAPI (for the runtime). Every name below satisfies both — Hooks and
Utils are spread into PluginAPI, so their members count.
PlotActions#
Type Declaration#
registerButton#
Parameters#
| Parameter | Type |
|---|---|
def |
PlotActionButtonDef |
Returns#
void
unregisterButton#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
PlotColors#
const PlotColors: {
getPlotColors: typeof getPlotColors;
seriesColor: typeof seriesColor;
seriesColorAlpha: typeof seriesColorAlpha;
themedPlotlyLayout: typeof themedPlotlyLayout;
usePlotColors: typeof usePlotColors;
};
The active theme's plot palette, resolved from the same CSS custom properties the rest of the app paints from.
A chart that hardcodes a dark palette disappears on a light theme. Use
usePlotColors() inside a React component so the chart re-renders when the
theme changes, and getPlotColors() from imperative code.
Type Declaration#
getPlotColors#
seriesColor#
Nth categorical series color, wrapping around the palette.
seriesColorAlpha#
Same as seriesColor, tinted to alpha.
themedPlotlyLayout#
Plotly layout fragment carrying the theme's chrome. Merge last.
usePlotColors#
PluginAPI#
const PluginAPI: {
__internal_addBackendHandler: (channel, handler) => void;
__internal_removeBackendHandler: (channel) => void;
AceEditor: typeof AceEditor;
AppBarButton: typeof AppBarButton;
AppBarButtonBlue: any;
AppBarButtonGreen: any;
AppBarButtonRed: any;
BaseAppBar: typeof BaseAppBar;
callBackend: <T>(pluginId, method, payload?) => Promise<T>;
CollapsibleSidebar: typeof CollapsibleSidebar;
Commands: {
execute: (id) => Promise<boolean>;
register: (def, pluginId?) => void;
unregister: (id) => void;
};
CompactFormControl: any;
createElement: typeof React.createElement;
DragNumberInput: typeof DragNumberInput;
EntityBrowser: {
Dialog: typeof EntityBrowser;
registerEntityType: (entityType, handler) => void;
unregisterEntityType: (entityType) => void;
};
Flow: {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
PasswordField: typeof PasswordField;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
SuggestedTextField: typeof SuggestedTextField;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
forwardRef: typeof React.forwardRef;
Fragment: React.ExoticComponent<{
children?: React.ReactNode;
}>;
Generator: {
NoiseConfig: typeof NoiseConfig;
PhaseShiftConfig: typeof PhaseShiftConfig;
PreviewPlots: typeof PreviewPlots;
};
getFrequencyUnitLabel: typeof getFrequencyUnitLabel;
GlobalComponents: {
register: (def) => void;
unregister: (id) => void;
};
Icons: typeof MaterialIcons;
jsx: typeof jsx;
jsxs: typeof jsxs;
KetcherEditor: typeof KetcherEditor;
lazy: typeof React.lazy;
memo: typeof React.memo;
MonacoEditorWrapper: typeof MonacoEditorWrapper;
MUI: typeof MaterialUI;
Nodes: {
register: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
registerProcessorNodes: (nodes, category?, categoryColor?, categoryIcon?) => void;
registerSequenceNodes: (nodes, category?, categoryColor?, categoryIcon?) => void;
};
Notify: {
error: (message, details?) => void;
info: (message, details?) => void;
notify: (input) => void;
success: (message, details?) => void;
warning: (message, details?) => void;
};
NumberInput: typeof NumberInput;
Page: typeof Page;
PasswordField: typeof PasswordField;
Plot: React.ForwardRefExoticComponent<PlotProps & React.RefAttributes<any>>;
PlotActions: {
registerButton: (def) => void;
unregisterButton: (id) => void;
};
PlotColors: {
getPlotColors: typeof getPlotColors;
seriesColor: typeof seriesColor;
seriesColorAlpha: typeof seriesColorAlpha;
themedPlotlyLayout: typeof themedPlotlyLayout;
usePlotColors: typeof usePlotColors;
};
PluginProvider: typeof PluginProvider;
React: typeof React;
registerPluginTranslations: typeof registerPluginTranslations;
Reports: {
registerSection: (def, pluginId?) => void;
unregisterSection: (id) => void;
};
RequireCapability: typeof RequireCapability;
SequenceVisualization: {
Action: typeof Action;
Channels: {
BLANKING: "blanking";
GRAD_X: "grad_x";
GRAD_Y: "grad_y";
GRAD_Z: "grad_z";
LO: "lo";
PHASE: "phase";
RX: "rx";
TX1: "tx1";
TX2: "tx2";
};
registerNodeVisualization: (nodeType, handler) => void;
unregisterNodeVisualization: (nodeType) => void;
};
Settings: {
registerPanel: (def) => void;
unregisterPanel: (id) => void;
};
SettingsForm: typeof SettingsForm;
StandardPageAppBar: typeof StandardPageAppBar;
StatusBar: {
registerItem: (def) => void;
unregisterItem: (id) => void;
};
SuggestedTextField: typeof SuggestedTextField;
Suspense: React.ExoticComponent<React.SuspenseProps>;
Theming: {
getActiveThemeId: () => string;
getResolvedBase: () => "light" | "dark";
registerTheme: (def, pluginId?) => boolean;
unregisterTheme: (id) => boolean;
};
TuneOperations: {
register: (def) => void;
unregister: (id) => void;
};
UI: {
AppBarRunButton: typeof AppBarRunButton;
ButtonWithHint: typeof ButtonWithHint;
CodeInput: typeof CodeInput;
CollapsiblePanel: typeof CollapsiblePanel;
CollapsibleSidebar: typeof CollapsibleSidebar;
CompactFormControl: any;
ConfirmDialog: typeof ConfirmDialog;
DragNumberInput: typeof DragNumberInput;
EmptyState: typeof EmptyState;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
HtmlTooltip: typeof HtmlTooltipComponent;
LoadingBlock: typeof LoadingBlock;
NumberInput: typeof NumberInput;
PageActionsBar: typeof PageActionsBar;
PageContent: typeof PageContent;
PageSkeleton: typeof PageSkeleton;
SectionHeader: typeof SectionHeader;
SilentErrorBoundary: typeof SilentErrorBoundary;
SkeletonList: typeof SkeletonList;
Spinner: typeof Spinner;
StatusChip: typeof StatusChip;
StatusDot: typeof StatusDot;
statusTokens: typeof statusTokens;
statusToToken: typeof statusToToken;
StyledDialog: typeof StyledDialog;
TabPanel: typeof TabPanel;
TabsHeader: typeof TabsHeader;
WarningInfo: typeof WarningInfo;
};
useCallback: typeof React.useCallback;
useContext: typeof React.useContext;
useDeviceCapabilities: typeof useDeviceCapabilities;
useEffect: typeof React.useEffect;
useEntityButtons: typeof useEntityButtons;
useFlowAPI: () => {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
useMemo: typeof React.useMemo;
usePlotColors: typeof usePlotColors;
usePluginAppBar: typeof usePluginAppBar;
usePluginContext: typeof usePluginContext;
usePluginTranslation: typeof usePluginTranslation;
useReducer: typeof React.useReducer;
useRef: typeof React.useRef;
useSaveLoad: typeof useSaveLoad;
useSaveLoadButtons: typeof useSaveLoadButtons;
useSharedPluginState: typeof useSharedPluginState;
useState: typeof React.useState;
Visualization: {
createI18nMetadata: (i18nNamespace, i18nKey, appliesTo) => {
appliesTo: (trace) => boolean;
description: any;
displayName: any;
};
getHandler: (id) => VisualizationHandler;
getHandlerIds: () => string[];
hasHandler: (id) => boolean;
registerHandler: (id, handler, metadata?) => void;
unregisterHandler: (id) => void;
};
};
Type Declaration#
__internal_addBackendHandler#
Parameters#
| Parameter | Type |
|---|---|
channel |
string |
handler |
(data) => void |
Returns#
void
__internal_removeBackendHandler#
Parameters#
| Parameter | Type |
|---|---|
channel |
string |
Returns#
void
AceEditor#
AppBarButton#
AppBarButtonBlue#
AppBarButtonGreen#
AppBarButtonRed#
BaseAppBar#
callBackend#
Call a plugin backend method imperatively (no React context needed). Use at module scope during bundle load for early initialization. The bundle loader overrides this with pluginId pre-bound.
Type Parameters#
| Type Parameter | Default type |
|---|---|
T |
unknown |
Parameters#
| Parameter | Type |
|---|---|
pluginId |
string |
method |
string |
payload? |
unknown |
Returns#
Promise<T>
CollapsibleSidebar#
Commands#
Commands: {
execute: (id) => Promise<boolean>;
register: (def, pluginId?) => void;
unregister: (id) => void;
};
Commands.execute#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
Promise<boolean>
Commands.register#
Parameters#
| Parameter | Type |
|---|---|
def |
CommandDef |
pluginId? |
string |
Returns#
void
Commands.unregister#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
CompactFormControl#
createElement#
DragNumberInput#
EntityBrowser#
EntityBrowser: {
Dialog: typeof EntityBrowser;
registerEntityType: (entityType, handler) => void;
unregisterEntityType: (entityType) => void;
};
EntityBrowser.Dialog#
EntityBrowser dialog component Plugins can render this to show the entity browser
EntityBrowser.registerEntityType#
Register a custom entity type for the entity browser
Parameters#
| Parameter | Type | Description |
|---|---|---|
entityType |
string |
Unique identifier (e.g., 'plugin:custom-page') |
handler |
EntityTypeHandler |
Entity type handler with fetch/preview functions |
Returns#
void
EntityBrowser.unregisterEntityType#
Unregister an entity type
Parameters#
| Parameter | Type |
|---|---|
entityType |
string |
Returns#
void
Flow#
Flow: {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
PasswordField: typeof PasswordField;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
SuggestedTextField: typeof SuggestedTextField;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
Flow.buildNodeFromParams#
Build a node definition from parameter metadata. Auto-generates the component with inline inputs.
Flow.CompactFormControl#
Flow.createFlowConfiguration#
Helper functions for creating Flow configurations and nodesets
Flow.createFlowNodeSet#
Flow.DragNumberInput#
UI components for inline node inputs
Flow.FlowCanvas#
Flow.FlowNodeWrapper#
Flow node wrapper component for building custom nodes
Flow.FlowProvider#
Flow editor components for building custom workflow editors
Flow.FlowSelect#
Flow.FlowSidebar#
Flow.getRegistry#
Get the flow registry instance
Returns#
Flow.PasswordField#
Flow.registerNodes#
Register custom nodes to an existing node set (e.g., 'sequence') NOTE: This will be replaced per-plugin with a version that auto-injects pluginId
Parameters#
| Parameter | Type | Description |
|---|---|---|
nodeSetName |
string |
Name of the node set (e.g., 'sequence', 'processor') |
nodes |
Record<string, FlowNodeDefinition> |
Object mapping node types to their definitions |
category? |
string |
Optional category name for grouping |
categoryColor? |
string |
Optional hex color for the category |
categoryIcon? |
SvgIconComponent |
Optional Material-UI icon component |
pluginId? |
string |
- |
Returns#
void
Flow.SuggestedTextField#
Flow.useFlow#
Flow.useFlowContext#
Hook for accessing flow context (rerun, configuration, etc.)
Flow.useFlowNode#
Hook for accessing node state and utilities within a node component
FlowNodeWrapper#
FlowSelect#
forwardRef#
Fragment#
Generator#
Generator: {
NoiseConfig: typeof NoiseConfig;
PhaseShiftConfig: typeof PhaseShiftConfig;
PreviewPlots: typeof PreviewPlots;
};
Generator.NoiseConfig#
Generator.PhaseShiftConfig#
Generator.PreviewPlots#
getFrequencyUnitLabel#
GlobalComponents#
GlobalComponents.register#
Parameters#
| Parameter | Type |
|---|---|
def |
GlobalComponentDef |
Returns#
void
GlobalComponents.unregister#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
Icons#
jsx#
jsxs#
KetcherEditor#
lazy#
memo#
MonacoEditorWrapper#
MUI#
Nodes#
Nodes: {
register: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
registerProcessorNodes: (nodes, category?, categoryColor?, categoryIcon?) => void;
registerSequenceNodes: (nodes, category?, categoryColor?, categoryIcon?) => void;
};
Nodes.register#
Generic node registration - for custom node sets
Parameters#
| Parameter | Type |
|---|---|
nodeSetName |
string |
nodes |
Record<string, FlowNodeDefinition> |
category? |
string |
categoryColor? |
string |
categoryIcon? |
SvgIconComponent |
pluginId? |
string |
Returns#
void
Nodes.registerProcessorNodes#
Register postprocessing nodes - auto-injects pluginId when called via plugin bundle loader
Parameters#
| Parameter | Type |
|---|---|
nodes |
Record<string, FlowNodeDefinition> |
category? |
string |
categoryColor? |
string |
categoryIcon? |
SvgIconComponent |
Returns#
void
Example#
const { registerProcessorNodes } = window.Nuclei.Nodes
registerProcessorNodes({ custom_filter: {...} }, 'custom', '#9C27B0')
Nodes.registerSequenceNodes#
Register sequence nodes - auto-injects pluginId when called via plugin bundle loader
Parameters#
| Parameter | Type |
|---|---|
nodes |
Record<string, FlowNodeDefinition> |
category? |
string |
categoryColor? |
string |
categoryIcon? |
SvgIconComponent |
Returns#
void
Example#
const { registerSequenceNodes } = window.Nuclei.Nodes
registerSequenceNodes({ dummy_delay: {...} }, 'custom', '#FF5722')
Notify#
Notify: {
error: (message, details?) => void;
info: (message, details?) => void;
notify: (input) => void;
success: (message, details?) => void;
warning: (message, details?) => void;
};
Notify.error#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
Notify.info#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
Notify.notify#
Full form — severity, duration, details and an action button.
Parameters#
| Parameter | Type |
|---|---|
input |
NotificationInput |
Returns#
void
Notify.success#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
Notify.warning#
Parameters#
| Parameter | Type |
|---|---|
message |
string |
details? |
string |
Returns#
void
NumberInput#
Page#
PasswordField#
Plot#
PlotActions#
PlotActions.registerButton#
Parameters#
| Parameter | Type |
|---|---|
def |
PlotActionButtonDef |
Returns#
void
PlotActions.unregisterButton#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
PlotColors#
PlotColors: {
getPlotColors: typeof getPlotColors;
seriesColor: typeof seriesColor;
seriesColorAlpha: typeof seriesColorAlpha;
themedPlotlyLayout: typeof themedPlotlyLayout;
usePlotColors: typeof usePlotColors;
};
PlotColors.getPlotColors#
PlotColors.seriesColor#
Nth categorical series color, wrapping around the palette.
PlotColors.seriesColorAlpha#
Same as seriesColor, tinted to alpha.
PlotColors.themedPlotlyLayout#
Plotly layout fragment carrying the theme's chrome. Merge last.
PlotColors.usePlotColors#
PluginProvider#
React#
registerPluginTranslations#
Reports#
Reports.registerSection#
Parameters#
| Parameter | Type |
|---|---|
def |
ReportSectionDef |
pluginId? |
string |
Returns#
void
Reports.unregisterSection#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
RequireCapability#
SequenceVisualization#
SequenceVisualization: {
Action: typeof Action;
Channels: {
BLANKING: "blanking";
GRAD_X: "grad_x";
GRAD_Y: "grad_y";
GRAD_Z: "grad_z";
LO: "lo";
PHASE: "phase";
RX: "rx";
TX1: "tx1";
TX2: "tx2";
};
registerNodeVisualization: (nodeType, handler) => void;
unregisterNodeVisualization: (nodeType) => void;
};
SequenceVisualization.Action#
Action enum for constructing Commands
SequenceVisualization.Channels#
Channels: {
BLANKING: "blanking";
GRAD_X: "grad_x";
GRAD_Y: "grad_y";
GRAD_Z: "grad_z";
LO: "lo";
PHASE: "phase";
RX: "rx";
TX1: "tx1";
TX2: "tx2";
};
Channel identifiers for multi-channel visualization
SequenceVisualization.Channels.BLANKING#
SequenceVisualization.Channels.GRAD_X#
SequenceVisualization.Channels.GRAD_Y#
SequenceVisualization.Channels.GRAD_Z#
SequenceVisualization.Channels.LO#
SequenceVisualization.Channels.PHASE#
SequenceVisualization.Channels.RX#
SequenceVisualization.Channels.TX1#
SequenceVisualization.Channels.TX2#
SequenceVisualization.registerNodeVisualization#
Register a visualization handler for a custom sequence node type. The handler converts node data into Commands for the timing diagram.
Parameters#
| Parameter | Type | Description |
|---|---|---|
nodeType |
string |
Node type identifier (e.g., 'my_app_name') |
handler |
SequenceNodeVizHandler |
Function returning Command[] for the timing diagram |
Returns#
void
Example#
SequenceVisualization.registerNodeVisualization('Basic1D', (node) => [
{ action: SequenceVisualization.Action.Pulse_90, duration: 1000 },
{ action: SequenceVisualization.Action.ADC, duration: 5000 }
])
SequenceVisualization.unregisterNodeVisualization#
Parameters#
| Parameter | Type |
|---|---|
nodeType |
string |
Returns#
void
Settings#
Settings.registerPanel#
Parameters#
| Parameter | Type |
|---|---|
def |
SettingsPanelDef |
Returns#
void
Settings.unregisterPanel#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
SettingsForm#
StandardPageAppBar#
StatusBar#
StatusBar.registerItem#
Parameters#
| Parameter | Type |
|---|---|
def |
StatusBarItemDef |
Returns#
void
StatusBar.unregisterItem#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
SuggestedTextField#
Suspense#
Theming#
Theming: {
getActiveThemeId: () => string;
getResolvedBase: () => "light" | "dark";
registerTheme: (def, pluginId?) => boolean;
unregisterTheme: (id) => boolean;
};
Theming.getActiveThemeId#
The theme id currently applied (never 'system').
Returns#
string
Theming.getResolvedBase#
Whether the active theme is light or dark — use this to pick assets.
Returns#
"light" | "dark"
Theming.registerTheme#
Parameters#
| Parameter | Type |
|---|---|
def |
ThemeDefinition |
pluginId? |
string |
Returns#
boolean
Theming.unregisterTheme#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
boolean
TuneOperations#
TuneOperations.register#
Parameters#
| Parameter | Type |
|---|---|
def |
TuneOperationDef |
Returns#
void
TuneOperations.unregister#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
UI#
UI: {
AppBarRunButton: typeof AppBarRunButton;
ButtonWithHint: typeof ButtonWithHint;
CodeInput: typeof CodeInput;
CollapsiblePanel: typeof CollapsiblePanel;
CollapsibleSidebar: typeof CollapsibleSidebar;
CompactFormControl: any;
ConfirmDialog: typeof ConfirmDialog;
DragNumberInput: typeof DragNumberInput;
EmptyState: typeof EmptyState;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
HtmlTooltip: typeof HtmlTooltipComponent;
LoadingBlock: typeof LoadingBlock;
NumberInput: typeof NumberInput;
PageActionsBar: typeof PageActionsBar;
PageContent: typeof PageContent;
PageSkeleton: typeof PageSkeleton;
SectionHeader: typeof SectionHeader;
SilentErrorBoundary: typeof SilentErrorBoundary;
SkeletonList: typeof SkeletonList;
Spinner: typeof Spinner;
StatusChip: typeof StatusChip;
StatusDot: typeof StatusDot;
statusTokens: typeof statusTokens;
statusToToken: typeof statusToToken;
StyledDialog: typeof StyledDialog;
TabPanel: typeof TabPanel;
TabsHeader: typeof TabsHeader;
WarningInfo: typeof WarningInfo;
};
UI.AppBarRunButton#
UI.ButtonWithHint#
UI.CodeInput#
Monospace single-line input for identifiers and expressions.
UI.CollapsiblePanel#
Collapsible section and sidebar containers.
UI.CollapsibleSidebar#
UI.CompactFormControl#
Compact form controls for inline node inputs.
UI.ConfirmDialog#
Confirm-or-cancel dialog with the destructive-action styling.
UI.DragNumberInput#
UI.EmptyState#
"Nothing here" surface. Render only once loading has finished.
UI.FlowSelect#
UI.HtmlTooltip#
Rich-content tooltip.
UI.LoadingBlock#
UI.NumberInput#
Numeric inputs, also available at the top level of the API.
UI.PageActionsBar#
Action row for a page header, plus the buttons it is built from.
UI.PageContent#
Page body wrapper carrying the standard padding and scroll behaviour.
UI.PageSkeleton#
Loading placeholder for a whole page body.
UI.SectionHeader#
Titled divider for a group of settings or a panel section.
UI.SilentErrorBoundary#
Error boundary that swallows a subtree's crash without a visible dialog. Wrap optional decorations so a plugin bug cannot take the page down.
UI.SkeletonList#
Loading placeholder for a list. The counterpart to EmptyState.
UI.Spinner#
Spinner, and a centred spinner-with-message block.
UI.StatusChip#
Status pill driven by the shared tone vocabulary.
UI.StatusDot#
Just the coloured dot, for dense rows and table cells.
UI.statusTokens#
Background/foreground/border tokens for a StatusTone.
UI.statusToToken#
Map a raw backend status word onto a StatusTone.
UI.StyledDialog#
The app's dialog shell — use it for any custom dialog body.
UI.TabPanel#
UI.TabsHeader#
Tab strip and the panel it switches between.
UI.WarningInfo#
Inline warning strip.
useCallback#
useContext#
useDeviceCapabilities#
useEffect#
useEntityButtons#
useFlowAPI#
useFlowAPI: () => {
buildNodeFromParams: typeof buildNodeFromParams;
CompactFormControl: any;
createFlowConfiguration: typeof createFlowConfiguration;
createFlowNodeSet: typeof createFlowNodeSet;
DragNumberInput: typeof DragNumberInput;
FlowCanvas: typeof FlowCanvas;
FlowNodeWrapper: typeof FlowNodeWrapper;
FlowProvider: typeof FlowProvider;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
FlowSidebar: typeof FlowSidebar;
getRegistry: () => FlowRegistry;
registerNodes: (nodeSetName, nodes, category?, categoryColor?, categoryIcon?, pluginId?) => void;
useFlow: typeof useFlow;
useFlowContext: typeof useFlowContext;
useFlowNode: typeof useFlowNode;
};
Returns#
buildNodeFromParams#
Build a node definition from parameter metadata. Auto-generates the component with inline inputs.
CompactFormControl#
createFlowConfiguration#
Helper functions for creating Flow configurations and nodesets
createFlowNodeSet#
DragNumberInput#
UI components for inline node inputs
FlowCanvas#
FlowNodeWrapper#
Flow node wrapper component for building custom nodes
FlowProvider#
Flow editor components for building custom workflow editors
FlowSelect#
FlowSidebar#
getRegistry#
Get the flow registry instance
Returns#
registerNodes#
Register custom nodes to an existing node set (e.g., 'sequence') NOTE: This will be replaced per-plugin with a version that auto-injects pluginId
Parameters#
| Parameter | Type | Description |
|---|---|---|
nodeSetName |
string |
Name of the node set (e.g., 'sequence', 'processor') |
nodes |
Record<string, FlowNodeDefinition> |
Object mapping node types to their definitions |
category? |
string |
Optional category name for grouping |
categoryColor? |
string |
Optional hex color for the category |
categoryIcon? |
SvgIconComponent |
Optional Material-UI icon component |
pluginId? |
string |
- |
Returns#
void
useFlow#
useFlowContext#
Hook for accessing flow context (rerun, configuration, etc.)
useFlowNode#
Hook for accessing node state and utilities within a node component
useFlowContext#
useFlowNode#
useMemo#
usePlotColors#
usePluginAppBar#
usePluginContext#
usePluginTranslation#
useReducer#
useRef#
useSaveLoad#
useSaveLoadButtons#
useSharedPluginState#
useState#
Visualization#
Visualization: {
createI18nMetadata: (i18nNamespace, i18nKey, appliesTo) => {
appliesTo: (trace) => boolean;
description: any;
displayName: any;
};
getHandler: (id) => VisualizationHandler;
getHandlerIds: () => string[];
hasHandler: (id) => boolean;
registerHandler: (id, handler, metadata?) => void;
unregisterHandler: (id) => void;
};
Visualization.createI18nMetadata#
createI18nMetadata: (i18nNamespace, i18nKey, appliesTo) => {
appliesTo: (trace) => boolean;
description: any;
displayName: any;
};
Helper to create i18n-aware handler metadata. Use this to support multiple languages in your visualization handler titles and descriptions. Uses lazy translation to ensure plugin translations work even if loaded after app startup.
Parameters#
| Parameter | Type | Description |
|---|---|---|
i18nNamespace |
string |
The i18n namespace where your translations live (e.g., 'plugin:my-plugin') |
i18nKey |
string |
The key prefix for this handler in your namespace (e.g., 'cosy') |
appliesTo |
(trace) => boolean |
Predicate to determine if handler applies to a trace |
Returns#
Metadata object with lazy-loaded displayName and description from i18n
appliesTo#
Parameters#
| Parameter | Type |
|---|---|
trace |
any |
Returns#
boolean
description#
displayName#
Example#
// 1. Register your plugin translations first:
NucleiPluginAPI.Hooks.usePluginTranslation().registerPluginTranslations('my-plugin', {
en: { "cosy": { "title": "COSY 2D", "description": "Correlation spectroscopy" } },
ru: { "cosy": { "title": "COSY 2D", "description": "Спектроскопия корреляции" } }
})
// 2. Then register your handler with metadata:
const metadata = Visualization.createI18nMetadata(
'plugin:my-plugin',
'cosy',
(trace) => !!trace.spectrum?.s2d
)
Visualization.registerHandler('my-plugin:cosy', handler, metadata)
Visualization.getHandler#
Get a handler by ID
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
Visualization.getHandlerIds#
Get all registered handler IDs
Returns#
string[]
Visualization.hasHandler#
Check if a handler exists
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
boolean
Visualization.registerHandler#
Register a custom visualization handler for Trace data
Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
string |
Unique handler identifier (e.g., 'plugin:cosy_2d', 'plugin:custom_spectrum') |
handler |
VisualizationHandler |
Handler function that converts Trace to PlotlyJS spec |
metadata? |
VisualizationHandlerMetadata |
- |
Returns#
void
Example#
const { registerHandler } = window.Nuclei.Visualization
registerHandler('my-plugin:cosy', (trace) => ({
data: [{ z: trace.signal.s2d.amplitudes, type: 'heatmap' }],
layout: { title: 'COSY' }
}))
Visualization.unregisterHandler#
Unregister a visualization handler
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
ReactUtils#
const ReactUtils: {
createElement: typeof React.createElement;
forwardRef: typeof React.forwardRef;
Fragment: React.ExoticComponent<{
children?: React.ReactNode;
}>;
lazy: typeof React.lazy;
memo: typeof React.memo;
Suspense: React.ExoticComponent<React.SuspenseProps>;
};
Type Declaration#
createElement#
forwardRef#
Fragment#
lazy#
memo#
Suspense#
Reports#
Type Declaration#
registerSection#
Parameters#
| Parameter | Type |
|---|---|
def |
ReportSectionDef |
pluginId? |
string |
Returns#
void
unregisterSection#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
SequenceVisualization#
const SequenceVisualization: {
Action: typeof Action;
Channels: {
BLANKING: "blanking";
GRAD_X: "grad_x";
GRAD_Y: "grad_y";
GRAD_Z: "grad_z";
LO: "lo";
PHASE: "phase";
RX: "rx";
TX1: "tx1";
TX2: "tx2";
};
registerNodeVisualization: (nodeType, handler) => void;
unregisterNodeVisualization: (nodeType) => void;
};
Type Declaration#
Action#
Action enum for constructing Commands
Channels#
Channels: {
BLANKING: "blanking";
GRAD_X: "grad_x";
GRAD_Y: "grad_y";
GRAD_Z: "grad_z";
LO: "lo";
PHASE: "phase";
RX: "rx";
TX1: "tx1";
TX2: "tx2";
};
Channel identifiers for multi-channel visualization
Channels.BLANKING#
Channels.GRAD_X#
Channels.GRAD_Y#
Channels.GRAD_Z#
Channels.LO#
Channels.PHASE#
Channels.RX#
Channels.TX1#
Channels.TX2#
registerNodeVisualization#
Register a visualization handler for a custom sequence node type. The handler converts node data into Commands for the timing diagram.
Parameters#
| Parameter | Type | Description |
|---|---|---|
nodeType |
string |
Node type identifier (e.g., 'my_app_name') |
handler |
SequenceNodeVizHandler |
Function returning Command[] for the timing diagram |
Returns#
void
Example#
SequenceVisualization.registerNodeVisualization('Basic1D', (node) => [
{ action: SequenceVisualization.Action.Pulse_90, duration: 1000 },
{ action: SequenceVisualization.Action.ADC, duration: 5000 }
])
unregisterNodeVisualization#
Parameters#
| Parameter | Type |
|---|---|
nodeType |
string |
Returns#
void
Settings#
Type Declaration#
registerPanel#
Parameters#
| Parameter | Type |
|---|---|
def |
SettingsPanelDef |
Returns#
void
unregisterPanel#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
StatusBar#
Type Declaration#
registerItem#
Parameters#
| Parameter | Type |
|---|---|
def |
StatusBarItemDef |
Returns#
void
unregisterItem#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
Theming#
const Theming: {
getActiveThemeId: () => string;
getResolvedBase: () => "light" | "dark";
registerTheme: (def, pluginId?) => boolean;
unregisterTheme: (id) => boolean;
};
Theming ("skins") API for plugins.
A theme is declarative data, not code: allowlisted design tokens plus a controlled set of shape/typography/density knobs, plus an optional raw-CSS block that is sanitized and confined to a low-priority cascade layer.
tokens is SPARSE — declare base: 'light' | 'dark' and only override what
differs; everything else is inherited from that built-in.
Registration validates the whole theme and never throws: unknown tokens and disallowed CSS are dropped and reported (visible in Settings -> Appearance), and a foreground that would be illegible on its own background is reset to the base theme's value rather than the theme being rejected.
Returns true if the theme was registered. See styles/THEMING.md §4b.
Type Declaration#
getActiveThemeId#
The theme id currently applied (never 'system').
Returns#
string
getResolvedBase#
Whether the active theme is light or dark — use this to pick assets.
Returns#
"light" | "dark"
registerTheme#
Parameters#
| Parameter | Type |
|---|---|
def |
ThemeDefinition |
pluginId? |
string |
Returns#
boolean
unregisterTheme#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
boolean
TuneOperations#
Type Declaration#
register#
Parameters#
| Parameter | Type |
|---|---|
def |
TuneOperationDef |
Returns#
void
unregister#
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
UI#
const UI: {
AppBarRunButton: typeof AppBarRunButton;
ButtonWithHint: typeof ButtonWithHint;
CodeInput: typeof CodeInput;
CollapsiblePanel: typeof CollapsiblePanel;
CollapsibleSidebar: typeof CollapsibleSidebar;
CompactFormControl: any;
ConfirmDialog: typeof ConfirmDialog;
DragNumberInput: typeof DragNumberInput;
EmptyState: typeof EmptyState;
FlowSelect: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
HtmlTooltip: typeof HtmlTooltipComponent;
LoadingBlock: typeof LoadingBlock;
NumberInput: typeof NumberInput;
PageActionsBar: typeof PageActionsBar;
PageContent: typeof PageContent;
PageSkeleton: typeof PageSkeleton;
PasswordField: typeof PasswordField;
SectionHeader: typeof SectionHeader;
SilentErrorBoundary: typeof SilentErrorBoundary;
SkeletonList: typeof SkeletonList;
Spinner: typeof Spinner;
StatusChip: typeof StatusChip;
StatusDot: typeof StatusDot;
statusTokens: typeof statusTokens;
statusToToken: typeof statusToToken;
StyledDialog: typeof StyledDialog;
SuggestedTextField: typeof SuggestedTextField;
TabPanel: typeof TabPanel;
TabsHeader: typeof TabsHeader;
WarningInfo: typeof WarningInfo;
};
The shared UI vocabulary the host's own pages are built from.
Reach for these before hand-rolling an empty state, a status pill, a confirmation dialog or a loading placeholder: they already carry the app's spacing, tone mapping and design tokens, so a plugin using them tracks every theme — including plugin skins — without hardcoding a single color.
Type Declaration#
AppBarRunButton#
ButtonWithHint#
CodeInput#
Monospace single-line input for identifiers and expressions.
CollapsiblePanel#
Collapsible section and sidebar containers.
CollapsibleSidebar#
CompactFormControl#
Compact form controls for inline node inputs.
ConfirmDialog#
Confirm-or-cancel dialog with the destructive-action styling.
DragNumberInput#
EmptyState#
"Nothing here" surface. Render only once loading has finished.
FlowSelect#
HtmlTooltip#
Rich-content tooltip.
LoadingBlock#
NumberInput#
Numeric inputs, also available at the top level of the API.
PageActionsBar#
Action row for a page header, plus the buttons it is built from.
PageContent#
Page body wrapper carrying the standard padding and scroll behaviour.
PageSkeleton#
Loading placeholder for a whole page body.
PasswordField#
SectionHeader#
Titled divider for a group of settings or a panel section.
SilentErrorBoundary#
Error boundary that swallows a subtree's crash without a visible dialog. Wrap optional decorations so a plugin bug cannot take the page down.
SkeletonList#
Loading placeholder for a list. The counterpart to EmptyState.
Spinner#
Spinner, and a centred spinner-with-message block.
StatusChip#
Status pill driven by the shared tone vocabulary.
StatusDot#
Just the coloured dot, for dense rows and table cells.
statusTokens#
Background/foreground/border tokens for a StatusTone.
statusToToken#
Map a raw backend status word onto a StatusTone.
StyledDialog#
The app's dialog shell — use it for any custom dialog body.
SuggestedTextField#
TabPanel#
TabsHeader#
Tab strip and the panel it switches between.
WarningInfo#
Inline warning strip.
Utils#
Type Declaration#
getFrequencyUnitLabel#
Visualization#
const Visualization: {
createI18nMetadata: (i18nNamespace, i18nKey, appliesTo) => {
appliesTo: (trace) => boolean;
description: any;
displayName: any;
};
getHandler: (id) => VisualizationHandler;
getHandlerIds: () => string[];
hasHandler: (id) => boolean;
registerHandler: (id, handler, metadata?) => void;
unregisterHandler: (id) => void;
};
Type Declaration#
createI18nMetadata#
createI18nMetadata: (i18nNamespace, i18nKey, appliesTo) => {
appliesTo: (trace) => boolean;
description: any;
displayName: any;
};
Helper to create i18n-aware handler metadata. Use this to support multiple languages in your visualization handler titles and descriptions. Uses lazy translation to ensure plugin translations work even if loaded after app startup.
Parameters#
| Parameter | Type | Description |
|---|---|---|
i18nNamespace |
string |
The i18n namespace where your translations live (e.g., 'plugin:my-plugin') |
i18nKey |
string |
The key prefix for this handler in your namespace (e.g., 'cosy') |
appliesTo |
(trace) => boolean |
Predicate to determine if handler applies to a trace |
Returns#
Metadata object with lazy-loaded displayName and description from i18n
appliesTo#
Parameters#
| Parameter | Type |
|---|---|
trace |
any |
Returns#
boolean
description#
displayName#
Example#
// 1. Register your plugin translations first:
NucleiPluginAPI.Hooks.usePluginTranslation().registerPluginTranslations('my-plugin', {
en: { "cosy": { "title": "COSY 2D", "description": "Correlation spectroscopy" } },
ru: { "cosy": { "title": "COSY 2D", "description": "Спектроскопия корреляции" } }
})
// 2. Then register your handler with metadata:
const metadata = Visualization.createI18nMetadata(
'plugin:my-plugin',
'cosy',
(trace) => !!trace.spectrum?.s2d
)
Visualization.registerHandler('my-plugin:cosy', handler, metadata)
getHandler#
Get a handler by ID
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
getHandlerIds#
Get all registered handler IDs
Returns#
string[]
hasHandler#
Check if a handler exists
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
boolean
registerHandler#
Register a custom visualization handler for Trace data
Parameters#
| Parameter | Type | Description |
|---|---|---|
id |
string |
Unique handler identifier (e.g., 'plugin:cosy_2d', 'plugin:custom_spectrum') |
handler |
VisualizationHandler |
Handler function that converts Trace to PlotlyJS spec |
metadata? |
VisualizationHandlerMetadata |
- |
Returns#
void
Example#
const { registerHandler } = window.Nuclei.Visualization
registerHandler('my-plugin:cosy', (trace) => ({
data: [{ z: trace.signal.s2d.amplitudes, type: 'heatmap' }],
layout: { title: 'COSY' }
}))
unregisterHandler#
Unregister a visualization handler
Parameters#
| Parameter | Type |
|---|---|
id |
string |
Returns#
void
NodeParamDef#
Parameter descriptor for auto-generating node UI.
Properties#
default_value?#
label?#
max_val?#
min_val?#
name#
options?#
widget_type#
NotificationActionRef#
A notification action is a label plus a token, never a callback: the store
must stay serialisable. The callback lives in utils/notificationActions.ts
and is looked up by token when the button is pressed.
Properties#
label#
token#
Key into the notification-action registry.
NotificationInput#
Properties#
action?#
details?#
duration?#
Omit to use the severity default (persistent for errors).
message#
severity#
NotificationSeverity#
The notification vocabulary, in a module of its own.
These types are part of the plugin API surface (Notify in plugin-exports),
so they must survive declaration emit. store/runtime.ts cannot: its slice's
inferred type exceeds what the compiler will serialize, so no runtime.d.ts
reaches the plugin stubs and anything declared there is unreachable to a
plugin author. Declaring them here keeps the published types honest.
store/runtime.ts re-exports every name below, so both import paths work.
FlowNodeWrapper#
Re-exports FlowNodeWrapper
KetcherEditor#
Re-exports KetcherEditor
MultiSubplotVisualization#
Re-exports MultiSubplotVisualization
PlotThemeColors#
Re-exports PlotThemeColors
StatusTokens#
Re-exports StatusTokens
StatusTone#
Re-exports StatusTone
SuggestedTextField#
Re-exports SuggestedTextField
usePlotColors#
Re-exports usePlotColors
usePluginContext#
Re-exports usePluginContext
VisualizationHandler#
Re-exports VisualizationHandler
VisualizationSpec#
Re-exports VisualizationSpec