Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion types/wx/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ declare namespace WechatMiniprogram {
// TODO: fill worklet type
type WorkletFunction = (...args: any) => any
type AnimationObject = any
type SharedValue<T = any> = T
type SharedValue<T = any> = {
value: T
}
type DerivedValue<T = any> = T
}

Expand Down
6 changes: 3 additions & 3 deletions types/wx/lib.wx.api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21408,10 +21408,10 @@ Page({
* 在插件中使用:不支持
*
* 创建共享变量 `SharedValue`,用于跨线程共享数据和驱动动画。 */
shared(
shared<T>(
/** 初始值,可通过 `.value` 属性进行读取和修改。类型可以是 `number | string | bool | null | undefined | Object | Array | Function`。 */
initialValue: any
): SharedValue
initialValue: T
): SharedValue<T>
/** [function worklet.runOnJS(function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/tool-function/worklet.runOnJS.html)
*
* 在插件中使用:不支持
Expand Down