Skip to content

Commit b610b61

Browse files
committed
fix(uni-ui-types): correct UniPopup instance type definition
1 parent 3396524 commit b610b61

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/uni-ui-types/src/uni-popup.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,25 @@ type _UniPopupProps = Partial<{
9494
* 默认为 true
9595
*/
9696
safeArea: boolean;
97-
/** 打开弹出层 */
98-
open: (type?: _UniPopupType) => void;
99-
/** 关闭弹出层 */
100-
close: () => void;
10197
/** 状态变化时触发 */
10298
onChange: _UniPopupOnChange;
10399
/** 点击遮罩层触发 */
104100
onMaskClick: _UniPopupOnMaskClick;
105101
}>;
106102

103+
/** 弹出层方法 */
104+
type _UniPopupExpose = {
105+
/** 打开弹出层 */
106+
open: (type?: _UniPopupType) => void;
107+
/** 关闭弹出层 */
108+
close: () => void;
109+
};
110+
107111
/** 弹出层,在应用中弹出一个消息提示窗口、提示框等 */
108112
type _UniPopup = DefineComponent<_UniPopupProps>;
109113

110114
/** 弹出层实例 */
111-
type _UniPopupInstance = InstanceType<_UniPopup>;
115+
type _UniPopupInstance = InstanceType<_UniPopup> & _UniPopupExpose;
112116

113117
export type {
114118
_UniPopupType as UniPopupType,

0 commit comments

Comments
 (0)