提交 14f1284d 编写于 作者: Q qiang

Revert "feat: 小程序 CanvasContext.measureText 支持异步返回"

This reverts commit cd6afc80.
上级 6aaf8783
......@@ -34,7 +34,7 @@
"node": ">=10.0.0"
},
"devDependencies": {
"@dcloudio/types": "^2.0.6",
"@dcloudio/types": "^2.0.0",
"@ls-lint/ls-lint": "^1.8.0",
"@microsoft/api-extractor": "^7.3.9",
"@rollup/plugin-alias": "^3.1.1",
......
......@@ -2,7 +2,7 @@ import { isPlainObject, isArray } from '@vue/shared'
import { addSafeAreaInsets } from '@dcloudio/uni-mp-core'
export { redirectTo, createCanvasContext } from '@dcloudio/uni-mp-core'
export { redirectTo } from '@dcloudio/uni-mp-core'
function handleNetworkInfo(
fromRes: my.IGetNetworkTypeSuccessResult,
......
......@@ -2,8 +2,7 @@ export {
redirectTo,
previewImage,
getSystemInfo,
getSystemInfoSync,
createCanvasContext
getSystemInfoSync
} from '@dcloudio/uni-mp-core'
function createTodoMethod(contextName: string, methodName: string) {
......
......@@ -102,19 +102,3 @@ export const getSystemInfo = {
export const getSystemInfoSync = getSystemInfo
export const redirectTo = {}
export const createCanvasContext: MPProtocol = {
returnValue(fromRes: any, toRes: UniApp.CanvasContext) {
const measureText = fromRes.measureText
toRes.measureText = function(
text: string,
callback: (measureText: UniApp.CanvasTextMetrics) => void
) {
const textMetrics = measureText.call(this, text)
if (typeof callback === 'function') {
setTimeout(() => callback(textMetrics), 0)
}
return textMetrics
}
}
}
......@@ -38,8 +38,7 @@ export {
previewImage,
getSystemInfo,
getSystemInfoSync,
addSafeAreaInsets,
createCanvasContext
addSafeAreaInsets
} from './api/protocols'
// types
export { MiniProgramAppOptions, MiniProgramAppInstance } from './runtime/app'
......
......@@ -2,6 +2,5 @@ export {
redirectTo,
previewImage,
getSystemInfo,
getSystemInfoSync,
createCanvasContext
getSystemInfoSync
} from '@dcloudio/uni-mp-core'
export {
redirectTo,
previewImage,
createCanvasContext
} from '@dcloudio/uni-mp-core'
export { redirectTo, previewImage } from '@dcloudio/uni-mp-core'
export const chooseImage = {
args: {
sizeType: false
......
......@@ -2,6 +2,5 @@ export {
redirectTo,
previewImage,
getSystemInfo,
getSystemInfoSync,
createCanvasContext
getSystemInfoSync
} from '@dcloudio/uni-mp-core'
......@@ -2,6 +2,5 @@ export {
redirectTo,
previewImage,
getSystemInfo,
getSystemInfoSync,
createCanvasContext
getSystemInfoSync
} from '@dcloudio/uni-mp-core'
......@@ -271,10 +271,10 @@
exec-sh "^0.3.2"
minimist "^1.2.0"
"@dcloudio/types@^2.0.6":
version "2.0.6"
resolved "https://registry.yarnpkg.com/@dcloudio/types/-/types-2.0.6.tgz#33daf724a58b593deef1294c210dad6509f1133d"
integrity sha512-ZOGaQMV2Xv8AtP2zBEURNVE62964fXZx1yCcMHRYxKPQtUzeOW0ZZVRkO6dxWLs/GE1GXTVJlJl/A9loLHqQOA==
"@dcloudio/types@^2.0.0":
version "2.0.5"
resolved "https://registry.npmjs.org/@dcloudio/types/-/types-2.0.5.tgz#4a1e719775b53363945548d45535d5386ffaeaf9"
integrity sha512-4lNLAEECY5DEqfsnWIKR2T3lgZKvZIHEpljHVcBr28evbae7GA6pbUnitkEoA7o+yW3E83Sin0hwWBnBfb7B1A==
"@eslint/eslintrc@^0.1.0":
version "0.1.0"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册