类型系统基础
类型系统高阶
模块组织史与工程
前端平台类型
工程化与综合
13-declaration-files
13-declaration-files/02-global-augmentation/demo/not-module.ts
typescript · 0.2 KB
运行:13 · global-augmentation
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
console
// 故意写错:文件没有顶层 export,不是模块,不能用 declare global。 // 期望 tsc 报 TS2669(由 tsconfig.fail.json 触发)。 declare global { interface Window { broken: string; } }
该文件由构建期采集,未做任何改写;源码页不进入搜索引擎索引。