Skip to content

Commit

Permalink
feat: 模块
Browse files Browse the repository at this point in the history
  • Loading branch information
AnsonZnl committed Sep 12, 2023
1 parent 99281f9 commit 9baf2d2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/articles/TypeScript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,26 @@ tom.run();

任何包含 import 或 export 语句的文件,就是一个模块(module)。

导入导出的语法和 ES6 一致,使用`export` 导出,使用`import`导入,ES6 支持的 TS 都支持。

### 导入 type 和 interface

```ts
// a.ts export
export interface A {
foo: string;
}
export type B = String;
export const C = 123;
// b.ts import
import { type A, type B, C } from "./aa";
const a: A = { foo: "12" };
const b = "34";
console.log(a, b, C);
```

## 装饰器

## 其他

### 定义 window
Expand Down

1 comment on commit 9baf2d2

@vercel
Copy link

@vercel vercel bot commented on 9baf2d2 Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

v-blog – ./

v-blog-znl-github.vercel.app
zhangningle.vercel.app
v-blog-git-master-znl-github.vercel.app

Please sign in to comment.