Skip to content

包 API 总览

本页用于汇总当前 monorepo 中对外可用的包级 API。

@ptahjs/ui-vue

Vue 集成主入口。

  • createPtah(options)
  • useRuntimeApp(args)
  • useDesignerApp(args)
  • 内置组件:DesignerRootPreviewWorkspaceWidgetScenesWidgetModulesWidgetEventsWidgetParameterWidgetRendererModuleFpsWidget
  • 内置渲染器:WebRendererSceneRendererFlowRenderer
  • 同时透出 @ptahjs/runtime@ptahjs/designer 的导出

@ptahjs/runtime

基于 Kernel 的运行时层。

  • 类:RuntimeFlowRunnerProgramLoader
  • 函数:compilePageSchemaToSectionscompilePageSchemabuildStackToTarget
  • 同时透出 @ptahjs/kernel 的导出

@ptahjs/designer

设计时层。

  • 类:Designer
  • Schema 工厂:createRootAppSchemacreateSceneSchemacreateModuleSchemacreatePropsSchemacreateEventsSchemacreateSlotsSchema
  • 参数 Schema 工具:numberPropstringPropbooleanPropselectPropobjectProparrayPropgroupProp
  • 同时透出 @ptahjs/dnd 的导出

@ptahjs/kernel

核心状态层。

  • 类:KernelResourceRepositoryModuleManagerLifecycleChainSharedResource
  • IR 工具:createEmptyIRGraphclearIRGraphIR_SECTIONSRUNTIME_STATE_KEYS、各类 selector(如 getSceneByIdgetModuleById
  • 常量:MODULE_TYPEEVENT_TYPERESOURCE_TYPELIFECYCLE_TYPEROOT_SECTION
  • 编译应用函数:applyCompiledSectionsToKernel

@ptahjs/dnd

拖拽引擎。

  • Core:Dnd
  • Services:DropServiceMirrorServiceAutoScrollServiceDropIndicatorServiceActiveSelectionServiceTransformControllerService

@ptahjs/shared

通用工具包。

包含工具函数(cloneDeepdebounceorderBy 等)、事件基础设施(EventDispatcher)、hotkeys、storage、websocket 等能力。


@ptahjs/tri-core / @ptahjs/tri-extensions

3D 引擎与扩展插件包。

  • @ptahjs/tri-coredefineTri(args) 及引擎/插件/特性导出
  • @ptahjs/tri-extensions:核心插件、功能插件、默认插件数组导出

构建工具相关包

  • @ptahjs/buildbuildConfig(options)
  • @ptahjs/vite-plugin-json:Vite JSON 插件入口(src/main.js