我有一个看起来像这样的对象
type PersonObject = {
firstName: string;
lastName: string;
};
我想将PersonObject
类型转换为这种类型
type PersonFunction = (firstName: string, lastName: string) => void;
我被卡在转换器部分
type Converter<T> = ?
所以用法变成了
type PersonFunction = Converter<PersonObject>;
我已经尝试过utility-types,但是它没有我想要的实用程序。
如何编写该转换器?