element-plus icon indicating copy to clipboard operation
element-plus copied to clipboard

[Bug Report] lack of some xx.d.ts files in lib after 1.0.2-beta.55

Open ChuHingYee opened this issue 5 years ago • 4 comments

Element Plus version

1.0.2-beta.65

OS/Browsers version

Chrome 92

Vue version

3.1.1

Reproduction Link

https://github.com/element-plus/element-plus

Steps to reproduce

such as : import type { TableProps } from 'element-plus/lib/el-table/src/table/defaults' import type { ElFormContext, ElFormItemContext } from 'element-plus/lib/el-form'

What is Expected?

it's success to import them

What is actually happening?

it's failed to import them

ChuHingYee avatar Jul 29 '21 07:07 ChuHingYee

the same bug , how to typescript correct import the element-plus project ?

mengkzhaoyun avatar Jul 29 '21 10:07 mengkzhaoyun

Actually we exposed *.d.ts for all components you can see here: image But I think there were some mistake we made in package.json which accidentally set field types to typings. I will try modify that and see what happens.

jw-foss avatar Jul 29 '21 13:07 jw-foss

Actually we exposed *.d.ts for all components you can see here: image But I think there were some mistake we made in package.json which accidentally set field types to typings. I will try modify that and see what happens.

i got it.thanks

ChuHingYee avatar Jul 29 '21 13:07 ChuHingYee

Since I double checked with the version beta.55 I didn't see any significant change for typings, we even added more typing files for this though. We will spend some time for investigating this issue, thank you for submitting image

Suggested work around: Import typing files via source code:

import type {} from '@element-plus/packages/table/src/table/defaults

cc @ChuHingYee @Mengkzhaoyun

jw-foss avatar Jul 29 '21 13:07 jw-foss