Skip to content

Type Reference(类型总览)

本页先给出“高频类型速查”,然后提供 wevu 当前导出的接口/类型别名全量索引。

1. 高频类型速查

类型链接说明
SetupContext/wevu/api/index/interfaces/SetupContextsetup(props, ctx) 的上下文类型。
RuntimeInstance/wevu/api/index/interfaces/RuntimeInstance运行时实例,含 snapshot/watch/bindModel 等能力。
ComponentDefinition/wevu/api/index/interfaces/ComponentDefinition小程序组件定义结构。
DefineComponentOptions/wevu/api/index/interfaces/DefineComponentOptionsdefineComponent 参数类型。
CreateAppOptions/wevu/api/index/interfaces/CreateAppOptionscreateApp 参数类型。
DefineStoreOptions/wevu/api/index/interfaces/DefineStoreOptionsdefineStore 参数类型。
WatchOptions/wevu/api/index/interfaces/WatchOptionswatch/watchEffect 配置。
ModelBinding/wevu/api/index/interfaces/ModelBindingbindModel/useModel 绑定结果。
TriggerEventOptions/wevu/api/index/type-aliases/TriggerEventOptionsemit/triggerEvent 选项类型。
WevuDefaults/wevu/api/index/interfaces/WevuDefaultssetWevuDefaults 配置结构。
MiniProgramInstance/wevu/api/index/type-aliases/MiniProgramInstancesetup 中原生实例类型。
WevuPlugin/wevu/api/index/type-aliases/WevuPlugin插件函数类型。

2. 接口(Interfaces)全量索引

接口领域
ActionSubscriberStore/action 订阅
AppConfigApp 配置
ComponentDefinition组件定义
ComputedRef只读 computed
CreateAppOptionscreateApp 参数
DefineAppOptionsApp 定义参数
DefineComponentOptionsdefineComponent 参数
DefineStoreOptionsdefineStore 参数
EffectScopeeffect 作用域
GlobalComponents全局组件扩展
GlobalDirectives全局指令扩展
InternalRuntimeStateFields运行时内部状态
MiniProgramAdapter平台适配器
MiniProgramComponentOptions小程序组件配置
ModelBinding双向绑定结果
ModelBindingOptions双向绑定选项
MutationRecordmutation 记录
PageFeatures页面 feature 开关
PrelinkReactiveTreeOptionsreactive 预链接选项
PropOptionsprop 选项
RuntimeAppApp 运行时实例
RuntimeInstance页面/组件运行时实例
SetDataDebugInfosetData 调试信息
SetDataSnapshotOptionssetData 快照选项
SetupContextsetup 上下文
StoreManagerstore 管理器
SubscriptionCallback订阅回调
TemplateRefs模板 ref 集合
TemplateRefValue模板 ref 值类型
WatchOptionswatch 配置
WevuDefaults全局默认值配置
WevuGlobalComponentswevu 全局组件
WevuGlobalDirectiveswevu 全局指令
WritableComputedOptions可写 computed 配置
WritableComputedRef可写 computed 引用

3. 类型别名(Type Aliases)全量索引

3.1 组件、Props、宏相关

类型别名说明
AllowedComponentProps允许透传的组件属性
ComponentCustomProps自定义组件属性扩展
ComponentOptionsMixin组件选项 mixin
ComponentPropsOptionsprops 选项定义
ComponentPublicInstance公共实例类型
DefineComponentdefineComponent 类型签名
EmitsOptionsemits 配置类型
ExtractDefaultPropTypes默认值推断
ExtractPropTypesprops 推断结果
ExtractPublicPropTypes对外 props 推断
InferPropType单个 prop 类型推断
InferPropsprops 对象推断
PropConstructorprop 构造器类型
PropTypeprop 类型声明
PublicProps公共 props 合集
SetupFunctionsetup 函数签名
TriggerEventOptionstriggerEvent 选项
VNodeVNode 兼容类型
VNodePropsVNode props 兼容类型

3.2 响应式与工具类型

类型别名说明
ComputedDefinitionscomputed 定义集合
ComputedGettercomputed getter
ComputedSettercomputed setter
ExtractComputed提取 computed 返回值
ExtractMethods提取 methods 返回值
MaybeRef值或 Ref
MaybeRefOrGetter值或 Ref 或 getter
MethodDefinitionsmethods 定义集合
RefRef 类型
ShallowRefShallowRef 类型
ShallowUnwrapRefshallow 解包类型
ToRefstoRefs 返回类型
WatchStopHandlewatch 停止句柄

3.3 小程序桥接与运行时内部

类型别名说明
InternalRuntimeState运行时内部状态
MiniProgramAppOptionsApp 原生配置
MiniProgramBehaviorIdentifierBehavior 标识符
MiniProgramComponentBehaviorOptions组件 behavior 配置
MiniProgramComponentRawOptions组件原始配置
MiniProgramInstance原生组件/页面实例
MiniProgramPageLifetimes页面生命周期类型
ObjectDirective指令对象类型
TemplateRef模板 ref 类型

3.4 store / model / mutation

类型别名说明
ModelBindingPayloadmodel 绑定 payload
MutationKindmutation 种类
MutationOpmutation 操作
MutationTypemutation 类型
WevuPlugin插件类型

4. 编译侧类型(wevu/compiler

类型别名链接说明
WevuRuntimeApiName/wevu/api/compiler/type-aliases/WevuRuntimeApiName编译器识别的运行时 API 名字联合。
WevuPageHookName/wevu/api/compiler/type-aliases/WevuPageHookName页面 hook 名字联合。
WevuPageFeatureFlag/wevu/api/compiler/type-aliases/WevuPageFeatureFlag页面 feature 开关联合。

5. 相关页

Released under the MIT License.