F2 icon indicating copy to clipboard operation
F2 copied to clipboard

按需引入 f2 时,缺少 TypeScript 类型声明

Open zhengcan opened this issue 3 years ago • 1 comments

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

当通过 import F2 from '@antv/f2/lib/core'; 引入时,TypeScript 会报告说没有找到合适的类型声明。 简单阅读了一下项目中 types 目录的代码,应该没有考虑过对于按需引入时的支持。 建议补足以优化 TypeScript 下的使用体验。

What does the proposed API look like?

对于按需引入相关的官方示例代码(https://f2.antv.vision/zh/docs/tutorial/require),都有良好的 TypeScript 类型声明支持。

zhengcan avatar Jan 20 '22 07:01 zhengcan

我也发现这个问题,这时候是不是可以单独引入F2类型,仅作为类型使用? import type F2 from '@antv/f2/lib/index-all';

Ma-cherie avatar May 17 '23 12:05 Ma-cherie