提交 0c6c0c72 编写于 作者: D DCloud_LXH

feat: update @dcloudio/types to 3.3.0

上级 6b478b12
......@@ -24,4 +24,4 @@
"resolutions": {
"@dcloudio/uni-app-vite": "../../uni-app-vite"
}
}
\ No newline at end of file
}
......@@ -9,7 +9,10 @@ export const ScanCodeProtocol: ApiProtocol<API_TYPE_SCAN_CODE> = {
autoZoom: Boolean,
}
const SOUND: Parameters<API_TYPE_SCAN_CODE>[0]['sound'][] = ['default', 'none']
const SOUND: NonNullable<Parameters<API_TYPE_SCAN_CODE>[0]>['sound'][] = [
'default',
'none',
]
export const ScanCodeOptions: ApiOptions<API_TYPE_SCAN_CODE> = {
formatArgs: {
sound(value, params) {
......
......@@ -2,7 +2,7 @@ import { elemInArray } from '../../helpers/protocol'
export const API_SHREA = 'share'
export type API_TYPE_SHARE = typeof uni.share
const SCENE: Parameters<API_TYPE_SHARE>[0]['scene'][] = [
const SCENE: NonNullable<Parameters<API_TYPE_SHARE>[0]>['scene'][] = [
'WXSceneSession',
'WXSceneTimeline',
'WXSceneFavorite',
......@@ -73,7 +73,7 @@ export const ShareProtocols: ApiProtocol<API_TYPE_SHARE> = {
export const API_SHARE_WITH_SYSTEM = 'shareWithSystem'
export type API_TYPE_SHARE_WITH_SYSTEM = typeof uni.shareWithSystem
const TYPE: Parameters<API_TYPE_SHARE_WITH_SYSTEM>[0]['type'][] = [
const TYPE: NonNullable<Parameters<API_TYPE_SHARE_WITH_SYSTEM>[0]>['type'][] = [
'text',
'image',
]
......
......@@ -8,10 +8,11 @@ const API_ROUTE = [
'navigateTo',
'navigateBack',
] as const
export function subscribeNavigator() {
API_ROUTE.forEach((name) => {
registerServiceMethod(name, (args) => {
uni[name](
;(uni[name] as (options: any) => void)(
extend(args, {
fail(res: { errMsg: string }) {
console.error(res.errMsg)
......
......@@ -25,7 +25,7 @@ export const onWebInvokeAppService: WebInvokeAppService = (
if (name === 'postMessage') {
onMessage(pageIds[0], arg)
} else {
uni[name](
;(uni[name] as (options: any) => void)(
extend(arg, {
fail(res: { errMsg: string }) {
console.error(res.errMsg)
......
......@@ -33,6 +33,6 @@
"@vue/shared": "3.2.47"
},
"peerDependencies": {
"@dcloudio/types": "^3.2.11"
"@dcloudio/types": "^3.3.0"
}
}
......@@ -35,7 +35,7 @@ export const getVideoInfo = defineAsyncApi<API_TYPE_GET_VIDEO_INFO>(
clearTimeout(handle)
video.onerror = null
resolve({
size: file ? file.size : undefined,
size: file ? file.size : 0,
duration: video.duration || 0,
width: video.videoWidth || 0,
height: video.videoHeight || 0,
......
......@@ -18,6 +18,6 @@ export const onWebInvokeAppService: WebInvokeAppService = ({ name, arg }) => {
if (name === 'postMessage') {
// TODO 小程序后退、组件销毁、分享时通知
} else {
uni[name](arg)
;(uni[name] as (options: any) => void)(arg)
}
}
......@@ -9,7 +9,7 @@ importers:
specifiers:
'@babel/core': ^7.17.10
'@babel/preset-env': ^7.16.11
'@dcloudio/types': 3.2.11
'@dcloudio/types': 3.3.0
'@dcloudio/uni-api': 3.0.0-alpha-3070120230210001
'@dcloudio/uni-app': 3.0.0-alpha-3070120230210001
'@jest/types': ^29.0.3
......@@ -61,7 +61,7 @@ importers:
devDependencies:
'@babel/core': 7.20.7
'@babel/preset-env': 7.20.2_@babel+core@7.20.7
'@dcloudio/types': 3.2.11
'@dcloudio/types': 3.3.0
'@dcloudio/uni-api': link:packages/uni-api
'@dcloudio/uni-app': link:packages/uni-app
'@jest/types': 29.3.1
......@@ -3163,8 +3163,8 @@ packages:
resolution: {integrity: sha512-mrCMwcINy1IFjU9VUqLeWBkj404yWs5paLDttBcA+eqUjanuUQbBcTVPqlrGgkyzLXDcV2oDDZRSNxNpXi4kMQ==}
dev: true
/@dcloudio/types/3.2.11:
resolution: {integrity: sha512-Ws+pUiQMvCcSjg0soF+vTTwwsdNlK/1cxIfo5LBBDFPoXfUAAh6k9HnCt5cudERNhY0M3wE7ATMx/1Cb9bmUig==}
/@dcloudio/types/3.3.0:
resolution: {integrity: sha512-9c82k7vAe7PZZOjtoJpgqqeMfezCLhOJcwEw/NcnXl6yAH7deya2MZnrdofkXaMb24v9nffHMOwusgo6+vcFgQ==}
dev: true
/@esbuild/android-arm/0.16.17:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册