以下的代码在ArkTS checked报错了,明明都是系统内提供的api,为什么用起来会报错呢?能不能提供忽略单行ArkTS checked的方案?而且本身类型提供的d.ts文件是支持any的,为什么开发阶段却不支持any和unknown?
const _search = decodeURIComponent(search);
const webviewQuery = new Url.URLParams(_search);
const webviewQueryEntries = webviewQuery.entries();
const webviewQueryToJSON = Object.fromEntries(webviewQueryEntries);
1.以下代码在ArkTS checked报错问题请参考一下文档
https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-url-V5
3.ArkTS不支持any、undefined和unknown类型。显式指定具体类型。以下是Ts到ArkTS的适配链接:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/typescript-to-arkts-migration-guide-V5