我有以下响应类型,我正在尝试使用unwrapFirstProperty函数对其进行分解。property = unwrapFirstProperty<MyResponse<'SOME_RESPONSE'>>(response); // of type any for some reason Typescript认为函数的返回类型是any而不是{ message: string; status: number; }。我可以做些什么来确保
假设我有一个JavaScript对象: id: 'my_id', // Base value that following value's structurescamelID: 'myId', // Camel case of `id`.我希望使用TypeScript来确保id始终是pascal小写。upperID和camelID具有相同的“值”,具有不同的字符串结构