摘要: import { Equal, Expect } from "../helpers/type-utils"; const obj = { a: 1, b: 2, c: 3, } as const; type ObjKey = keyof typeof obj; //Type '"a"' is not 阅读全文
posted @ 2023-02-08 15:57 Zhentiw 阅读(24) 评论(0) 推荐(0) 编辑
摘要: // You'll need to use function overloads to figure this out! function useData<T>(params: { fetchData: () => Promise<T>; initialData?: T }): { getData: 阅读全文
posted @ 2023-02-08 14:18 Zhentiw 阅读(15) 评论(0) 推荐(0) 编辑