Back to Type Challenges

README.Zh CN

questions/16259-medium-to-primitive/README.zh-CN.md

latest1.6 KB
Original Source
<!--info-header-start--><h1>将类型为字面类型(标签类型)的属性,转换为基本类型。 </h1><blockquote><p>by 前端子鱼 <a href="https://github.com/mwc" target="_blank">@mwc</a></p></blockquote><p><a href="https://tsch.js.org/16259/play/zh-CN" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.md" target="_blank"></a> </p><!--info-header-end-->

// 将类型为字面类型(标签类型)的属性,转换为基本类型。

type PersonInfo = { name: 'Tom', age: 30, married: false, addr: { home: '123456', phone: '13111111111' } }

// 要求结果如下: type PersonInfo = { name: string, age: number, married: boolean, addr: { home: string, phone: string } }

<!--info-footer-start-->

<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/16259/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/16259/solutions" target="_blank"></a> <!--info-footer-end-->