Skip to content

Commit

Permalink
fix(type): modify type to optional
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKonka committed Aug 21, 2024
1 parent b7adffc commit 9bf6b97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions packages/taro-h5/src/api/base/weapp/life-cycle.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import Taro from '@tarojs/api'

import { temporarilyNotSupport } from '../../../utils'

const launchOptions: Taro.getLaunchOptionsSync.LaunchOptions = {
path: '',
query: {},
scene: 0,
shareTicket: '',
referrerInfo: {}
referrerInfo: {},
}

function initLaunchOptions (options = {}) {
function initLaunchOptions(options = {}) {
Object.assign(launchOptions, options)
}

Expand All @@ -17,3 +19,7 @@ Taro.eventCenter.once('__taroRouterLaunch', initLaunchOptions)
// 生命周期
export const getLaunchOptionsSync: typeof Taro.getLaunchOptionsSync = () => launchOptions
export const getEnterOptionsSync: typeof Taro.getEnterOptionsSync = () => launchOptions

export const onApiCategoryChange = /* @__PURE__ */ temporarilyNotSupport('onApiCategoryChange')
export const offApiCategoryChange = /* @__PURE__ */ temporarilyNotSupport('offApiCategoryChange')
export const getApiCategory = /* @__PURE__ */ temporarilyNotSupport('getApiCategory')
2 changes: 1 addition & 1 deletion packages/taro/types/api/ui/interaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ declare module '../../index' {

interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
/** editable 为 true 时,用户输入的文本 */
content: string
content?: string
/** 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) */
cancel: boolean
/** 为 true 时,表示用户点击了确定按钮 */
Expand Down

0 comments on commit 9bf6b97

Please sign in to comment.