Files
bim_engine/dist/index.d.ts

1433 lines
38 KiB
TypeScript
Raw Normal View History

/**
* (BimButtonGroup)
*/
2025-12-22 15:39:58 +08:00
declare class BimButtonGroup implements IBimComponent {
private container;
private options;
private groups;
private activeBtnIds;
private btnRefs;
private dropdownElement;
private hoverTimeout;
private customColors;
private unsubscribeLocale;
private unsubscribeTheme;
2025-12-08 10:02:24 +08:00
protected engine: BimEngine | null;
private readonly DEFAULT_ICON;
constructor(options: ButtonGroupOptions);
2025-12-08 10:02:24 +08:00
setEngine(engine: BimEngine): void;
protected emit<K extends keyof EngineEvents>(event: K, payload: EngineEvents[K]): void;
private initContainer;
2025-12-16 11:57:44 +08:00
/**
2025-12-22 18:48:38 +08:00
* 3D
2025-12-16 11:57:44 +08:00
*/
private setupEventInterception;
private updatePosition;
/**
*
*/
private applyStyles;
2025-12-24 19:02:34 +08:00
/**
* primary颜色
*/
private setPrimaryColor;
/**
*
*
*/
setTheme(theme: ThemeConfig): void;
/**
*
* setTheme
*/
setColors(colors: ButtonGroupColors): void;
init(): Promise<void>;
setLocales(): void;
addGroup(groupId: string, beforeGroupId?: string): void;
addButton(config: ButtonConfig): void;
private findButton;
render(): void;
private renderGroup;
private renderButton;
2025-12-22 18:48:38 +08:00
/**
*
* @param id ID
* @param active (toggle)
*/
setBtnActive(id: string, active?: boolean): void;
private handleClick;
2025-12-24 19:02:34 +08:00
/**
* onClick
* @param button
*/
private deactivateExclusiveSiblings;
private handleMouseEnter;
private handleMouseLeave;
private showDropdown;
private renderDropdownItem;
private closeDropdown;
private updateButtonState;
private getIcon;
updateButtonVisibility(id: string, visible: boolean): void;
setShowLabel(show: boolean): void;
private updateLabelsVisibility;
private findButtonById;
setBackgroundColor(color: string): void;
private isVisible;
destroy(): void;
}
2025-12-08 10:02:24 +08:00
declare abstract class BimComponent {
protected engine: BimEngine;
constructor(engine: BimEngine);
/**
* Helper to send events easily
*/
protected emit<K extends keyof EngineEvents>(event: K, payload: EngineEvents[K]): void;
/**
* Helper to listen to events easily
* Returns an unsubscribe function
*/
protected on<K extends keyof EngineEvents>(event: K, listener: (payload: EngineEvents[K]) => void): () => void;
abstract destroy(): void;
}
/**
*
*
*/
declare class BimDialog implements IBimComponent {
private element;
private options;
private container;
private header;
private contentArea;
private _isDestroyed;
private _isInitialized;
private unsubscribeTheme;
private unsubscribeLocale;
2025-12-04 18:39:07 +08:00
private rafId;
/**
*
* @param options
*/
constructor(options: DialogOptions);
/**
*
* @param theme
*/
setTheme(theme: ThemeConfig): void;
/**
* ()
*/
init(): void;
setLocales(): void;
/**
* DOM
*/
private createDom;
/**
*
*/
private setSize;
2025-12-16 11:57:44 +08:00
/**
*
* @param recenter true
*/
fitWidth(recenter?: boolean): void;
2025-12-22 18:48:38 +08:00
/**
*
*
*
* - /Dialog
* -
*
* @param recenter options.position false
*/
fitHeight(recenter?: boolean): void;
/**
* left/top
* fitHeight / fitWidth
*/
private clampToContainer;
/**
*
*/
private initPosition;
/**
2025-12-04 18:39:07 +08:00
* ( + )
*/
private initDrag;
/**
2025-12-04 18:39:07 +08:00
* ( + )
*/
private initResize;
/**
*
* @param content HTML
*/
setContent(content: HTMLElement | string): void;
/**
*
*/
close(): void;
/**
* ()
*/
destroy(): void;
}
2025-12-08 10:02:24 +08:00
export declare class BimEngine extends EventEmitter {
2025-12-22 18:48:38 +08:00
container: HTMLElement;
private wrapper;
toolbar: ToolbarManager | null;
2025-12-16 11:57:44 +08:00
constructTreeBtn: ConstructTreeManagerBtn | null;
buttonGroup: ButtonGroupManager | null;
dialog: DialogManager | null;
2025-12-04 18:39:07 +08:00
engine: EngineManager | null;
2025-12-16 11:57:44 +08:00
rightKey: RightKeyManager | null;
2025-12-22 15:39:58 +08:00
propertyPanel: PropertyPanelManager | null;
2025-12-22 18:48:38 +08:00
measure: MeasureDialogManager | null;
2025-12-24 19:02:34 +08:00
sectionPlane: SectionPlaneDialogManager | null;
sectionAxis: SectionAxisDialogManager | null;
sectionBox: SectionBoxDialogManager | null;
2025-12-25 15:47:57 +08:00
walkControl: WalkControlManager | null;
map: MapDialogManager | null;
constructor(container: HTMLElement | string, options?: {
locale?: LocaleType;
theme?: ThemeType;
});
2025-12-08 10:02:24 +08:00
emit<K extends keyof EngineEvents>(event: K, payload: EngineEvents[K]): void;
on<K extends keyof EngineEvents>(event: K, listener: (payload: EngineEvents[K]) => void): () => void;
setLocale(locale: LocaleType): void;
getLocale(): LocaleType;
setTheme(theme: 'dark' | 'light'): void;
setCustomTheme(theme: ThemeConfig): void;
2025-12-03 12:00:46 +08:00
private init;
private updateTheme;
destroy(): void;
}
/**
2025-12-22 15:39:58 +08:00
*
*
*/
2025-12-22 15:39:58 +08:00
declare class BimTreeNode {
config: TreeNodeConfig;
element: HTMLElement;
2025-12-22 15:39:58 +08:00
children: BimTreeNode[];
parent: BimTreeNode | null;
checkState: TreeNodeCheckState;
private contentEl;
private switcherEl;
private checkboxEl;
private titleEl;
private actionsEl;
private childrenContainer;
private onExpandChange;
private onCheckChange;
private onNodeClick;
private renderActions?;
constructor(config: TreeNodeConfig, options: TreeOptions, callbacks: {
onExpand: (n: BimTreeNode) => void;
onCheck: (n: BimTreeNode) => void;
onClick: (n: BimTreeNode) => void;
});
/**
2025-12-22 15:39:58 +08:00
* DOM
*/
2025-12-22 15:39:58 +08:00
private createDom;
/**
2025-12-22 15:39:58 +08:00
* (Select )
*/
2025-12-22 15:39:58 +08:00
setSelected(selected: boolean): void;
/**
2025-12-22 15:39:58 +08:00
* () ->
*/
2025-12-22 15:39:58 +08:00
updateLabel(): void;
/**
2025-12-22 15:39:58 +08:00
*
*/
2025-12-22 15:39:58 +08:00
toggleExpand(force?: boolean): void;
/**
2025-12-22 15:39:58 +08:00
* ()
*/
2025-12-22 15:39:58 +08:00
toggleCheck(): void;
/**
2025-12-22 15:39:58 +08:00
* (API调用或联动)
* @param state
* @param fireEvent
*/
2025-12-22 15:39:58 +08:00
setChecked(state: TreeNodeCheckState, fireEvent?: boolean): void;
/**
2025-12-22 15:39:58 +08:00
* UI
*/
2025-12-22 15:39:58 +08:00
updateCheckboxUI(): void;
/**
2025-12-22 15:39:58 +08:00
*
*/
2025-12-22 15:39:58 +08:00
appendChild(childNode: BimTreeNode): void;
/**
2025-12-22 15:39:58 +08:00
*
*/
destroy(): void;
}
/** 按钮内部文字图标排列 */
declare type ButtonAlign = 'vertical' | 'horizontal';
/** 按钮配置 */
2025-12-22 15:39:58 +08:00
export declare interface ButtonConfig {
id: string;
type: ButtonType;
label: string;
icon?: string;
keepActive?: boolean;
2025-12-24 19:02:34 +08:00
/**
*
*
*
* - exclusive
* onClick
* - = groupId
* - = groupId parentId
*
* keepActive 使
*/
exclusive?: boolean;
2025-12-22 18:48:38 +08:00
isActive?: boolean;
disabled?: boolean;
onClick?: (button: OptButton) => void;
children?: ButtonConfig[];
groupId?: string;
parentId?: string;
/** 按钮内部图标文字排列 (默认 vertical即图标在上) */
align?: ButtonAlign;
/** 图标大小 (正方形,单位 px默认 32) */
iconSize?: number;
/** 按钮最小宽度 (单位 px默认 50) */
minWidth?: number;
}
declare interface ButtonGroupColors {
backgroundColor?: string;
btnBackgroundColor?: string;
btnHoverColor?: string;
btnActiveColor?: string;
iconColor?: string;
iconActiveColor?: string;
textColor?: string;
textActiveColor?: string;
}
/**
2025-12-08 10:02:24 +08:00
* (ButtonGroupManager)
*
*/
2025-12-08 10:02:24 +08:00
declare class ButtonGroupManager extends BimComponent {
private groups;
private container;
2025-12-08 10:02:24 +08:00
constructor(engine: BimEngine, container: HTMLElement);
create(id: string, options: Omit<ButtonGroupOptions, 'container'>): BimButtonGroup;
get(id: string): BimButtonGroup | undefined;
updateTheme(theme: ThemeConfig): void;
destroy(): void;
}
export declare interface ButtonGroupOptions extends ButtonGroupColors {
container: HTMLElement | string;
/** 屏幕位置 (如 top-left) */
position?: GroupPosition;
/** 按钮组排列方向 (默认 row) */
direction?: GroupDirection;
/** 按钮内部图标文字排列 (默认 vertical) */
align?: ButtonAlign;
/** 菜单展开方向 */
expand?: ExpandDirection;
showLabel?: boolean;
visibility?: Record<string, boolean>;
className?: string;
}
declare type ButtonType = 'button' | 'menu';
2025-12-25 15:47:57 +08:00
/**
*
*/
declare type CharacterModel = 'office-male' | 'construction-worker';
2025-12-22 15:39:58 +08:00
export declare interface CollapseItemConfig {
/** 唯一标识符 */
id: string;
/** 标题文本的翻译键 (例如 'panel.attributes') */
title: string;
/** 内容: HTML字符串 或 HTMLElement */
content: string | HTMLElement;
/** 标题栏左侧图标 (SVG 字符串, 可选) */
icon?: string;
/** 标题栏右侧额外内容 (可选) */
extra?: string | HTMLElement;
/** 是否禁用 */
disabled?: boolean;
/** 自定义类名 */
className?: string;
}
export declare interface CollapseOptions {
/** 挂载容器 */
container: HTMLElement | string;
/** 面板项列表 */
items: CollapseItemConfig[];
/** 是否开启手风琴模式 (默认 false) */
accordion?: boolean;
/** 初始展开的面板 ID 列表 */
activeIds?: string[];
/** 是否显示边框 (默认 true) */
bordered?: boolean;
/** 是否幽灵模式 (默认 false) */
ghost?: boolean;
/** 自定义类名 */
className?: string;
/** 切换面板时的回调 */
onChange?: (activeIds: string[]) => void;
}
2025-12-16 11:57:44 +08:00
/**
* (ToolbarManager)
*
*/
declare class ConstructTreeManagerBtn extends BimComponent {
private toolbar;
private toolbarContainer;
private container;
private dialog;
constructor(engine: BimEngine, container: HTMLElement);
private init;
openConstructTreeDialog(): void;
refresh(): void;
destroy(): void;
addGroup(groupId: string, beforeGroupId?: string): void;
addButton(config: ButtonConfig): void;
setButtonVisibility(id: string, v: boolean): void;
setShowLabel(show: boolean): void;
setVisible(visible: boolean): void;
setBackgroundColor(color: string): void;
setColors(colors: ButtonGroupColors): void;
}
/**
*
*/
export declare interface DescriptionItem {
/** 标签文本 (直接显示,组件内部不翻译) */
label: string;
/** 内容文本或元素 */
value: string | HTMLElement;
/** 行级自定义标签颜色 */
labelColor?: string;
/** 行级自定义内容颜色 */
valueColor?: string;
/** 自定义类名 */
className?: string;
}
/**
*
*/
export declare interface DescriptionOptions {
/** 挂载容器 */
container: HTMLElement | string;
/** 数据项列表 */
items: DescriptionItem[];
/**
* ( false)
* 线 Key-Value 线
*/
bordered?: boolean;
/** 标签固定宽度 (例如 '80px'),若不设置则自适应 */
labelWidth?: string;
/** 全局标签颜色 */
labelColor?: string;
/** 全局内容颜色 */
valueColor?: string;
/** 全局字体大小 */
fontSize?: string;
/** 标签内边距 (默认 '0 4px') */
labelPadding?: string;
/** 内容内边距 (默认 '0 4px') */
valuePadding?: string;
/** 自定义类名 */
className?: string;
}
/**
*
*/
declare interface DialogColors {
/** 窗体背景颜色,默认 rgba(17, 17, 17, 0.95) */
backgroundColor?: string;
/** 标题栏背景颜色,默认 #2a2a2a */
headerBackgroundColor?: string;
/** 标题文字颜色,默认 #fff */
titleColor?: string;
/** 内容文字颜色,默认 #ccc */
textColor?: string;
/** 边框颜色,默认 #444 */
borderColor?: string;
}
/**
*
*
*/
2025-12-08 10:02:24 +08:00
declare class DialogManager extends BimComponent {
/** 弹窗挂载的父容器 */
private container;
/** 活跃的弹窗实例列表 */
private activeDialogs;
/**
*
2025-12-08 10:02:24 +08:00
* @param engine
* @param container
*/
2025-12-08 10:02:24 +08:00
constructor(engine: BimEngine, container: HTMLElement);
/**
*
* @param options container使
* @returns BimDialog
*/
create(options: Omit<DialogOptions, 'container'>): BimDialog;
/**
*
*
*/
showInfoDialog(): void;
/**
*
* @param theme
*/
updateTheme(theme: ThemeConfig): void;
2025-12-08 10:02:24 +08:00
destroy(): void;
}
/**
*
*/
2025-12-22 15:39:58 +08:00
export declare interface DialogOptions extends DialogColors {
/** 弹窗挂载的父容器 */
container: HTMLElement;
/** 弹窗标题 */
title?: string;
/** 弹窗内容,支持 HTML 字符串或 HTMLElement */
content?: HTMLElement | string;
/** 弹窗宽度,数字(像素)或字符串(如 '50%' */
width?: number | string;
/** 弹窗高度 */
height?: number | string;
/** 弹窗位置 */
position?: DialogPosition;
/** 是否可拖拽 */
draggable?: boolean;
/** 是否可调整大小 */
resizable?: boolean;
/** 最小宽度限制 */
minWidth?: number;
/** 最小高度限制 */
minHeight?: number;
/** 关闭时的回调函数 */
onClose?: () => void;
/** 打开时的回调函数 */
onOpen?: () => void;
/** 弹窗唯一标识 ID (可选) */
id?: string;
}
/**
*
* 'center', 'top-left'
* { x, y }
*/
2025-12-22 15:39:58 +08:00
export declare type DialogPosition = 'center' | 'top-left' | 'top-center' | 'top-right' | 'left-center' | 'right-center' | 'bottom-left' | 'bottom-center' | 'bottom-right' | {
x: number;
y: number;
};
2025-12-22 15:39:58 +08:00
export declare interface EngineEvents {
2025-12-08 10:02:24 +08:00
'ui:open-dialog': {
id: string;
data?: any;
};
'ui:close-dialog': {
id: string;
};
'engine:model-loaded': {
url: string;
};
'engine:object-clicked': {
objectId: string;
position: {
x: number;
y: number;
z: number;
};
};
2025-12-16 11:57:44 +08:00
'ui:tree-node-check': {
id: string;
checked: boolean;
node: any;
};
'ui:tree-node-select': {
id: string;
selected: boolean;
node: any;
};
'ui:tree-node-expand': {
id: string;
expanded: boolean;
};
2025-12-22 15:39:58 +08:00
'ui:collapse-change': {
activeIds: string[];
};
2025-12-08 10:02:24 +08:00
'sys:theme-changed': {
theme: string;
};
'sys:locale-changed': {
locale: string;
};
2025-12-25 15:47:57 +08:00
'walk:path-mode-toggle': {
isActive: boolean;
};
'walk:walk-mode-toggle': {
isActive: boolean;
};
'walk:plan-view-toggle': {
isActive: boolean;
};
'walk:speed-change': {
speed: number;
};
'walk:gravity-toggle': {
enabled: boolean;
};
'walk:collision-toggle': {
enabled: boolean;
};
'map:opened': {};
'map:closed': {};
2025-12-08 10:02:24 +08:00
}
2025-12-04 18:39:07 +08:00
/**
* 3D
* Engine BimEngine API
* initialize()
*/
2025-12-08 10:02:24 +08:00
declare class EngineManager extends BimComponent {
2025-12-04 18:39:07 +08:00
/** 3D 引擎挂载的父容器 */
private container;
/** 3D 引擎组件实例 */
2025-12-08 10:02:24 +08:00
private engineInstance;
rightKey: RightKeyManager | null;
2025-12-04 18:39:07 +08:00
/**
*
2025-12-08 10:02:24 +08:00
* @param engine
2025-12-04 18:39:07 +08:00
* @param container 3D
*/
2025-12-08 10:02:24 +08:00
constructor(engine: BimEngine, container: HTMLElement);
2025-12-04 18:39:07 +08:00
/**
* 3D
* @param options 使
* @returns
*/
initialize(options?: Omit<EngineOptions, 'container'>): boolean;
/**
* <EFBFBD><EFBFBD><EFBFBD> 3D
2025-12-04 18:39:07 +08:00
*/
isInitialized(): boolean;
/**
* 3D
* @param url URL
* @param options
*/
loadModel(url: string, options?: ModelLoadOptions): void;
/**
* 3D
* API
*/
getEngine(): any;
/**
*
*/
CameraGoHome(): void;
/**
*
* @param mode
*/
activateMeasure(mode: MeasureMode): void;
/**
*
*/
deactivateMeasure(): void;
/**
*
*/
getCurrentMeasureType(): MeasureMode | null;
2025-12-04 18:39:07 +08:00
/**
* 3D
*/
destroy(): void;
}
/**
*
* Engine
*/
export declare interface EngineOptions {
/** 容器元素 */
container: HTMLElement;
/** 背景颜色(十六进制数字如 0x333333或 CSS 字符串如 'linear-gradient(...)' */
backgroundColor?: number | string;
2025-12-04 18:39:07 +08:00
/** WebGL 版本 */
version?: 'v1' | 'v2';
/** 是否显示性能统计 */
showStats?: boolean;
/** 是否显示视图立方体 */
showViewCube?: boolean;
}
2025-12-08 10:02:24 +08:00
declare class EventEmitter {
private events;
on(event: string, listener: Listener): () => void;
off(event: string, listener: Listener): void;
emit(event: string, payload?: any): void;
clear(): void;
}
/** 二级菜单展开方向 */
declare type ExpandDirection = 'up' | 'down' | 'left' | 'right';
/** 按钮组排列方向 (Flex-direction) */
declare type GroupDirection = 'row' | 'column';
/** 弹窗/按钮组位置 */
declare type GroupPosition = 'center' | 'top-left' | 'top-center' | 'top-right' | 'left-center' | 'right-center' | 'bottom-left' | 'bottom-center' | 'bottom-right' | {
x: number;
y: number;
} | 'static';
/**
* BIM
* UI
*/
2025-12-22 15:39:58 +08:00
export declare interface IBimComponent {
/**
*
* DOM
*
*/
init(): void | Promise<void>;
/**
*
* ThemeConfig CSS
*/
setTheme(theme: ThemeConfig): void;
/**
*
*/
setLocales(): void;
/**
*
* DOM
*/
destroy(): void;
}
2025-12-08 10:02:24 +08:00
declare type Listener<T = any> = (payload: T) => void;
/**
* <EFBFBD><EFBFBD>
*/
declare type LocaleType = 'zh-CN' | 'en-US';
2025-12-25 15:47:57 +08:00
/**
*
*/
declare class MapDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
*
*/
show(): void;
/**
*
*/
hide(): void;
/**
*
*/
isOpen(): boolean;
/**
*
*/
destroy(): void;
}
2025-12-23 11:31:16 +08:00
/**
* /
*/
declare interface MeasureConfig {
unit: MeasureUnit;
precision: MeasurePrecision;
}
2025-12-22 18:48:38 +08:00
/**
*
*/
declare class MeasureDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
2025-12-23 11:31:16 +08:00
/**
* /
* MeasurePanel Manager /
*/
private config;
2025-12-22 18:48:38 +08:00
constructor(engine: BimEngine);
init(): void;
/**
*
*/
show(): void;
/**
*
* null
*/
getActiveMode(): MeasureMode | null;
/**
*
* @param mode
*/
switchMode(mode: MeasureMode): void;
/**
2025-12-24 19:02:34 +08:00
* 使
* MeasurePanel.setResult()
2025-12-22 18:48:38 +08:00
* @param result null
*/
2025-12-24 19:02:34 +08:00
setMeasureResult(result: MeasureResult | null): void;
2025-12-23 11:31:16 +08:00
/**
* /
* -
* - Manager null
*/
getConfig(): MeasureConfig | null;
/**
* /
* @param partial
* @param persist true
*/
setConfig(partial: Partial<MeasureConfig>, persist?: boolean): void;
2025-12-22 18:48:38 +08:00
/**
* UI
*/
clearAll(): void;
/**
* /
*/
openSettings(): void;
destroy(): void;
}
/**
*
2025-12-22 18:48:38 +08:00
*
*
* - types
* - Engine MeasurePanel Manager
2025-12-22 18:48:38 +08:00
*/
/**
* 8
*
*
* - id /便使
* - key locales
2025-12-22 18:48:38 +08:00
*/
declare type MeasureMode = 'distance' | 'minDistance' | 'angle' | 'elevation' | 'volume' | 'laserDistance' | 'slope' | 'spaceVolume';
2025-12-23 11:31:16 +08:00
/**
*
* - 0 -> 0
* - 1 -> 0.0
* - 2 -> 0.00
* - 3 -> 0.000
*/
declare type MeasurePrecision = 0 | 1 | 2 | 3;
2025-12-22 18:48:38 +08:00
/**
*
*
*
* - setResult
* - UI --
*/
declare interface MeasureResult {
/** 距离单位mm */
distanceMm?: number;
/** 最小距离单位mm */
minDistanceMm?: number;
/** 角度单位deg */
angleDeg?: number;
/** 标高单位mm */
elevationMm?: number;
/** 体积单位 */
volumeM3?: number;
/** 激光测距单位mm */
laserDistanceMm?: number;
/** 坡度(单位:% */
slopePercent?: number;
/** 空间体积单位 */
spaceVolumeM3?: number;
/** 可选:展示测量点/结果点坐标(单位由引擎侧定义,这里只负责显示) */
xyz?: MeasureXYZ;
}
2025-12-23 11:31:16 +08:00
/**
* /
*/
declare type MeasureUnit = 'm' | 'cm' | 'mm' | 'km';
2025-12-22 18:48:38 +08:00
/**
* 3D
*/
declare interface MeasureXYZ {
x: number;
y: number;
z: number;
}
/**
* ()
*/
2025-12-22 15:39:58 +08:00
declare interface MenuItemConfig {
id: string;
label: string;
onClick?: () => void;
icon?: string;
group?: string;
order?: number;
children?: MenuItemConfig[];
disabled?: boolean;
visible?: boolean;
}
2025-12-04 18:39:07 +08:00
/**
*
*
*/
export declare interface ModelLoadOptions {
/** 模型初始位置 [x, y, z] */
position?: [number, number, number];
/** 模型初始旋转 [x, y, z](弧度) */
rotation?: [number, number, number];
/** 模型初始缩放 [x, y, z] */
scale?: [number, number, number];
/** 模型 ID可选如果不提供则自动生成 */
id?: string;
}
2025-12-22 15:39:58 +08:00
/**
*
*/
export declare type NodeClickAction = 'select' | 'expand';
declare interface OptButton extends ButtonConfig {
children?: OptButton[];
2025-12-03 12:00:46 +08:00
}
/**
*
* ( Tab + Collapse + Description )
*/
2025-12-22 15:39:58 +08:00
declare class PropertyPanelManager extends BimComponent {
private dialogId;
2025-12-25 15:47:57 +08:00
private dialog;
2025-12-22 15:39:58 +08:00
constructor(engine: BimEngine);
init(): void;
/**
*
*/
2025-12-22 15:39:58 +08:00
show(): void;
/**
* "属性" ( Collapse)
*/
private createPropsTabContent;
/**
* "材质" ( Collapse)
*/
private createMaterialTabContent;
2025-12-22 15:39:58 +08:00
private createBaseInfoContent;
private createAdvancedInfoContent;
2025-12-22 15:39:58 +08:00
private createMaterialContent;
2025-12-25 15:47:57 +08:00
/**
*
*/
isOpen(): boolean;
/**
*
*/
hide(): void;
2025-12-22 15:39:58 +08:00
destroy(): void;
}
/**
* (RightKeyManager)
*
* 1. Canvas/ contextmenu
* 2. (Handler)
* 3. Menu RightKey
*/
declare class RightKeyManager extends BimComponent {
private container;
private rightKeyPanel;
private contextHandlers;
constructor(engine: BimEngine, container: HTMLElement);
destroy(): void;
/**
*
* @param handler
*/
registerHandler(handler: (e: MouseEvent) => MenuItemConfig[] | null): void;
/**
*
*
* @param x X
* @param y Y
* @param items
* @param groupOrder
*/
showMenu(x: number, y: number, items: MenuItemConfig[], groupOrder?: string[]): void;
/**
*
*/
hide(): void;
/**
*
2025-12-16 11:57:44 +08:00
* BimRightKey
*/
private handleContextMenu;
}
2025-12-24 19:02:34 +08:00
/**
*
*/
declare type SectionAxis = 'x' | 'y' | 'z';
/**
*
*/
declare class SectionAxisDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
*
*/
show(): void;
/**
*
*/
hide(): void;
/**
*
*/
getHiddenState(): boolean;
/**
*
*/
setHiddenState(isHidden: boolean): void;
/**
*
*/
getActiveAxis(): SectionAxis;
/**
*
*/
setActiveAxis(axis: SectionAxis): void;
/**
*
*/
destroy(): void;
}
/**
*
*/
declare interface SectionBoxAxisRange {
/** 最小值0-100的百分比 */
min: number;
/** 最大值0-100的百分比 */
max: number;
}
/**
*
*/
declare class SectionBoxDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
*
*/
show(): void;
/**
*
*/
hide(): void;
/**
*
*/
getHiddenState(): boolean;
/**
*
*/
setHiddenState(isHidden: boolean): void;
/**
*
*/
getReversedState(): boolean;
/**
*
*/
setReversedState(isReversed: boolean): void;
/**
*
*/
getRange(): SectionBoxRange | null;
/**
*
*/
setRange(range: Partial<SectionBoxRange>): void;
/**
*
*/
destroy(): void;
}
/**
*
*/
declare interface SectionBoxRange {
/** X轴范围 */
x: SectionBoxAxisRange;
/** Y轴范围 */
y: SectionBoxAxisRange;
/** Z轴范围 */
z: SectionBoxAxisRange;
}
/**
*
*/
declare class SectionPlaneDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
*
*/
show(): void;
/**
*
*/
hide(): void;
/**
*
*/
destroy(): void;
}
/**
*
*
*/
2025-12-22 15:39:58 +08:00
export declare interface ThemeConfig {
/** 主题名称 */
name: string;
/** 品牌色/主色 */
primary: string;
/** 主色悬停/激活态 */
primaryHover: string;
/** 基础背景色 (应用整体背景) */
background: string;
/** 面板背景色 (工具栏、弹窗背景) */
panelBackground: string;
/** 主要文字颜色 */
textPrimary: string;
/** 次要文字颜色 */
textSecondary: string;
/** 边框/分割线颜色 */
border: string;
/** 图标默认颜色 */
icon: string;
/** 图标激活颜色 */
iconActive: string;
/** 交互组件背景 (如按钮默认背景) */
componentBackground: string;
/** 交互组件悬停背景 */
componentHover: string;
/** 交互组件激活背景 */
componentActive: string;
}
/**
*
*/
2025-12-22 15:39:58 +08:00
export declare type ThemeType = 'dark' | 'light' | 'custom';
/**
* (ToolbarManager)
*
*/
2025-12-08 10:02:24 +08:00
declare class ToolbarManager extends BimComponent {
private toolbar;
private toolbarContainer;
private container;
2025-12-08 10:02:24 +08:00
constructor(engine: BimEngine, container: HTMLElement);
private init;
updateTheme(theme: ThemeConfig): void;
refresh(): void;
destroy(): void;
addGroup(groupId: string, beforeGroupId?: string): void;
addButton(config: ButtonConfig): void;
setButtonVisibility(id: string, v: boolean): void;
setShowLabel(show: boolean): void;
2025-12-22 18:48:38 +08:00
setBtnActive(id: string, active?: boolean): void;
setVisible(visible: boolean): void;
setBackgroundColor(color: string): void;
setColors(colors: ButtonGroupColors): void;
2025-12-25 15:47:57 +08:00
/**
*
*/
hide(): void;
/**
*
*/
show(): void;
/**
*
*/
getContainer(): HTMLElement | null;
}
2025-12-22 15:39:58 +08:00
/**
*
*/
export declare enum TreeNodeCheckState {
Unchecked = 0,
Checked = 1,
Indeterminate = 2
}
/**
*
*/
export declare interface TreeNodeConfig {
/** 唯一标识符 */
id: string;
/** 显示文本的翻译键 */
label: string;
/** 节点图标 (SVG string 或 URL) */
icon?: string;
/** 子节点列表 */
children?: TreeNodeConfig[];
/** 初始展开状态 (默认 false) */
expanded?: boolean;
/** 初始选中状态 (默认 false) */
checked?: boolean;
/** 是否禁用 (默认 false) */
disabled?: boolean;
/** 自定义业务数据 */
data?: any;
/** 是否是叶子节点 (用于异步加载场景,暂留接口) */
isLeaf?: boolean;
/** 点击整行的行为 (默认 'select') */
clickAction?: NodeClickAction;
}
/**
*
*/
export declare interface TreeOptions {
/** 树的数据源 */
data: TreeNodeConfig[];
/** 是否显示复选框 (默认 true) */
checkable?: boolean;
/**
* ( true)
* true:
* false:
*/
checkStrictly?: boolean;
/** 默认展开所有节点 (默认 false) */
defaultExpandAll?: boolean;
/** 缩进宽度 (像素,默认 24) */
indent?: number;
/** 是否启用搜索功能 (默认 false) */
enableSearch?: boolean;
/** 搜索框占位符 */
searchPlaceholder?: string;
/** 节点勾选回调 */
onNodeCheck?: (node: BimTreeNode) => void;
/** 节点选择回调 */
onNodeSelect?: (node: BimTreeNode) => void;
/** 节点展开/折叠回调 */
onNodeExpand?: (node: BimTreeNode) => void;
/**
*
* HTML HTMLElement
*/
renderActions?: (node: TreeNodeConfig) => HTMLElement | string;
}
2025-12-25 15:47:57 +08:00
/**
*
*/
declare class WalkControlManager extends BimComponent {
panel: WalkControlPanel | null;
private pathManager;
constructor(engine: BimEngine);
init(): void;
/**
*
*/
show(): void;
/**
*
*/
hide(): void;
/**
*
*/
destroy(): void;
}
/**
*
*/
declare type WalkControlMode = 'none' | 'path' | 'walk';
declare class WalkControlPanel implements IBimComponent {
element: HTMLElement;
private options;
private state;
private planViewBtn;
private pathModeBtn;
private walkModeBtn;
private settingsContainer;
private speedControl;
private speedDecreaseBtn;
private speedIncreaseBtn;
private speedDisplay;
private gravityCheckbox;
private gravityLabel;
private collisionCheckbox;
private collisionLabel;
private characterModelSelect;
private characterModelLabel;
private walkModeSelect;
private walkModeLabel;
private exitBtn;
private unsubscribeLocale;
private unsubscribeTheme;
constructor(options?: WalkControlPanelOptions);
init(): void;
setPlanViewActive(active: boolean): void;
setPathModeActive(active: boolean): void;
getState(): WalkControlState;
private createPanel;
private createLeftButtons;
private createSettingsContainer;
private createSpeedControl;
private createIconButton;
private createExitButton;
private setMode;
private updateButtonStates;
private updateSettingsView;
private updateSpeedDisplay;
private updateSpeedButtonStates;
private getIconSVG;
setLocales(): void;
setTheme(theme: ThemeConfig): void;
destroy(): void;
}
/**
*
*/
declare interface WalkControlPanelOptions {
/** 平面图切换回调 */
onPlanViewToggle?: (isActive: boolean) => void;
/** 路径漫游模式切换回调 */
onPathModeToggle?: (isActive: boolean) => void;
/** 漫游模式切换回调 */
onWalkModeToggle?: (isActive: boolean) => void;
/** 速度变化回调 */
onSpeedChange?: (speed: number) => void;
/** 重力切换回调 */
onGravityToggle?: (enabled: boolean) => void;
/** 碰撞切换回调 */
onCollisionToggle?: (enabled: boolean) => void;
/** 角色模型变化回调 */
onCharacterModelChange?: (model: CharacterModel) => void;
/** 行走模式变化回调 */
onWalkModeChange?: (mode: WalkMode) => void;
/** 退出回调 */
onExit?: () => void;
/** 默认速度 (0-100) */
defaultSpeed?: number;
/** 默认重力状态 */
defaultGravity?: boolean;
/** 默认碰撞状态 */
defaultCollision?: boolean;
/** 默认角色模型 */
defaultCharacterModel?: CharacterModel;
/** 默认行走模式 */
defaultWalkMode?: WalkMode;
}
/**
*
*/
declare interface WalkControlState {
/** 当前模式 */
mode: WalkControlMode;
/** 平面图是否激活 */
isPlanViewActive: boolean;
/** 移动速度 (0-100) */
speed: number;
/** 重力是否启用 */
gravity: boolean;
/** 碰撞是否启用 */
collision: boolean;
/** 当前角色模型 */
characterModel: CharacterModel;
/** 当前行走模式 */
walkMode: WalkMode;
}
/**
*
*/
declare type WalkMode = 'walk' | 'run';
2025-12-03 12:00:46 +08:00
export { }