在TypeScript中,有没有办法键入以下fn函数,以便TypeScript仍然知道result的类型是'hello' const hello = 'hello' // hello is of type'hello'
const result = fn(hello) // result is of type unknow
我有以下使用Typescript的import语句: import * as React from 'react';
import { MouseEvent } from 'react' Typescript抱怨我应该组合这些多个导入。出于某种原因,Typescript识别出import { MouseEvent } from 'react'中的MouseEvent接受类型泛