ts 3.8更新相关
https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#type-only-imports-exports

private or

private: 只在 ts 检查生效中起到作用;
#:则会在 es 支持的环境中生效;

TypeScript currently can’t support this feature unless targeting ECMAScript 2015 (ES6) targets or higher.

相当于要设置 tsconfig 的 target > es6
也就是如果需要生产环境严格,还是使用 # ,如果只是开发中严格,使用 private

顶层 await

Top level await may not work in all environments where you might expect at this point. Currently, you can only use top level await when the target compiler option is es2017 or above, and module is esnext or system. Support within several environments and bundlers may be limited or may require enabling experimental support.

tsconfig
target: >= es2017
module: esnext / system
且必须要是一个模块文件,需要import 或 export

  1. const response = await fetch("...");
  2. const greeting = await response.text();
  3. console.log(greeting);
  4. // Make sure we're a module
  5. export {};

export * as

image.png