FRANK GO

Results 27 comments of FRANK GO

![image](https://user-images.githubusercontent.com/33563058/183238070-20f2d4b8-06df-4f86-ae06-7c4a020e32a9.png) https://taro-docs.jd.com/taro/docs/react-page

``` type Foo = { a?: number; b?: string; c: boolean; } type Restore = { [P in keyof T]: T[P] } type SetRequired = Restore // 测试用例 type SomeRequired...

``` type Foo = { a?: number; b?: string; c: boolean; } type Restore = { [P in keyof T]: T[P] } type SetOptional = Restore // 测试用例 type SomeOptions...

核心的关键是subtype,如何理解。 ### 错误翻译: // '{ id: number; kind: string; }' is assignable to the constraint of type 'T', 返回的...可以附值给T的限制类型,即User // but 'T' could be instantiated with a different subtype of...

关于ReturnMake,来源 https://juejin.cn/post/7062903623470514207 ``` function makeCustomer(u: T): User { // Error(TS 编译器版本:v4.4.2) // Type '{ id: number; kind: string; }' is not assignable to type 'T'. // '{ id: number; kind:...

``` interface Example { a: string; b: string | number; c: () => void; d: {}; } type ConditionalPick = { [K in keyof T as T[K] extends P ?...

``` type Fn = (a: number, b: string) => number type AppendArgument any, addedType> = (x: addedType, ...args: Parameters) => ReturnType; type FinalFn = AppendArgument // (x: boolean, a: number,...

![image](https://user-images.githubusercontent.com/33563058/160266955-50b54794-6059-4b32-9bd9-208fc7e1f3da.png)