forked from ecomfe/baidubce-sdk
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于TS类型的一些问题 #71
Comments
另外 原因是
TS是无法推导这个类型到 |
只能 +1 了 |
+1 |
为啥types在packagejson里这么重要的不处理下?害我研究了半天 |
全局 .d.ts
引用 .ts 文件中
直接找到类型文件进行使用 PS:另外官方的类型声明文件不太好使,最后我放弃使用了。估计是SDK升级,并没有同步更新 d.ts |
临时解决办法: // module.d.ts
declare module '@baiducloud/sdk' {
import sdk from '@baiducloud/sdk/types';
export default sdk;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第一个问题是
package.json
中没有types
字段,所以解析不到:第二个问题是代码库用了
export =
导出整个,但实际上我觉得应该是named export更合适些?The text was updated successfully, but these errors were encountered: