Skip to content

包 API 总览 ​

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

@ptahjs/ui-vue ​

Vue 集成主入口。

  • createPtah(options)
  • useRuntimeApp(args)
  • useDesignerApp(args)
  • 内置组件:DesignerRoot、Preview、WorkspaceWidget、ScenesWidget、ModulesWidget、EventsWidget、ParameterWidget、RendererModule、FpsWidget
  • 内置渲染器:WebRenderer、SceneRenderer、FlowRenderer
  • 同时透出 @ptahjs/runtime 和 @ptahjs/designer 的导出

@ptahjs/runtime ​

基于 Kernel 的运行时层。

  • 类:Runtime、FlowRunner、ProgramLoader
  • 函数:compilePageSchemaToSections、compilePageSchema、buildStackToTarget
  • 同时透出 @ptahjs/kernel 的导出

@ptahjs/designer ​

设计时层。

  • 类:Designer
  • Schema 工厂:createRootAppSchema、createSceneSchema、createModuleSchema、createPropsSchema、createEventsSchema、createSlotsSchema
  • 参数 Schema 工具:numberProp、stringProp、booleanProp、selectProp、objectProp、arrayProp、groupProp
  • 同时透出 @ptahjs/dnd 的导出

@ptahjs/kernel ​

核心状态层。

  • 类:Kernel、ResourceRepository、ModuleManager、LifecycleChain、SharedResource
  • IR 工具:createEmptyIRGraph、clearIRGraph、IR_SECTIONS、RUNTIME_STATE_KEYS、各类 selector(如 getSceneById、getModuleById)
  • 常量:MODULE_TYPE、EVENT_TYPE、RESOURCE_TYPE、LIFECYCLE_TYPE、ROOT_SECTION
  • 编译应用函数:applyCompiledSectionsToKernel

@ptahjs/dnd ​

拖拽引擎。

  • Core:Dnd
  • Services:DropService、MirrorService、AutoScrollService、DropIndicatorService、ActiveSelectionService、TransformControllerService

@ptahjs/shared ​

通用工具包。

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


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

3D 引擎与扩展插件包。

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

构建工具相关包 ​

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