我正在使用create-react-app和typescript和@ types / youtube进行开发。
当我在代码YT.PlayerState.PLAYING
上键入此行时。
我收到TypeScript错误Cannot access ambient const enums when the '--isolatedModules' flag is provided.
我看看打字:
declare namespace YT
{
/**
* State of a video player.
*/
export const enum PlayerState
{
UNSTARTED = -1,
ENDED = 0,
PLAYING = 1,
PAUSED = 2,
BUFFERING = 3,
CUED = 5
}
...
如何在不将标志isolatedModules
设置为false的情况下解决此问题?