主页
TypeScript
TypeScript 5.x 更新
demo_template_literal_types
运行 ❯
×
更改方向
保存代码
更改主题
type Color = "red" | "green" | "blue"; type HexColor
= `#${string}`; // Usage let myColor: HexColor<"blue"> = "#0000FF"; console.log(myColor)
#0000FF