摘要: 1. TSD: https://github.com/SamVerschueren/tsd import {expectType} from 'tsd'; import concat from '.'; expectType<string>(concat('foo', 'bar')); expect 阅读全文
posted @ 2023-05-07 16:08 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: Blog: https://www.totaltypescript.com/react-component-props-type-helper Get any Prop type from html element: import { ComponentProps } from "react"; t 阅读全文
posted @ 2023-05-07 16:04 Zhentiw 阅读(83) 评论(0) 推荐(0)
摘要: import {Expect, Equal} from "../types/utils" import { expect, it } from 'vitest'; type PayloadsToDiscriminatedUnion<T extends Record<string, any>> = { 阅读全文
posted @ 2023-05-07 16:00 Zhentiw 阅读(26) 评论(0) 推荐(0)