doc: update docs/typescript.md

This commit is contained in:
jaywcjlove 2024-08-09 11:27:33 +08:00
parent f80b5795bc
commit d42cbc7d2c

View File

@ -1495,6 +1495,18 @@ function makeBox<T>(value: T) {
}
```
### 保留一段时间字符串常量类型
```ts
type Color = "primary" | "secondary" | string;
```
修改成下面代码,有代码下拉提示
```ts
type Color = "primary" | "secondary" | (string & {});
```
---
不使用: