API 参考
Qingkuai 的 API 按入口包划分,便于按需引入并保持清晰的职责边界。本文基于源码入口文件整理两类公开 API:运行时包qingkuai与编译器包qingkuai/compiler。
qingkuai/internal 主要面向框架内部实现,通常不建议业务代码直接依赖,因此本节不展开说明。
运行时
运行时包导出组件生命周期、响应式副作用、性能优化及状态转换等 API。
类型导出
HtmlBlockOptions
生命周期
onBeforeMountonAfterMountonBeforeUpdateonAfterUpdateonBeforeDestroyonAfterDestroy
参考:生命周期
副作用与监视器
watcheffectpreEffectpostEffectsyncEffectpreWatchpostWatchsyncWatch
参考:监视器与副作用
响应式优化控制
noTrackingnoUpdatingpauseTrackingpauseUpdatingresumeTrackingresumeUpdatingbatchUpdatingstopBatchUpdatingstartBatchUpdatingbatchAndNoTracking
状态与调度
mountAppnextTicktoRawcreateStoretoReactivetoShallowReactive
其他导出
DESTRUCT_HTML
编译器(qingkuai/compiler)
编译器包用于解析与编译组件源码,主要被构建工具、语言服务和插件生态调用。
类型导出
ASTLocationASTPositionTemplateNodeCompileOptionsCompileResultStyleDescriptorTextContentPartScriptDescriptorIdentifierStatusTemplateAttributeASTPositionWithFlagTemplateNodeContextCompileIntermediateOptionsCompileIntermediateResult
常量
SPREAD_TAGPRESERVED_IDPREFIXLANGUAGE_SERVICE_UTILGET_TYPE_DELAY_MARKING
工具函数
camel2Kebabkebab2CameltoPropertyKeyfindEndBracketfindOutOfCommentfindOutOfLiteralfindOutOfLiteralCommentisSelfClosingTagisEmbeddedLanguageTagisRequiredValueDirective
方法与标志
PositionFlagisCompileErrorisCompileWarningparseComponentTagparseDirectiveValueparseEventFlagparseTemplatecompilecompileIntermediate