Essential enumeration types for the low-code engine shell system, providing type-safe constants for various engine operations.
Defines the types of context menu items that can be displayed in the editor.
/**
* Context menu item types
*/
enum IPublicEnumContextMenuType {
/** Menu separator */
SEPARATOR = 'separator',
/** Regular menu item */
MENU_ITEM = 'menuItem',
/** Node tree menu item */
NODE_TREE = 'nodeTree'
}Usage Examples:
import { IPublicEnumContextMenuType } from "@alilc/lowcode-types";
// Create context menu configuration
const contextMenuConfig = {
type: IPublicEnumContextMenuType.MENU_ITEM,
title: "Copy Component",
action: () => console.log("Copy component")
};
// Add separator
const separatorConfig = {
type: IPublicEnumContextMenuType.SEPARATOR
};Identifies the type of objects being dragged in the editor.
/**
* Drag object types for drag and drop operations
*/
enum IPublicEnumDragObjectType {
/** Dragging a node instance */
Node = 'node',
/** Dragging node data/schema */
NodeData = 'nodedata'
}Usage Examples:
import { IPublicEnumDragObjectType } from "@alilc/lowcode-types";
// Handle drag start event
function onDragStart(dragObject: any) {
if (dragObject.type === IPublicEnumDragObjectType.Node) {
console.log("Dragging a node instance");
} else if (dragObject.type === IPublicEnumDragObjectType.NodeData) {
console.log("Dragging node data");
}
}Enumeration for all public event names in the low-code engine system.
/**
* All public event names following namespace.modelName.whatHappened pattern
*/
enum IPublicEnumEventNames {
// Currently empty - event names are defined elsewhere
}Defines the registration levels for plugins in the engine hierarchy.
/**
* Plugin registration levels determining plugin scope and lifecycle
*/
enum IPublicEnumPluginRegisterLevel {
/** Default level plugin */
Default = 'default',
/** Workspace level plugin */
Workspace = 'workspace',
/** Resource level plugin */
Resource = 'resource',
/** Editor view level plugin */
EditorView = 'editorView'
}Usage Examples:
import { IPublicEnumPluginRegisterLevel } from "@alilc/lowcode-types";
// Register plugin at workspace level
function registerPlugin(plugin: any) {
return {
pluginName: "MyPlugin",
registerLevel: IPublicEnumPluginRegisterLevel.Workspace,
init: () => plugin.initialize()
};
}
// Check plugin level
function isWorkspacePlugin(level: IPublicEnumPluginRegisterLevel) {
return level === IPublicEnumPluginRegisterLevel.Workspace;
}Indicates the type of property value change that occurred.
/**
* Types of property value changes
*/
enum IPublicEnumPropValueChangedType {
/** Normal direct value assignment */
SET_VALUE = 'SET_VALUE',
/** Value changed due to sub-property modification */
SUB_VALUE_CHANGE = 'SUB_VALUE_CHANGE'
}Usage Examples:
import { IPublicEnumPropValueChangedType } from "@alilc/lowcode-types";
// Handle property change events
function onPropertyChanged(changeType: IPublicEnumPropValueChangedType, value: any) {
switch (changeType) {
case IPublicEnumPropValueChangedType.SET_VALUE:
console.log("Direct value change:", value);
break;
case IPublicEnumPropValueChangedType.SUB_VALUE_CHANGE:
console.log("Sub-property triggered change:", value);
break;
}
}Defines the different stages of component transformation in the engine.
/**
* Component transformation stages
*/
enum IPublicEnumTransformStage {
/** Rendering stage */
Render = 'render',
/** Serialization stage */
Serilize = 'serilize',
/** Save operation stage */
Save = 'save',
/** Clone operation stage */
Clone = 'clone',
/** Initialization stage */
Init = 'init',
/** Upgrade operation stage */
Upgrade = 'upgrade'
}Usage Examples:
import { IPublicEnumTransformStage } from "@alilc/lowcode-types";
// Apply transformations based on stage
function applyTransform(stage: IPublicEnumTransformStage, data: any) {
switch (stage) {
case IPublicEnumTransformStage.Render:
return renderTransform(data);
case IPublicEnumTransformStage.Save:
return saveTransform(data);
case IPublicEnumTransformStage.Clone:
return cloneTransform(data);
default:
return data;
}
}Defines the types of transitions that can occur in the editor.
/**
* Transition types for editor operations
*/
enum IPublicEnumTransitionType {
/** Node update followed by repaint processing */
REPAINT
}Usage Examples:
import { IPublicEnumTransitionType } from "@alilc/lowcode-types";
// Execute transition with specific type
function executeTransition(type: IPublicEnumTransitionType, operation: () => void) {
operation();
if (type === IPublicEnumTransitionType.REPAINT) {
// Trigger repaint after operation
requestRepaint();
}
}import {
IPublicEnumContextMenuType,
IPublicEnumDragObjectType,
IPublicEnumEventNames,
IPublicEnumPluginRegisterLevel,
IPublicEnumPropValueChangedType,
IPublicEnumTransformStage,
IPublicEnumTransitionType
} from "@alilc/lowcode-types";These enums provide type-safe constants for various engine operations, ensuring consistency and preventing errors in low-code engine development.