miniprogram-api-typings
Advanced tools
Comparing version
@@ -0,1 +1,5 @@ | ||
## 2023-10-17 v3.12.1 | ||
- 更新 API 定义到 3.1.2 | ||
- 补齐自定义组件实例的 `getPassiveEvent`, `setPassiveEvent` 方法 | ||
## 2023-08-24 v3.12.0 | ||
@@ -2,0 +6,0 @@ - `App` 生命周期 `onLaunch`, `onShow` 参数中的 `referrerInfo` 字段类型对齐 API 定义中的 `ReferrerInfo`。这是一个 **破坏性改动**,其中 `extraData` 的类型从 `any` 收窄到了 `Record<string, any>` |
{ | ||
"name": "miniprogram-api-typings", | ||
"version": "3.12.0", | ||
"version": "3.12.1", | ||
"description": "Type definitions for APIs of Wechat Mini Program in TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "./index.d.ts", |
@@ -62,3 +62,2 @@ /*! ***************************************************************************** | ||
type AudioNode = any | ||
type AudioParam = any | ||
type ChannelSplitterNode = any | ||
@@ -65,0 +64,0 @@ type ChannelMergerNode = any |
@@ -138,2 +138,4 @@ /*! ***************************************************************************** | ||
): Promise<ICloud.ConnectContainerResult> | ||
services: ICloud.CloudServices | ||
} | ||
@@ -205,2 +207,33 @@ | ||
// === API: services === | ||
type AsyncSession<T> = T | PromiseLike<T> | ||
interface GatewayCallOptions { | ||
path: string | ||
data: any | ||
shouldSerialize?: boolean | ||
apiVersion?: number | ||
} | ||
interface GatewayInstance { | ||
call: ( | ||
param: CallContainerParam & GatewayCallOptions | ||
) => Promise<CallContainerResult> | ||
refresh: (session: AsyncSession<string>) => Promise<void> | ||
} | ||
interface GatewayConstructOptions { | ||
id: string | ||
appid?: string | ||
domain?: string | ||
keepalive?: boolean | ||
prefetch?: boolean | ||
prefetchOptions?: { | ||
concurrent?: number | ||
enableQuic?: boolean | ||
enableHttp2?: boolean | ||
} | ||
} | ||
interface CloudServices { | ||
Gateway: (opts: GatewayConstructOptions) => GatewayInstance | ||
} | ||
// === end === | ||
// === API: uploadFile === | ||
@@ -207,0 +240,0 @@ interface UploadFileResult extends IAPISuccessParam { |
@@ -290,2 +290,15 @@ /*! ***************************************************************************** | ||
): void | ||
/** | ||
* 在运行时获取页面或组件所在页面 `touch` 相关事件的 passive 配置,详见 [enablePassiveEvent]((configuration/app#enablePassiveEvent)) | ||
* | ||
* 最低基础库版本:[`2.25.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | ||
*/ | ||
getPassiveEvent(callback: (config: PassiveConfig) => void): void | ||
/** | ||
* 在运行时切换页面或组件所在页面 `touch` 相关事件的 passive 配置,详见 [enablePassiveEvent]((configuration/app#enablePassiveEvent)) | ||
* | ||
* 最低基础库版本:[`2.25.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | ||
*/ | ||
setPassiveEvent(config: PassiveConfig): void | ||
} | ||
@@ -667,2 +680,13 @@ | ||
} | ||
type PassiveConfig = | ||
| { | ||
/** 是否设置 touchmove 事件为 passive,默认为 `false` */ | ||
touchmove?: boolean | ||
/** 是否设置 touchstart 事件为 passive,默认为 `false` */ | ||
touchstart?: boolean | ||
/** 是否设置 wheel 事件为 passive,默认为 `false` */ | ||
wheel?: boolean | ||
} | ||
| boolean | ||
} | ||
@@ -669,0 +693,0 @@ /** Component构造器可用于定义组件,调用Component构造器时可以指定组件的属性、数据、方法等。 |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2230515
2.77%55047
3.09%