Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c1e6bd

Browse files
nikolausliuxcatliu
authored andcommitted
Update declaration-files.md
wrong code snippet
1 parent 102321e commit 2c1e6bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

basics/declaration-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ import { bar } from 'foo';
722722
// 整体导入
723723
import foo = require('foo');
724724
// 单个导入
725-
import bar = foo.bar;
725+
import bar = require('foo').bar;
726726
```
727727

728728
对于这种使用 commonjs 规范的库,假如要为它写类型声明文件的话,就需要使用到 `export =` 这种语法了[<sup>21</sup>](https://github.com/xcatliu/typescript-tutorial/tree/master/examples/declaration-files/21-export-equal)

0 commit comments

Comments
 (0)