Skip to content

Commit 842e192

Browse files
author
temu.psc
committed
up
1 parent 8d2e0a6 commit 842e192

File tree

2 files changed

+25
-31
lines changed

2 files changed

+25
-31
lines changed

packages/global/types/lib.page.d.ts

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -377,38 +377,26 @@ declare namespace MiniProgram.Page {
377377
Omit<ExtraOptions, keyof IOptions<Data, ExtraOptions>> &
378378
IInstanceProperties &
379379
IInstanceSharedMethods<Data> &
380-
IInstanceMethods<Data> & {} & IInstanceAdditionalProperties<ExtraOptions>;
381-
382-
/**
383-
* 用户可配置的 Page Options
384-
*/
385-
type IUserPageOptions<
386-
Data,
387-
ExtraThis,
388-
ExtraOptions extends UnknownRecord
389-
> = Partial<
390-
UniqueLeft<
391-
UniqueLeft<ExtraThis, ExtraOptions>,
392-
IOptions<Data, ExtraOptions>
393-
>
394-
> & {
395-
[P in keyof ExtraOptions]: P extends keyof IOptions<Data, ExtraOptions>
396-
? unknown
397-
: ExtraOptions[P];
398-
} & Partial<IOptions<Data, ExtraOptions>> &
399-
ThisType<IInstance<Data, ExtraThis, ExtraOptions>>;
380+
IInstanceMethods<Data> &
381+
IInstanceAdditionalProperties<ExtraOptions>;
400382

401383
interface Constructor {
402384
<
403385
Data = {},
404386
ExtraThis = {},
405387
ExtraOptions extends Record<string, unknown> = {}
406388
>(
407-
opts: IUserPageOptions<
408-
Data,
409-
ExtraThis & IGlobalMiniProgramExtraThis4Page,
410-
ExtraOptions
411-
>
389+
options: Partial<
390+
UniqueLeft<
391+
UniqueLeft<ExtraThis, ExtraOptions>,
392+
IOptions<Data, ExtraOptions>
393+
>
394+
> & {
395+
[P in keyof ExtraOptions]: P extends keyof IOptions<Data, ExtraOptions>
396+
? unknown
397+
: ExtraOptions[P];
398+
} & Partial<IOptions<Data, ExtraOptions>> &
399+
ThisType<IInstance<Data, ExtraThis, ExtraOptions>>
412400
): void;
413401
}
414402
interface GetCurrentPages {

packages/global/types/lib.shared.d.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ declare namespace MiniProgram.Shared {
104104
}
105105

106106
interface IRouter {
107-
navigateTo: (r: {
107+
navigateTo: (object: {
108108
/**
109109
* 需要跳转的目标页面路径
110110
* @description 路径后可以带参数, 目标路径必须为应用内非 tabbar 的,路径与参数之间使用 ?分隔,参数键与参数值用=相连,不同参数必须用&分隔
@@ -149,7 +149,7 @@ declare namespace MiniProgram.Shared {
149149
*/
150150
eventChannel: EventChannel;
151151
}>;
152-
redirectTo: (r: {
152+
redirectTo: (object: {
153153
/**
154154
* 需要跳转的目标页面路径
155155
* 路径后可以带参数, 目标路径必须为应用内非 tabbar 的,路径与参数之间使用 ?分隔,参数键与参数值用=相连,不同参数必须用&分隔
@@ -168,7 +168,7 @@ declare namespace MiniProgram.Shared {
168168
*/
169169
complete?(arg: { error?: number; errorMessage?: string }): void;
170170
}) => Promise<void>;
171-
navigateBack: (r?: {
171+
navigateBack: (object?: {
172172
/**
173173
* 返回的页面数
174174
* @description 如果 delta 大于现有打开的页面数,则返回到首页
@@ -188,7 +188,7 @@ declare namespace MiniProgram.Shared {
188188
*/
189189
complete?(arg: { error?: number; errorMessage?: string }): void;
190190
}) => Promise<void>;
191-
switchTab: (r: {
191+
switchTab: (object: {
192192
/**
193193
* 跳转的特定 tab 的路径
194194
* @description 目标路径必须为应用内 tabbar 的,且路径后不能带参数
@@ -207,7 +207,7 @@ declare namespace MiniProgram.Shared {
207207
*/
208208
complete?(arg: { error?: number; errorMessage?: string }): void;
209209
}) => Promise<void>;
210-
reLaunch: (r: {
210+
reLaunch: (object: {
211211
/**
212212
* 需要跳转的目标页面路径
213213
* @description
@@ -273,35 +273,41 @@ declare namespace MiniProgram.Shared {
273273
/**
274274
* 创建 MediaQueryObserver 对象实例,用于监听页面 media query 状态的变化。
275275
* @version 2.8.2
276+
* @see https://opendocs.alipay.com/mini/framework/component_object#createMediaQueryObserver
276277
*/
277278
createMediaQueryObserver(): IMediaQueryObserver;
278279
/**
279280
* 获取自定义 tabBar 实例,可以通过判断 `this.getTabBar` 是否为一个函数做兼容性处理
280281
* @version 2.7.20
282+
* @see https://opendocs.alipay.com/mini/framework/page-detail#Page.getTabBar
281283
*/
282284
getTabBar<T extends any = Component.BaseInstance>(): T | undefined;
283285
/**
284286
* 查询子组件
285287
* @description 根据传入的 selector 匹配器查询,返回匹配到的第一个组件实例(会被 ref 影响)
286288
* @version 2.8.0
289+
* @see https://opendocs.alipay.com/mini/framework/component_object#%24selectComponent%2F%24selectAllComponents
287290
*/
288291
$selectComponent(selector: string): Component.BaseInstance | void;
289292
/**
290293
* 查询子组件
291294
* @description 根据传入的 selector 匹配器查询,返回匹配到的所有组件实例(会被 ref 影响)
292295
* @version 2.8.0
296+
* @see https://opendocs.alipay.com/mini/framework/component_object#%24selectComponent%2F%24selectAllComponents
293297
*/
294298
$selectAllComponents(selector: string): Component.BaseInstance[];
295299
/**
296300
* 检查组件是否具有 mixin(须是通过Mixin()创建的mixin实例)。
297301
* @description 若自定义组件注册时传入了ref以指定组件返回值,则可通过hasMixin('ref')检查到
298-
* @version 基础库 2.8.2
302+
* @version 2.8.2
299303
* @return boolean
304+
* @see https://opendocs.alipay.com/mini/framework/component_object#%E7%BB%84%E4%BB%B6%E5%AE%9E%E4%BE%8B%E6%96%B9%E6%B3%95
300305
*/
301306
hasMixin(mixin: Mixin.IMixinIdentifier): boolean;
302307
/**
303308
* 监听 setData 引发界面更新的开销,参见 获取更新性能统计信息
304309
* @version 2.8.5
310+
* @see https://opendocs.alipay.com/mini/069xfk
305311
*/
306312
setUpdatePerformanceListener<WithDataPath extends boolean = false>(
307313
option: SetUpdatePerformanceListenerOption<WithDataPath>,

0 commit comments

Comments
 (0)