typescript3.8

Do I need to use the “import type” feature of TypeScript 3.8 if all of my imports are from my own file?

烂漫一生 提交于 2021-02-19 02:15:44
问题 I have a simple file types.ts that defines some types: export interface MyInterface { // ... } export const enum MyEnum { // ... } export type MyType = { // ... } I have read about the new feature import type for the latest typescript here. As far as I understand it is meant to fix specific problems which seems mostly to happen when importing from .js files. I can import my types with both import and import type statements. Both seems to work equally fine. The question is should I prefer

Do I need to use the “import type” feature of TypeScript 3.8 if all of my imports are from my own file?

房东的猫 提交于 2021-02-19 02:10:30
问题 I have a simple file types.ts that defines some types: export interface MyInterface { // ... } export const enum MyEnum { // ... } export type MyType = { // ... } I have read about the new feature import type for the latest typescript here. As far as I understand it is meant to fix specific problems which seems mostly to happen when importing from .js files. I can import my types with both import and import type statements. Both seems to work equally fine. The question is should I prefer

Do I need to use the “import type” feature of TypeScript 3.8 if all of my imports are from my own file?

久未见 提交于 2021-02-19 02:09:39
问题 I have a simple file types.ts that defines some types: export interface MyInterface { // ... } export const enum MyEnum { // ... } export type MyType = { // ... } I have read about the new feature import type for the latest typescript here. As far as I understand it is meant to fix specific problems which seems mostly to happen when importing from .js files. I can import my types with both import and import type statements. Both seems to work equally fine. The question is should I prefer