We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 507dc9c + 2774f0b commit 2d37789Copy full SHA for 2d37789
docs/declare.md
@@ -241,7 +241,7 @@ const a:A = { x: 0, y: 0 };
241
242
上面示例中,脚本`a.ts`定义了一个接口`A`,脚本`b.ts`为这个接口添加了属性`y`。`declare module './a' {}`表示对`a.ts`里面的模块,进行类型声明,而同名 interface 会自动合并,所以等同于扩展类型。
243
244
-使用这种语法进行模块的类型扩展时,有两点需要注意:
+使用这种语法进行模块的类型扩展时,有三点需要注意:
245
246
(1)`declare module NAME`语法里面的模块名`NAME`,跟 import 和 export 的模块名规则是一样的,且必须跟当前文件加载该模块的语句写法(上例`import { A } from './a'`)保持一致。
247
0 commit comments